瀏覽代碼

1.修改iOS Apex Drivers国际化。

Pen Li 7 年之前
父節點
當前提交
44086b4446

+ 16 - 4
Redant Drivers/Apex And Drivers.xcodeproj/project.pbxproj

@@ -100,7 +100,6 @@
 		4259598C2148FD8200F7DD41 /* RASettingViewController+TableDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4259598B2148FD8200F7DD41 /* RASettingViewController+TableDataSource.m */; };
 		4259598F2148FD9200F7DD41 /* RASettingViewController+TableDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4259598E2148FD9200F7DD41 /* RASettingViewController+TableDelegate.m */; };
 		425959922148FE2600F7DD41 /* RASettingSectionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 425959912148FE2600F7DD41 /* RASettingSectionModel.m */; };
-		42595995214905E400F7DD41 /* setting.json in Resources */ = {isa = PBXBuildFile; fileRef = 42595994214905E400F7DD41 /* setting.json */; };
 		4259599921490AE900F7DD41 /* RAOptionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4259599821490AE900F7DD41 /* RAOptionViewController.m */; };
 		4259599C21490B6200F7DD41 /* RAOptionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4259599B21490B6200F7DD41 /* RAOptionCell.m */; };
 		425B97CB20C7895F00B35713 /* RASingleton.m in Sources */ = {isa = PBXBuildFile; fileRef = 425B97CA20C7895F00B35713 /* RASingleton.m */; };
@@ -173,6 +172,7 @@
 		42ECE189214A49B600AD8283 /* RAChangePasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42ECE188214A49B600AD8283 /* RAChangePasswordViewController.m */; };
 		42F0C5D720E20B3F00922442 /* RACameraViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42F0C5D620E20B3E00922442 /* RACameraViewController.m */; };
 		42F3A32C21829EAC00AB0D3D /* date.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42F3A32E21829EAC00AB0D3D /* date.storyboard */; };
+		42F3A3342182A53E00AB0D3D /* setting.json in Resources */ = {isa = PBXBuildFile; fileRef = 42F3A3362182A53E00AB0D3D /* setting.json */; };
 		42F624E5214BA4A100B1F012 /* RAMessageViewController+DataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 42F624E4214BA4A100B1F012 /* RAMessageViewController+DataSource.m */; };
 		42F624E8214BA4AF00B1F012 /* RAMessageViewController+Delegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 42F624E7214BA4AF00B1F012 /* RAMessageViewController+Delegate.m */; };
 		42F624EB214BA50D00B1F012 /* RAMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42F624EA214BA50D00B1F012 /* RAMessageCell.m */; };
@@ -379,7 +379,6 @@
 		4259598E2148FD9200F7DD41 /* RASettingViewController+TableDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RASettingViewController+TableDelegate.m"; sourceTree = "<group>"; };
 		425959902148FE2600F7DD41 /* RASettingSectionModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RASettingSectionModel.h; sourceTree = "<group>"; };
 		425959912148FE2600F7DD41 /* RASettingSectionModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RASettingSectionModel.m; sourceTree = "<group>"; };
-		42595994214905E400F7DD41 /* setting.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = setting.json; sourceTree = "<group>"; };
 		4259599721490AE900F7DD41 /* RAOptionViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAOptionViewController.h; sourceTree = "<group>"; };
 		4259599821490AE900F7DD41 /* RAOptionViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAOptionViewController.m; sourceTree = "<group>"; };
 		4259599A21490B6200F7DD41 /* RAOptionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAOptionCell.h; sourceTree = "<group>"; };
@@ -533,6 +532,9 @@
 		42F3A33021829EAE00AB0D3D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/date.strings; sourceTree = "<group>"; };
 		42F3A33221829EAF00AB0D3D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/date.strings"; sourceTree = "<group>"; };
 		42F3A33321829FEF00AB0D3D /* RAPresentationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAPresentationController.h; sourceTree = "<group>"; };
+		42F3A3352182A53E00AB0D3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = Base; path = Base.lproj/setting.json; sourceTree = "<group>"; };
+		42F3A3372182A54100AB0D3D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = en; path = en.lproj/setting.json; sourceTree = "<group>"; };
+		42F3A3382182A54200AB0D3D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = "zh-Hans"; path = "zh-Hans.lproj/setting.json"; sourceTree = "<group>"; };
 		42F624E3214BA4A100B1F012 /* RAMessageViewController+DataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RAMessageViewController+DataSource.h"; sourceTree = "<group>"; };
 		42F624E4214BA4A100B1F012 /* RAMessageViewController+DataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RAMessageViewController+DataSource.m"; sourceTree = "<group>"; };
 		42F624E6214BA4AF00B1F012 /* RAMessageViewController+Delegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RAMessageViewController+Delegate.h"; sourceTree = "<group>"; };
@@ -939,7 +941,7 @@
 		425959932149040300F7DD41 /* Data */ = {
 			isa = PBXGroup;
 			children = (
-				42595994214905E400F7DD41 /* setting.json */,
+				42F3A3362182A53E00AB0D3D /* setting.json */,
 			);
 			path = Data;
 			sourceTree = "<group>";
@@ -1421,7 +1423,7 @@
 				42DCCC902181B2F10027A5BB /* Upload.storyboard in Resources */,
 				42DCCC562181AB7C0027A5BB /* Home.storyboard in Resources */,
 				42DCCC4F2181AA4C0027A5BB /* Login.storyboard in Resources */,
-				42595995214905E400F7DD41 /* setting.json in Resources */,
+				42F3A3342182A53E00AB0D3D /* setting.json in Resources */,
 				4235FAB8213E581E000B6672 /* Signature.xcassets in Resources */,
 				42F3A32C21829EAC00AB0D3D /* date.storyboard in Resources */,
 				71EAA33920B9571B002F003C /* Main.storyboard in Resources */,
@@ -1690,6 +1692,16 @@
 			name = date.storyboard;
 			sourceTree = "<group>";
 		};
+		42F3A3362182A53E00AB0D3D /* setting.json */ = {
+			isa = PBXVariantGroup;
+			children = (
+				42F3A3352182A53E00AB0D3D /* Base */,
+				42F3A3372182A54100AB0D3D /* en */,
+				42F3A3382182A54200AB0D3D /* zh-Hans */,
+			);
+			name = setting.json;
+			sourceTree = "<group>";
+		};
 		71EAA33720B9571B002F003C /* Main.storyboard */ = {
 			isa = PBXVariantGroup;
 			children = (

+ 9 - 0
Redant Drivers/Apex And Drivers/Base.lproj/Localizable.strings

@@ -114,3 +114,12 @@ CFBundleDisplayName="Apex & Drivers";
 "no more" = "no more";
 "pull to refresh" = "pull to refresh";
 "loosen to refresh" = "loosen to refresh";
+
+
+/**
+ * Setting
+ */
+"about_ver" = "Ver:%@ build %@";
+"about_surpport" = "redantsupport@united-us.net";
+"Clean Success" = "Clean Success";
+"are you sure to clean cached file" = "are you sure to clean cached file";

+ 0 - 0
Redant Drivers/Apex And Drivers/Setting/Data/setting.json → Redant Drivers/Apex And Drivers/Setting/Data/Base.lproj/setting.json


+ 62 - 0
Redant Drivers/Apex And Drivers/Setting/Data/en.lproj/setting.json

@@ -0,0 +1,62 @@
+{
+    "sections": [
+                 {
+                 "settings": [
+                              {
+                              "type": 0,
+                              "keyPath": "backgroundReportType",
+                              "title": "Response Location Request",
+                              "options": [
+                                          {
+                                          "option": 1,
+                                          "title": "Reject"
+                                          },
+                                          {
+                                          "option": 2,
+                                          "title": "Always ask"
+                                          },
+                                          {
+                                          "option": 3,
+                                          "title": "Allow"
+                                          }
+                                          ]
+                              }
+                              ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 2,
+                              "actionType": 1,
+                              "title": "Change Password"
+                              }
+                              ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 2,
+                              "actionType": 0,
+                              "title": "Clean Cache"
+                              }
+                              ]
+                 },
+                 {
+                 "settings": [
+                     {
+                         "type": 4,
+                         "title": "Privacy Policy",
+                         "link": "https://ra.apexshipping.com/t/privacyPolicy.html"
+                     }
+                 ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 3,
+                              "title": "About"
+                              }
+                              ]
+                 }
+                 ]
+}

+ 62 - 0
Redant Drivers/Apex And Drivers/Setting/Data/zh-Hans.lproj/setting.json

@@ -0,0 +1,62 @@
+{
+    "sections": [
+                 {
+                 "settings": [
+                              {
+                              "type": 0,
+                              "keyPath": "backgroundReportType",
+                              "title": "响应位置请求",
+                              "options": [
+                                          {
+                                          "option": 1,
+                                          "title": "拒绝"
+                                          },
+                                          {
+                                          "option": 2,
+                                          "title": "每次询问"
+                                          },
+                                          {
+                                          "option": 3,
+                                          "title": "允许"
+                                          }
+                                          ]
+                              }
+                              ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 2,
+                              "actionType": 1,
+                              "title": "修改密码"
+                              }
+                              ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 2,
+                              "actionType": 0,
+                              "title": "清除缓存"
+                              }
+                              ]
+                 },
+                 {
+                 "settings": [
+                     {
+                         "type": 4,
+                         "title": "隐私政策",
+                         "link": "https://ra.apexshipping.com/t/privacyPolicy.html"
+                     }
+                 ]
+                 },
+                 {
+                 "settings": [
+                              {
+                              "type": 3,
+                              "title": "关于"
+                              }
+                              ]
+                 }
+                 ]
+}

+ 2 - 2
Redant Drivers/Apex And Drivers/Setting/Model/RASettingAboutModel.m

@@ -32,7 +32,7 @@
         NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
         NSString *ver = [infoDic objectForKey:@"CFBundleShortVersionString"];
         NSString *build = [infoDic objectForKey:@"CFBundleVersion"];
-        _appVer = [NSString stringWithFormat:@"Ver:%@ build %@",ver,build];
+        _appVer = [NSString localizedStringWithFormat:NSLocalizedString(@"about_ver", nil),ver,build];
     }
     return _appVer;
 }
@@ -46,7 +46,7 @@
 
 - (NSString *)appSupport {
     if (!_appSupport) {
-        _appSupport = @"redantsupport@united-us.net";
+        _appSupport = NSLocalizedString(@"about_surpport", nil);
     }
     return _appSupport;
 }

+ 4 - 4
Redant Drivers/Apex And Drivers/Setting/RASettingViewController+TableDelegate.m

@@ -89,12 +89,12 @@
     
     dispatch_async(dispatch_get_main_queue(), ^{
     
-        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"are you sure to clean cached file" preferredStyle:UIAlertControllerStyleAlert];
-        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Warning", nil) message:NSLocalizedString(@"are you sure to clean cached file", nil) preferredStyle:UIAlertControllerStyleAlert];
+        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             
         }];
         
-        UIAlertAction *yesAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+        UIAlertAction *yesAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"YES", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
             
             model.active = YES;
             
@@ -116,7 +116,7 @@
                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
                     model.active = NO;
 
-                    [self showAlert:@"Clean Success"];
+                    [self showAlert:NSLocalizedString(@"Clean Success", nil)];
                 });
 
             });

+ 2 - 2
Redant Drivers/Apex And Drivers/config.h

@@ -17,8 +17,8 @@
 #define ApexDriverWhiteColor UIColorFromRGB(0xffffff)
 #define ApexDriverRedColor UIColorFromRGB(0xAE2838)
 
-//#define URL_HOST                @"http://192.168.0.124:8080/t"
-#define URL_HOST                @"https://ra.apexshipping.com/t"
+#define URL_HOST                @"http://192.168.0.124:8080/t"
+//#define URL_HOST                @"https://ra.apexshipping.com/t"
 
 
 #define APPENDING_STR(var)      [URL_HOST stringByAppendingString:var]

+ 8 - 0
Redant Drivers/Apex And Drivers/en.lproj/Localizable.strings

@@ -115,3 +115,11 @@ CFBundleDisplayName="Apex & Drivers";
 "no more" = "no more";
 "pull to refresh" = "pull to refresh";
 "loosen to refresh" = "loosen to refresh";
+
+/**
+ * Setting
+ */
+"about_ver" = "Ver:%@ build %@";
+"about_surpport" = "redantsupport@united-us.net";
+"Clean Success" = "Clean Success";
+"are you sure to clean cached file" = "are you sure to clean cached file";

+ 8 - 0
Redant Drivers/Apex And Drivers/zh-Hans.lproj/Localizable.strings

@@ -116,3 +116,11 @@ CFBundleDisplayName="汽车人";
 "pull to refresh" = "下拉刷新";
 "loosen to refresh" = "松开刷新";
 
+/**
+ * Setting
+ */
+"about_ver" = "版本:%@ build %@";
+"about_surpport" = "redantsupport@united-us.net";
+"Clean Success" = "清除成功";
+"are you sure to clean cached file" = "你确定要清除缓存文件吗?";
+