Skip to content

Commit

Permalink
Add localization
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyyoung committed Jun 30, 2018
1 parent 5c7cfc3 commit c7a4ece
Show file tree
Hide file tree
Showing 20 changed files with 316 additions and 38 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/* Class = "NSMenuItem"; title = "Enabled"; ObjectID = "10G-t9-s4T"; */
"10G-t9-s4T.title" = "Enabled";

/* Class = "NSTextFieldCell"; title = "Need to restart"; ObjectID = "2vl-mc-m3L"; */
"2vl-mc-m3L.title" = "Need to restart";

/* Class = "NSMenuItem"; title = "Enabled"; ObjectID = "KQg-jN-y9a"; */
"KQg-jN-y9a.title" = "Enabled";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "MEN-Kg-wfj"; */
"MEN-Kg-wfj.title" = "Disabled";

/* Class = "NSTextFieldCell"; title = "Message recall notification:"; ObjectID = "UKv-CM-nGt"; */
"UKv-CM-nGt.title" = "Message recall notification:";

/* Class = "NSTextFieldCell"; title = "Auto login:"; ObjectID = "UiV-zj-l6I"; */
"UiV-zj-l6I.title" = "Auto login:";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Uk9-Oc-Jtv"; */
"Uk9-Oc-Jtv.title" = "Disabled";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Vcv-eD-OM9"; */
"Vcv-eD-OM9.title" = "Disabled";

/* Class = "NSMenuItem"; title = "All"; ObjectID = "da4-aJ-lEy"; */
"da4-aJ-lEy.title" = "All";

/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
"gec-CY-E1x.title" = "Inherited";

/* Class = "NSTextFieldCell"; title = "Alfred JSON compressing:"; ObjectID = "jHw-2a-B2t"; */
"jHw-2a-B2t.title" = "Alfred JSON compressing:";
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/* Class = "NSMenuItem"; title = "Enabled"; ObjectID = "10G-t9-s4T"; */
"10G-t9-s4T.title" = "开启";

/* Class = "NSTextFieldCell"; title = "Need to restart"; ObjectID = "2vl-mc-m3L"; */
"2vl-mc-m3L.title" = "需重启客户端";

/* Class = "NSMenuItem"; title = "Enabled"; ObjectID = "KQg-jN-y9a"; */
"KQg-jN-y9a.title" = "开启";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "MEN-Kg-wfj"; */
"MEN-Kg-wfj.title" = "关闭";

/* Class = "NSTextFieldCell"; title = "Message recall notification:"; ObjectID = "UKv-CM-nGt"; */
"UKv-CM-nGt.title" = "消息撤回通知:";

/* Class = "NSTextFieldCell"; title = "Auto login:"; ObjectID = "UiV-zj-l6I"; */
"UiV-zj-l6I.title" = "免认证登录:";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Uk9-Oc-Jtv"; */
"Uk9-Oc-Jtv.title" = "关闭";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Vcv-eD-OM9"; */
"Vcv-eD-OM9.title" = "关闭";

/* Class = "NSMenuItem"; title = "All"; ObjectID = "da4-aJ-lEy"; */
"da4-aJ-lEy.title" = "全部接收";

/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
"gec-CY-E1x.title" = "跟随聊天设置";

/* Class = "NSTextFieldCell"; title = "Alfred JSON compressing:"; ObjectID = "jHw-2a-B2t"; */
"jHw-2a-B2t.title" = "Alfred JSON 压缩:";
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

/* Class = "NSMenuItem"; title = "Enabled"; ObjectID = "10G-t9-s4T"; */
"10G-t9-s4T.title" = "開啟";

/* Class = "NSTextFieldCell"; title = "Need to restart"; ObjectID = "2vl-mc-m3L"; */
"2vl-mc-m3L.title" = "需重啟客戶端";

/* Class = "NSMenuItem"; title = "Enabled"; ObjectID = "KQg-jN-y9a"; */
"KQg-jN-y9a.title" = "開啟";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "MEN-Kg-wfj"; */
"MEN-Kg-wfj.title" = "關閉";

/* Class = "NSTextFieldCell"; title = "Message recall notification:"; ObjectID = "UKv-CM-nGt"; */
"UKv-CM-nGt.title" = "消息撤回通知:";

/* Class = "NSTextFieldCell"; title = "Auto login:"; ObjectID = "UiV-zj-l6I"; */
"UiV-zj-l6I.title" = "免認證登錄:";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Uk9-Oc-Jtv"; */
"Uk9-Oc-Jtv.title" = "關閉";

/* Class = "NSMenuItem"; title = "Disabled"; ObjectID = "Vcv-eD-OM9"; */
"Vcv-eD-OM9.title" = "關閉";

/* Class = "NSMenuItem"; title = "All"; ObjectID = "da4-aJ-lEy"; */
"da4-aJ-lEy.title" = "全部接收";

/* Class = "NSMenuItem"; title = "Inherited"; ObjectID = "gec-CY-E1x"; */
"gec-CY-E1x.title" = "跟隨聊天設置";

/* Class = "NSTextFieldCell"; title = "Alfred JSON compressing:"; ObjectID = "jHw-2a-B2t"; */
"jHw-2a-B2t.title" = "Alfred JSON 壓縮:";
Binary file modified WeChatTweak.framework/Versions/A/WeChatTweak
Binary file not shown.
46 changes: 42 additions & 4 deletions WeChatTweak.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
7D14E5A41F6447DB00D75132 /* AlfredManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D14E5A21F6447DB00D75132 /* AlfredManager.h */; };
7D14E5A51F6447DB00D75132 /* AlfredManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D14E5A31F6447DB00D75132 /* AlfredManager.m */; };
7D54A05C20E74D9400CB5306 /* TweakPreferecesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D54A05E20E74D9400CB5306 /* TweakPreferecesController.xib */; };
7D54A06A20E74FE500CB5306 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7D54A06C20E74FE500CB5306 /* Localizable.strings */; };
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F31F82A415004E6370 /* fishhook.c */; };
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D9049F41F82A415004E6370 /* fishhook.h */; };
7D9049F91F82B6FB004E6370 /* NSString+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */; };
Expand All @@ -19,7 +21,6 @@
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842331F4058AB00D42D79 /* WeChatTweak.m */; };
7DF842521F4058C600D42D79 /* TweakPreferecesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8424F1F4058C600D42D79 /* TweakPreferecesController.h */; };
7DF842531F4058C600D42D79 /* TweakPreferecesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842501F4058C600D42D79 /* TweakPreferecesController.m */; };
7DF842541F4058C600D42D79 /* TweakPreferecesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7DF842511F4058C600D42D79 /* TweakPreferecesController.xib */; };
7DF8425B1F4058DD00D42D79 /* NSBundle+WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF842571F4058DD00D42D79 /* NSBundle+WeChatTweak.h */; };
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */; };
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */; };
Expand All @@ -46,6 +47,13 @@
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeChatTweak.a"; sourceTree = BUILT_PRODUCTS_DIR; };
7D14E5A21F6447DB00D75132 /* AlfredManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlfredManager.h; sourceTree = "<group>"; };
7D14E5A31F6447DB00D75132 /* AlfredManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlfredManager.m; sourceTree = "<group>"; };
7D54A05F20E74E4600CB5306 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/TweakPreferecesController.xib; sourceTree = "<group>"; };
7D54A06320E74E5A00CB5306 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/TweakPreferecesController.strings; sourceTree = "<group>"; };
7D54A06520E74E8200CB5306 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/TweakPreferecesController.strings"; sourceTree = "<group>"; };
7D54A06720E74E8E00CB5306 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/TweakPreferecesController.strings"; sourceTree = "<group>"; };
7D54A07020E74FFD00CB5306 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
7D54A07120E7535F00CB5306 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
7D54A07220E7536300CB5306 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
7D9049F31F82A415004E6370 /* fishhook.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fishhook.c; sourceTree = "<group>"; };
7D9049F41F82A415004E6370 /* fishhook.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fishhook.h; sourceTree = "<group>"; };
7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+WeChatTweak.h"; sourceTree = "<group>"; };
Expand All @@ -58,7 +66,6 @@
7DF842331F4058AB00D42D79 /* WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeChatTweak.m; sourceTree = "<group>"; };
7DF8424F1F4058C600D42D79 /* TweakPreferecesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweakPreferecesController.h; sourceTree = "<group>"; };
7DF842501F4058C600D42D79 /* TweakPreferecesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweakPreferecesController.m; sourceTree = "<group>"; };
7DF842511F4058C600D42D79 /* TweakPreferecesController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TweakPreferecesController.xib; sourceTree = "<group>"; };
7DF842571F4058DD00D42D79 /* NSBundle+WeChatTweak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+WeChatTweak.h"; sourceTree = "<group>"; };
7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+WeChatTweak.m"; sourceTree = "<group>"; };
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeChatTweakHeaders.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -103,7 +110,7 @@
children = (
7DF8424F1F4058C600D42D79 /* TweakPreferecesController.h */,
7DF842501F4058C600D42D79 /* TweakPreferecesController.m */,
7DF842511F4058C600D42D79 /* TweakPreferecesController.xib */,
7D54A05E20E74D9400CB5306 /* TweakPreferecesController.xib */,
);
path = Controller;
sourceTree = "<group>";
Expand Down Expand Up @@ -133,6 +140,7 @@
children = (
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */,
7DF8422B1F40583F00D42D79 /* Info.plist */,
7D54A06C20E74FE500CB5306 /* Localizable.strings */,
);
path = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -249,6 +257,9 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
"zh-Hans",
"zh-Hant",
);
mainGroup = 7DF8421D1F40583F00D42D79;
productRefGroup = 7DF842281F40583F00D42D79 /* Products */;
Expand All @@ -266,7 +277,8 @@
buildActionMask = 2147483647;
files = (
7DF842651F40594400D42D79 /* Prefs-Tweak.tiff in Resources */,
7DF842541F4058C600D42D79 /* TweakPreferecesController.xib in Resources */,
7D54A06A20E74FE500CB5306 /* Localizable.strings in Resources */,
7D54A05C20E74D9400CB5306 /* TweakPreferecesController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -310,11 +322,36 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
7D54A05E20E74D9400CB5306 /* TweakPreferecesController.xib */ = {
isa = PBXVariantGroup;
children = (
7D54A05F20E74E4600CB5306 /* Base */,
7D54A06320E74E5A00CB5306 /* en */,
7D54A06520E74E8200CB5306 /* zh-Hans */,
7D54A06720E74E8E00CB5306 /* zh-Hant */,
);
name = TweakPreferecesController.xib;
sourceTree = "<group>";
};
7D54A06C20E74FE500CB5306 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
7D54A07020E74FFD00CB5306 /* en */,
7D54A07120E7535F00CB5306 /* zh-Hans */,
7D54A07220E7536300CB5306 /* zh-Hant */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
7DF8422D1F40583F00D42D79 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down Expand Up @@ -374,6 +411,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
Expand Down
1 change: 1 addition & 0 deletions WeChatTweak/Category/NSBundle+WeChatTweak.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
@interface NSBundle (WeChatTweak)

+ (instancetype)tweakBundle;
- (NSString *)localizedStringForKey:(NSString *)key;

@end
4 changes: 4 additions & 0 deletions WeChatTweak/Category/NSBundle+WeChatTweak.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ + (instancetype)tweakBundle {
return [NSBundle bundleWithIdentifier:@"net.sunnyyoung.WeChatTweak"];
}

- (NSString *)localizedStringForKey:(NSString *)key {
return [self localizedStringForKey:key value:nil table:nil];
}

@end
Loading

0 comments on commit c7a4ece

Please sign in to comment.