From a266fe7456d8834f84e8a7ff88e1fc8786017688 Mon Sep 17 00:00:00 2001 From: Kohli Date: Mon, 10 Sep 2018 15:21:59 -0400 Subject: [PATCH 1/4] localizing camera permission denied message --- plugin.xml | 1 + src/ios/CDVCamera.m | 2 +- src/ios/Camera.strings | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 src/ios/Camera.strings diff --git a/plugin.xml b/plugin.xml index 34059d07f..a4873dd8a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -100,6 +100,7 @@ + diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index c71de0546..f19d84849 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -174,7 +174,7 @@ - (void)takePicture:(CDVInvokedUrlCommand*)command dispatch_async(dispatch_get_main_queue(), ^{ [[[UIAlertView alloc] initWithTitle:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] - message:NSLocalizedString(@"Access to the camera has been prohibited; please enable it in the Settings app to continue.", nil) + message:NSLocalizedStringFromTable(@"camera.prohibited", @"Camera", nil) delegate:weakSelf cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:settingsButton, nil] show]; diff --git a/src/ios/Camera.strings b/src/ios/Camera.strings new file mode 100644 index 000000000..a3dfd3cb5 --- /dev/null +++ b/src/ios/Camera.strings @@ -0,0 +1 @@ +"camera.prohibited" = "Access to the camera has been prohibited; please enable it in the Settings app to continue."; \ No newline at end of file From 990528b3d10ac40ca60e65d400e64af5939b2a01 Mon Sep 17 00:00:00 2001 From: Kohli Date: Mon, 10 Sep 2018 15:28:05 -0400 Subject: [PATCH 2/4] fixing path --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index a4873dd8a..0bb584f80 100644 --- a/plugin.xml +++ b/plugin.xml @@ -100,7 +100,7 @@ - + From a08868b32411f5926a19bf3c0e4f00cb334ee58a Mon Sep 17 00:00:00 2001 From: Kohli Date: Mon, 10 Sep 2018 16:28:26 -0400 Subject: [PATCH 3/4] adding buttons to locale file --- src/ios/CDVCamera.m | 4 ++-- src/ios/Camera.strings | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m index f19d84849..695b2b2f6 100644 --- a/src/ios/CDVCamera.m +++ b/src/ios/CDVCamera.m @@ -166,7 +166,7 @@ - (void)takePicture:(CDVInvokedUrlCommand*)command #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wtautological-pointer-compare" NSString* settingsButton = (&UIApplicationOpenSettingsURLString != NULL) - ? NSLocalizedString(@"Settings", nil) + ? NSLocalizedStringFromTable(@"camera.settings", @"Camera", nil) : nil; #pragma clang diagnostic pop @@ -176,7 +176,7 @@ - (void)takePicture:(CDVInvokedUrlCommand*)command objectForInfoDictionaryKey:@"CFBundleDisplayName"] message:NSLocalizedStringFromTable(@"camera.prohibited", @"Camera", nil) delegate:weakSelf - cancelButtonTitle:NSLocalizedString(@"OK", nil) + cancelButtonTitle:NSLocalizedStringFromTable(@"camera.ok", @"Camera", nil) otherButtonTitles:settingsButton, nil] show]; }); } diff --git a/src/ios/Camera.strings b/src/ios/Camera.strings index a3dfd3cb5..eb725a0b7 100644 --- a/src/ios/Camera.strings +++ b/src/ios/Camera.strings @@ -1 +1,3 @@ -"camera.prohibited" = "Access to the camera has been prohibited; please enable it in the Settings app to continue."; \ No newline at end of file +"camera.prohibited" = "Access to the camera has been prohibited; please enable it in the Settings app to continue."; +"camera.ok" = "Settings"; +"camera.settings" = "OK"; \ No newline at end of file From 328cd20221063140c13ff86a64b2492798658d8d Mon Sep 17 00:00:00 2001 From: Ankit Kohli Date: Mon, 17 Sep 2018 15:34:08 -0400 Subject: [PATCH 4/4] Update Camera.strings --- src/ios/Camera.strings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ios/Camera.strings b/src/ios/Camera.strings index eb725a0b7..751e49207 100644 --- a/src/ios/Camera.strings +++ b/src/ios/Camera.strings @@ -1,3 +1,3 @@ "camera.prohibited" = "Access to the camera has been prohibited; please enable it in the Settings app to continue."; -"camera.ok" = "Settings"; -"camera.settings" = "OK"; \ No newline at end of file +"camera.ok" = "OK"; +"camera.settings" = "Settings";