Skip to content

Commit

Permalink
Add localization for Chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed Apr 10, 2021
1 parent 6f25b9f commit 1ebe04c
Show file tree
Hide file tree
Showing 12 changed files with 6,112 additions and 111 deletions.
48 changes: 40 additions & 8 deletions Squirrel Designer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,31 @@
objects = {

/* Begin PBXBuildFile section */
D24509822621E8D800EB4BAC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D24509842621E8D800EB4BAC /* Main.storyboard */; };
D24509922621F4AA00EB4BAC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = D24509942621F4AA00EB4BAC /* Localizable.strings */; };
D2830BBB24FEC87E00BF44BE /* Template.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2830BBA24FEC87E00BF44BE /* Template.swift */; };
D2830BBF24FEFDD400BF44BE /* CodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2830BBE24FEFDD400BF44BE /* CodeView.swift */; };
D2B5B52024FD85CA00F7304E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B5B51F24FD85CA00F7304E /* AppDelegate.swift */; };
D2B5B52224FD85CA00F7304E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B5B52124FD85CA00F7304E /* ViewController.swift */; };
D2B5B52424FD85CC00F7304E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D2B5B52324FD85CC00F7304E /* Assets.xcassets */; };
D2B5B53224FDC85500F7304E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D2B5B53124FDC85500F7304E /* Main.storyboard */; };
D2B5B53424FDCE2700F7304E /* LayoutModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B5B53324FDCE2700F7304E /* LayoutModel.swift */; };
D2BAA6A825009BEF007B6521 /* SquirrelLayout.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D2BAA6A625009BEF007B6521 /* SquirrelLayout.xcdatamodeld */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
D24509832621E8D800EB4BAC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
D245098D2621EE2200EB4BAC /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "zh-Hant"; path = "zh-Hant.lproj/Main.storyboard"; sourceTree = "<group>"; };
D24509932621F4AA00EB4BAC /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
D24509952621F4AF00EB4BAC /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
D2830BBA24FEC87E00BF44BE /* Template.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Template.swift; sourceTree = "<group>"; };
D2830BBE24FEFDD400BF44BE /* CodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeView.swift; sourceTree = "<group>"; };
D2AD1370262200B900929320 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "zh-Hans"; path = "zh-Hans.lproj/Main.storyboard"; sourceTree = "<group>"; };
D2B5B51C24FD85CA00F7304E /* Squirrel Designer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Squirrel Designer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D2B5B51F24FD85CA00F7304E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
D2B5B52124FD85CA00F7304E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
D2B5B52324FD85CC00F7304E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
D2B5B52824FD85CC00F7304E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D2B5B52924FD85CC00F7304E /* Squirrel_Designer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Squirrel_Designer.entitlements; sourceTree = "<group>"; };
D2B5B53124FDC85500F7304E /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
D2B5B53324FDCE2700F7304E /* LayoutModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutModel.swift; sourceTree = "<group>"; };
D2BAA6A725009BEF007B6521 /* SquirrelLayout.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SquirrelLayout.xcdatamodel; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -45,6 +50,7 @@
D2B5B51324FD85CA00F7304E = {
isa = PBXGroup;
children = (
D24509942621F4AA00EB4BAC /* Localizable.strings */,
D2B5B51E24FD85CA00F7304E /* Squirrel Designer */,
D2B5B51D24FD85CA00F7304E /* Products */,
);
Expand All @@ -68,7 +74,7 @@
D2830BBA24FEC87E00BF44BE /* Template.swift */,
D2B5B52324FD85CC00F7304E /* Assets.xcassets */,
D2B5B52824FD85CC00F7304E /* Info.plist */,
D2B5B53124FDC85500F7304E /* Main.storyboard */,
D24509842621E8D800EB4BAC /* Main.storyboard */,
D2B5B52924FD85CC00F7304E /* Squirrel_Designer.entitlements */,
D2BAA6A625009BEF007B6521 /* SquirrelLayout.xcdatamodeld */,
);
Expand Down Expand Up @@ -117,6 +123,8 @@
knownRegions = (
en,
Base,
"zh-Hant",
"zh-Hans",
);
mainGroup = D2B5B51324FD85CA00F7304E;
productRefGroup = D2B5B51D24FD85CA00F7304E /* Products */;
Expand All @@ -134,7 +142,8 @@
buildActionMask = 2147483647;
files = (
D2B5B52424FD85CC00F7304E /* Assets.xcassets in Resources */,
D2B5B53224FDC85500F7304E /* Main.storyboard in Resources */,
D24509922621F4AA00EB4BAC /* Localizable.strings in Resources */,
D24509822621E8D800EB4BAC /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -156,6 +165,29 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
D24509842621E8D800EB4BAC /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
D24509832621E8D800EB4BAC /* Base */,
D245098D2621EE2200EB4BAC /* zh-Hant */,
D2AD1370262200B900929320 /* zh-Hans */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
D24509942621F4AA00EB4BAC /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
D24509932621F4AA00EB4BAC /* zh-Hant */,
D24509952621F4AF00EB4BAC /* zh-Hans */,
);
name = Localizable.strings;
path = "Squirrel Designer";
sourceTree = SOURCE_ROOT;
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
D2B5B52A24FD85CC00F7304E /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -283,7 +315,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = 28HU5A7B46;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "Squirrel Designer/Info.plist";
Expand All @@ -292,7 +324,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.4;
MARKETING_VERSION = 1.5;
PRODUCT_BUNDLE_IDENTIFIER = "Rime.Squirrel-Designer";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -307,7 +339,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 16;
DEVELOPMENT_TEAM = 28HU5A7B46;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "Squirrel Designer/Info.plist";
Expand All @@ -316,7 +348,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.4;
MARKETING_VERSION = 1.5;
PRODUCT_BUNDLE_IDENTIFIER = "Rime.Squirrel-Designer";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,69 +59,6 @@
</items>
</menu>
</menuItem>
<menuItem title="File" id="dMs-cI-mzQ">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="File" id="bib-Uj-vzu">
<items>
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
<connections>
<action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
<connections>
<action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="tXI-mr-wws">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
<items>
<menuItem title="Clear Menu" id="vNY-rz-j42">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
<connections>
<action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
</connections>
</menuItem>
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
<connections>
<action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
</connections>
</menuItem>
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
<connections>
<action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
<connections>
<action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
<connections>
<action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="5QF-Oa-p0T">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
Expand Down Expand Up @@ -603,38 +540,6 @@
</items>
</menu>
</menuItem>
<menuItem title="View" id="H8h-7b-M4v">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="View" id="HyV-fh-RgO">
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleSidebar:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
</connections>
</menuItem>
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
Expand Down Expand Up @@ -1644,7 +1549,7 @@
<rect key="frame" x="-100" y="-100" width="523" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="0.084210526315789513" horizontal="NO" id="heW-H9-Cu5">
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="heW-H9-Cu5">
<rect key="frame" x="509" y="0.0" width="16" height="310"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
Expand Down
2 changes: 1 addition & 1 deletion Squirrel Designer/CodeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class CodeViewController: NSViewController {
}
override func viewDidDisappear() {
if let parent = parentView {
parent.generateCodeButton.title = "Show Code"
parent.generateCodeButton.title = NSLocalizedString("Show Code", comment: "Show Code")
}
}
}
2 changes: 1 addition & 1 deletion Squirrel Designer/LayoutModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ class SquirrelPanel: NSWindow {
self.orderOut(nil)
_maxHeight = 0
self._visible = false
parentView?.showPreviewButton.title = "Show Preview"
parentView?.showPreviewButton.title = NSLocalizedString("Show Preview", comment: "Show Preview")
}

func setCandidateFormat(_ candidateFormat: NSString) {
Expand Down
10 changes: 5 additions & 5 deletions Squirrel Designer/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,10 @@ class ViewController: NSViewController {
preview.position = view.window!.convertToScreen(view.frame)
if preview.isVisible {
preview.hide()
showPreviewButton.title = "Show Preview"
showPreviewButton.title = NSLocalizedString("Show Preview", comment: "Show Preview")
} else {
preview.updateAndShow()
showPreviewButton.title = "Hide Preview"
showPreviewButton.title = NSLocalizedString("Hide Preview", comment: "Hide Preview")
}
}
@IBAction func resetPressed(_ sender: Any) {
Expand Down Expand Up @@ -555,12 +555,12 @@ class ViewController: NSViewController {
codeWindow.setFrameOrigin(childFrame.origin)
childWindow = codeWindowController
codeWindowController.showWindow(nil)
generateCodeButton.title = "Hide Code"
generateCodeButton.title = NSLocalizedString("Hide Code", comment: "Hide Code")
}
} else {
childWindow!.close()
childWindow = nil
generateCodeButton.title = "Show Code"
generateCodeButton.title = NSLocalizedString("Show Code", comment: "Show Code")
}
}

Expand Down Expand Up @@ -840,7 +840,7 @@ class ViewController: NSViewController {
windowAlphaField.stringValue = "\(layout.alpha)"
}
func codeViewDidDispear() {
generateCodeButton.title = "Show Code"
generateCodeButton.title = NSLocalizedString("Show Code", comment: "Show Code")
}
func reset() {
layout = SquirrelLayout()
Expand Down
7 changes: 7 additions & 0 deletions Squirrel Designer/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
Localizable.strings
Squirrel Designer

Created by LEO Yoon-Tsaw on 4/10/21.
Copyright © 2021 Yuncao Liu. All rights reserved.
*/
13 changes: 13 additions & 0 deletions Squirrel Designer/zh-HK.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
Localizable.strings
Squirrel Designer

Created by LEO Yoon-Tsaw on 4/10/21.
Copyright © 2021 Yuncao Liu. All rights reserved.
*/

"Hide Preview" = "收預覽";
"Show Preview" = "預覽";

"Hide Code" = "收代碼";
"Show Code" = "代碼";
Loading

0 comments on commit 1ebe04c

Please sign in to comment.