Skip to content

Commit

Permalink
脚本使用流程简化
Browse files Browse the repository at this point in the history
  • Loading branch information
onezens committed Jan 9, 2018
1 parent 941c455 commit a4250bc
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 25 deletions.
39 changes: 26 additions & 13 deletions AutoLocalization.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

/* Begin PBXBuildFile section */
09D6FC0C1F3B23F400189A75 /* Dis.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 09D6FC0E1F3B23F400189A75 /* Dis.storyboard */; };
09D6FC121F3B244F00189A75 /* DisView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 09D6FC111F3B244F00189A75 /* DisView.xib */; };
09D6FC1D1F3B298B00189A75 /* me.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 09D6FC1F1F3B298B00189A75 /* me.storyboard */; };
09D6FC241F3B299800189A75 /* icon.xib in Resources */ = {isa = PBXBuildFile; fileRef = 09D6FC261F3B299800189A75 /* icon.xib */; };
09D6FC3F1F3BFEC600189A75 /* View.xib in Resources */ = {isa = PBXBuildFile; fileRef = 09D6FC411F3BFEC600189A75 /* View.xib */; };
359021A42004544700F1D840 /* DisView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 359021A62004544700F1D840 /* DisView.xib */; };
655125551CB6B1B8009D2E17 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655125541CB6B1B8009D2E17 /* AppDelegate.swift */; };
655125571CB6B1B8009D2E17 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655125561CB6B1B8009D2E17 /* ViewController.swift */; };
6551255A1CB6B1B8009D2E17 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 655125581CB6B1B8009D2E17 /* Main.storyboard */; };
Expand All @@ -23,7 +23,6 @@

/* Begin PBXFileReference section */
09D6FC0D1F3B23F400189A75 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Dis.storyboard; sourceTree = "<group>"; };
09D6FC111F3B244F00189A75 /* DisView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DisView.xib; sourceTree = "<group>"; };
09D6FC141F3B24AE00189A75 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Dis.strings; sourceTree = "<group>"; };
09D6FC161F3B24B000189A75 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Dis.strings"; sourceTree = "<group>"; };
09D6FC1E1F3B298B00189A75 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/me.storyboard; sourceTree = "<group>"; };
Expand All @@ -35,6 +34,9 @@
09D6FC401F3BFEC600189A75 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/View.xib; sourceTree = "<group>"; };
09D6FC431F3BFEC800189A75 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/View.strings; sourceTree = "<group>"; };
09D6FC451F3BFEC900189A75 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/View.strings"; sourceTree = "<group>"; };
359021A52004544700F1D840 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DisView.xib; sourceTree = "<group>"; };
359021A82004544D00F1D840 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/DisView.strings; sourceTree = "<group>"; };
359021AA2004544E00F1D840 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/DisView.strings"; sourceTree = "<group>"; };
655125511CB6B1B8009D2E17 /* AutoLocalization.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AutoLocalization.app; sourceTree = BUILT_PRODUCTS_DIR; };
655125541CB6B1B8009D2E17 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
655125561CB6B1B8009D2E17 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -74,7 +76,7 @@
isa = PBXGroup;
children = (
09D6FC0E1F3B23F400189A75 /* Dis.storyboard */,
09D6FC111F3B244F00189A75 /* DisView.xib */,
359021A62004544700F1D840 /* DisView.xib */,
);
path = Discovery;
sourceTree = "<group>";
Expand Down Expand Up @@ -171,7 +173,7 @@
TargetAttributes = {
655125501CB6B1B8009D2E17 = {
CreatedOnToolsVersion = 7.3;
DevelopmentTeam = J4N8RS9Y8V;
DevelopmentTeam = 6QXR4W42GG;
LastSwiftMigration = 0800;
};
};
Expand Down Expand Up @@ -203,7 +205,7 @@
6551255F1CB6B1B8009D2E17 /* LaunchScreen.storyboard in Resources */,
6551255C1CB6B1B8009D2E17 /* Assets.xcassets in Resources */,
655125741CB6B4D2009D2E17 /* View.xib in Resources */,
09D6FC121F3B244F00189A75 /* DisView.xib in Resources */,
359021A42004544700F1D840 /* DisView.xib in Resources */,
6551255A1CB6B1B8009D2E17 /* Main.storyboard in Resources */,
D75244461EE10FBE007050E6 /* AutoGenStrings.py in Resources */,
09D6FC3F1F3BFEC600189A75 /* View.xib in Resources */,
Expand All @@ -218,16 +220,17 @@
/* Begin PBXShellScriptBuildPhase section */
6551256E1CB6B46B009D2E17 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 8;
buildActionMask = 12;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/bash\npython ${SRCROOT}/${TARGET_NAME}/RunScript/AutoGenStrings.py ${SRCROOT}/${TARGET_NAME}";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -284,6 +287,16 @@
name = View.xib;
sourceTree = "<group>";
};
359021A62004544700F1D840 /* DisView.xib */ = {
isa = PBXVariantGroup;
children = (
359021A52004544700F1D840 /* Base */,
359021A82004544D00F1D840 /* en */,
359021AA2004544E00F1D840 /* zh-Hans */,
);
name = DisView.xib;
sourceTree = "<group>";
};
655125581CB6B1B8009D2E17 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -403,9 +416,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEPLOYMENT_LOCATION = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DEVELOPMENT_TEAM = J4N8RS9Y8V;
DEPLOYMENT_LOCATION = NO;
DEPLOYMENT_POSTPROCESSING = NO;
DEVELOPMENT_TEAM = 6QXR4W42GG;
INFOPLIST_FILE = AutoLocalization/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = cc.onezens.AutoLocalization;
Expand All @@ -418,9 +431,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEPLOYMENT_LOCATION = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DEVELOPMENT_TEAM = J4N8RS9Y8V;
DEPLOYMENT_LOCATION = NO;
DEPLOYMENT_POSTPROCESSING = NO;
DEVELOPMENT_TEAM = 6QXR4W42GG;
INFOPLIST_FILE = AutoLocalization/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = cc.onezens.AutoLocalization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion AutoLocalization/Home/Discovery/en.lproj/Dis.strings
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@


//##################################################################################
//# AutoGenStrings 2017-08-10 09:45:03
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "kOz-y7-QOz"; */
Expand Down
17 changes: 17 additions & 0 deletions AutoLocalization/Home/Discovery/en.lproj/DisView.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


//##################################################################################
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "dZe-zN-oNf"; */
"dZe-zN-oNf.text" = "Label";

/* Class = "UILabel"; text = "Label"; ObjectID = "gOd-L6-6c0"; */
"gOd-L6-6c0.text" = "Label";

/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "os9-xA-JY6"; */
"os9-xA-JY6.normalTitle" = "Button";

/* Class = "UILabel"; text = "Label"; ObjectID = "WPw-z6-GMX"; */
"WPw-z6-GMX.text" = "Label";
2 changes: 1 addition & 1 deletion AutoLocalization/Home/Discovery/zh-Hans.lproj/Dis.strings
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


//##################################################################################
//# AutoGenStrings 2017-08-10 09:45:03
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "kOz-y7-QOz"; */
Expand Down
17 changes: 17 additions & 0 deletions AutoLocalization/Home/Discovery/zh-Hans.lproj/DisView.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


//##################################################################################
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "dZe-zN-oNf"; */
"dZe-zN-oNf.text" = "Label";

/* Class = "UILabel"; text = "Label"; ObjectID = "gOd-L6-6c0"; */
"gOd-L6-6c0.text" = "Label";

/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "os9-xA-JY6"; */
"os9-xA-JY6.normalTitle" = "Button";

/* Class = "UILabel"; text = "Label"; ObjectID = "WPw-z6-GMX"; */
"WPw-z6-GMX.text" = "Label";
4 changes: 1 addition & 3 deletions AutoLocalization/en.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@




//##################################################################################
//# AutoGenStrings 2017-08-10 09:45:02
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "Lkh-tG-cBY"; */
Expand Down
2 changes: 1 addition & 1 deletion AutoLocalization/en.lproj/View.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


//##################################################################################
//# AutoGenStrings 2017-08-10 09:45:03
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "g6X-hB-Whc"; */
Expand Down
3 changes: 1 addition & 2 deletions AutoLocalization/zh-Hans.lproj/Main.strings
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@



//##################################################################################
//# AutoGenStrings 2017-08-10 09:45:02
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "Lkh-tG-cBY"; */
Expand Down
2 changes: 1 addition & 1 deletion AutoLocalization/zh-Hans.lproj/View.strings
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


//##################################################################################
//# AutoGenStrings 2017-08-10 09:45:03
//# AutoGenStrings 2018-01-09 09:37:34
//##################################################################################

/* Class = "UILabel"; text = "Label"; ObjectID = "g6X-hB-Whc"; */
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ xib和storyboard自动国际化,iOS开发者必备工具
1. 将存放脚本文件的文件夹,导入脚本文件到项目的`根目录`
2. 选择项目 -> targes -> Build Phases -> + -> New Run Script Phase
3. 添加两个运行脚本,其中一个添加脚本`python ${SRCROOT}/${TARGET_NAME}/RunScript/AutoGenStrings.py ${SRCROOT}/${TARGET_NAME}`
4. Build Setting -> Deployment -> Deployment Location / Deployment Postprocessing -> Yes
5. 分别创建一个xib和storyboard,然后开启国际化后,添加控件,Command + B 后查看你的国际化文件
4. 分别创建一个xib和storyboard,然后开启国际化后,添加控件,Command + B 后查看你的国际化文件

![](http://7xq8l3.com1.z0.glb.clouddn.com/AutoLocalization1.png)

![](http://upload-images.jianshu.io/upload_images/1216462-9f20ceca2e58bebb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

Expand Down

0 comments on commit a4250bc

Please sign in to comment.