diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo.xcodeproj/project.pbxproj b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo.xcodeproj/project.pbxproj index 66ed24f..cd08512 100644 --- a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo.xcodeproj/project.pbxproj +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo.xcodeproj/project.pbxproj @@ -54,6 +54,12 @@ 4B32F2051EF003E40066445B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ThirdViewController.xib; sourceTree = ""; }; 4B32F2081EF003E50066445B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ThirdViewController.strings; sourceTree = ""; }; 4B32F20A1EF003E60066445B /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/ThirdViewController.strings"; sourceTree = ""; }; + C0CED9E4240F481400AB9EDD /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/FirstViewController.strings; sourceTree = ""; }; + C0CED9E5240F481400AB9EDD /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/SecondViewController.strings; sourceTree = ""; }; + C0CED9E6240F481500AB9EDD /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/ThirdViewController.strings; sourceTree = ""; }; + C0CED9E7240F481500AB9EDD /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = ""; }; + C0CED9E8240F481500AB9EDD /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + C0CED9E9240F481500AB9EDD /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/InfoPlist.strings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -157,7 +163,7 @@ TargetAttributes = { 4B32F1A71EEFDE840066445B = { CreatedOnToolsVersion = 8.3.1; - DevelopmentTeam = YP3GK894M5; + DevelopmentTeam = 9H3JSEL6A9; ProvisioningStyle = Automatic; }; }; @@ -170,6 +176,7 @@ en, Base, "zh-Hans", + ja, ); mainGroup = 4B32F19F1EEFDE840066445B; productRefGroup = 4B32F1A91EEFDE840066445B /* Products */; @@ -220,6 +227,7 @@ children = ( 4B32F1BA1EEFDE840066445B /* Base */, 4B32F1C61EEFE7A50066445B /* zh-Hans */, + C0CED9E7240F481500AB9EDD /* ja */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -230,6 +238,7 @@ 4B32F1D21EEFE8A40066445B /* Base */, 4B32F1D51EEFE8A50066445B /* en */, 4B32F1D71EEFE8A60066445B /* zh-Hans */, + C0CED9E4240F481400AB9EDD /* ja */, ); name = FirstViewController.xib; sourceTree = ""; @@ -240,6 +249,7 @@ 4B32F1D91EEFE9850066445B /* Base */, 4B32F1F51EEFF4340066445B /* en */, 4B32F1F71EEFF4360066445B /* zh-Hans */, + C0CED9E5240F481400AB9EDD /* ja */, ); name = SecondViewController.xib; sourceTree = ""; @@ -250,6 +260,7 @@ 4B32F1E81EEFF38C0066445B /* Base */, 4B32F1EA1EEFF38D0066445B /* en */, 4B32F1EB1EEFF38D0066445B /* zh-Hans */, + C0CED9E8240F481500AB9EDD /* ja */, ); name = Localizable.strings; sourceTree = ""; @@ -260,6 +271,7 @@ 4B32F1FB1EF000220066445B /* Base */, 4B32F1FD1EF000240066445B /* en */, 4B32F1FE1EF000250066445B /* zh-Hans */, + C0CED9E9240F481500AB9EDD /* ja */, ); name = InfoPlist.strings; sourceTree = ""; @@ -270,6 +282,7 @@ 4B32F2051EF003E40066445B /* Base */, 4B32F2081EF003E50066445B /* en */, 4B32F20A1EF003E60066445B /* zh-Hans */, + C0CED9E6240F481500AB9EDD /* ja */, ); name = ThirdViewController.xib; sourceTree = ""; @@ -375,7 +388,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = YP3GK894M5; + DEVELOPMENT_TEAM = 9H3JSEL6A9; INFOPLIST_FILE = iOSAppLanguageSwitchDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -388,7 +401,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = YP3GK894M5; + DEVELOPMENT_TEAM = 9H3JSEL6A9; INFOPLIST_FILE = iOSAppLanguageSwitchDemo/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json index 36d2c80..d8db8d6 100644 --- a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -30,6 +40,16 @@ "size" : "60x60", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -59,6 +79,16 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Base.lproj/SecondViewController.xib b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Base.lproj/SecondViewController.xib index 36fd46a..818d34e 100644 --- a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Base.lproj/SecondViewController.xib +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/Base.lproj/SecondViewController.xib @@ -1,11 +1,11 @@ - + - + @@ -26,15 +26,16 @@ - - + diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/FirstViewController.m b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/FirstViewController.m index 044f3f9..7b86543 100644 --- a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/FirstViewController.m +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/FirstViewController.m @@ -35,10 +35,6 @@ [self presentViewController:vc animated:YES completion:nil]; } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} /* #pragma mark - Navigation diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/SecondViewController.m b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/SecondViewController.m index cae23be..f461cb8 100644 --- a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/SecondViewController.m +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/SecondViewController.m @@ -47,6 +47,14 @@ } + +- (IBAction)setupJapaneseAction:(id)sender { + [self showHUDCompletion:^{ + [NSBundle setCusLanguage:@"ja"]; + }]; + +} + - (IBAction)currentLanguage:(id)sender { NSString *currLanguage = [NSBundle getCusLanguage]; NSLog(@"当前语言是=%@", currLanguage); @@ -69,11 +77,6 @@ [self presentViewController:vc animated:NO completion:completion]; } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - /* #pragma mark - Navigation diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ThirdViewController.m b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ThirdViewController.m index 28ed2a6..57ab71f 100644 --- a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ThirdViewController.m +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ThirdViewController.m @@ -26,10 +26,6 @@ }); } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} /* #pragma mark - Navigation diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/FirstViewController.strings b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/FirstViewController.strings new file mode 100644 index 0000000..f0f8717 --- /dev/null +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/FirstViewController.strings @@ -0,0 +1,3 @@ + +/* Class = "UIButton"; normalTitle = "下一页"; ObjectID = "dJk-yb-oRh"; */ +"dJk-yb-oRh.normalTitle" = "下一页日语"; diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/InfoPlist.strings b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/InfoPlist.strings new file mode 100644 index 0000000..a01f23d --- /dev/null +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/InfoPlist.strings @@ -0,0 +1,8 @@ +/* + InfoPlist.strings + iOSAppLanguageSwitchDemo + + Created by zengqingfu on 2017/6/13. + Copyright © 2017年 zengqingfu. All rights reserved. +*/ +"CFBundleDisplayName" = "日文切换d测试"; diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/LaunchScreen.strings b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/LaunchScreen.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/Localizable.strings b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/Localizable.strings new file mode 100644 index 0000000..aa78a9e --- /dev/null +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/Localizable.strings @@ -0,0 +1,8 @@ +/* + Localizable.strings + iOSAppLanguageSwitchDemo + + Created by zengqingfu on 2017/6/13. + Copyright © 2017年 zengqingfu. All rights reserved. +*/ +"cus_item" = "这是日文"; diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/SecondViewController.strings b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/SecondViewController.strings new file mode 100644 index 0000000..15c977f --- /dev/null +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/SecondViewController.strings @@ -0,0 +1,18 @@ + +/* Class = "UIButton"; normalTitle = "关闭"; ObjectID = "CK4-kE-Lyr"; */ +"CK4-kE-Lyr.normalTitle" = "关闭(日文)"; + +/* Class = "UIButton"; normalTitle = "设置成英文"; ObjectID = "FKp-xO-AWr"; */ +"FKp-xO-AWr.normalTitle" = "设置成英文(日文)"; + +/* Class = "UIButton"; normalTitle = "恢复成系统语言"; ObjectID = "hqn-O1-exW"; */ +"hqn-O1-exW.normalTitle" = "恢复成系统语言(日文)"; + +/* Class = "UIButton"; normalTitle = "字符串测试"; ObjectID = "kXe-Ad-9Ls"; */ +"kXe-Ad-9Ls.normalTitle" = "字符串测试(日文)"; + +/* Class = "UIButton"; normalTitle = "设置成中文"; ObjectID = "sRN-Uf-gCL"; */ +"sRN-Uf-gCL.normalTitle" = "设置成中文(日文)"; + +/* Class = "UIButton"; normalTitle = "获取当前自定义语言"; ObjectID = "wzO-U2-Cbk"; */ +"wzO-U2-Cbk.normalTitle" = "获取当前自定义语言(日文)"; diff --git a/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/ThirdViewController.strings b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/ThirdViewController.strings new file mode 100644 index 0000000..4f22d8d --- /dev/null +++ b/iOSAppLanguageSwitchDemo/iOSAppLanguageSwitchDemo/ja.lproj/ThirdViewController.strings @@ -0,0 +1,3 @@ + +/* Class = "UILabel"; text = "正在设置语言..."; ObjectID = "yTu-Le-1xE"; */ +"yTu-Le-1xE.text" = "正在设置语言...";