Browse Source

dev NCLoginQRCode

marinofaggiana 6 years ago
parent
commit
690e9811fc

+ 5 - 5
iOSClient/Login/NCLoginQRCode.swift

@@ -77,9 +77,9 @@ class NCLoginQRCode: NSObject, QRCodeReaderViewControllerDelegate {
             
             switch error.code {
             case -11852:
-                alert = UIAlertController(title: "Error", message: "This app is not authorized to use Back Camera.", preferredStyle: .alert)
+                alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_qrcode_not_authorized_", comment: ""), preferredStyle: .alert)
                 
-                alert.addAction(UIAlertAction(title: "Setting", style: .default, handler: { (_) in
+                alert.addAction(UIAlertAction(title: NSLocalizedString("_settings_", comment: ""), style: .default, handler: { (_) in
                     DispatchQueue.main.async {
                         if let settingsURL = URL(string: UIApplication.openSettingsURLString) {
                             UIApplication.shared.open(settingsURL, options: [:], completionHandler: nil)
@@ -87,10 +87,10 @@ class NCLoginQRCode: NSObject, QRCodeReaderViewControllerDelegate {
                     }
                 }))
                 
-                alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
+                alert.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil))
             default:
-                alert = UIAlertController(title: "Error", message: "Reader not supported by the current device", preferredStyle: .alert)
-                alert.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
+                alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_qrcode_not_supported_", comment: ""), preferredStyle: .alert)
+                alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .cancel, handler: nil))
             }
             
             delegate?.present(alert, animated: true, completion: nil)

+ 4 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -720,3 +720,7 @@
 
 "Try again in 1 minute" = "Try again in 1 minute";
 
+// QRCode
+
+"_qrcode_not_authorized_"   = "This app is not authorized to use Back Camera";
+"_qrcode_not_supported_"    = "QRCode not supported by the current device";