Skip to content

Commit 3d766fb

Browse files
author
たつぞう
committed
feat: Traditional Chinese translation & typo fix
1 parent 574cc4a commit 3d766fb

File tree

10 files changed

+40
-23
lines changed

10 files changed

+40
-23
lines changed

EhPanda.xcodeproj/project.pbxproj

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
ABCD2F09259763FC008E5A20 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = "<group>"; };
109109
ABCD2F0D25976B95008E5A20 /* Parser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = "<group>"; };
110110
ABD5FDD3263D05110021A4C6 /* .swiftlint.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = SOURCE_ROOT; };
111+
ABE9376C265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
112+
ABE9376D265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
111113
ABEA1FE525A9B40B002966B9 /* Setting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Setting.swift; sourceTree = "<group>"; };
112114
ABEE0AFB2595C6F800C997AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
113115
ABEE0AFE2595C73D00C997AE /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
@@ -395,6 +397,7 @@
395397
Base,
396398
ja,
397399
"zh-Hans",
400+
"zh-Hant",
398401
);
399402
mainGroup = ABC3C74B2593696C00E0C11B;
400403
packageReferences = (
@@ -521,6 +524,7 @@
521524
AB7E6B3125D24FE00035CC68 /* ja */,
522525
AB7E6B3425D24FE40035CC68 /* zh-Hans */,
523526
AB7E6B3525D24FE50035CC68 /* en */,
527+
ABE9376D265DCD9400EA8B30 /* zh-Hant */,
524528
);
525529
name = InfoPlist.strings;
526530
sourceTree = "<group>";
@@ -531,6 +535,7 @@
531535
ABEE0AFB2595C6F800C997AE /* en */,
532536
ABEE0AFE2595C73D00C997AE /* zh-Hans */,
533537
AB994DBB25986F7A00E9A367 /* ja */,
538+
ABE9376C265DCD9400EA8B30 /* zh-Hant */,
534539
);
535540
name = Localizable.strings;
536541
sourceTree = "<group>";
@@ -665,7 +670,7 @@
665670
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
666671
CODE_SIGN_ENTITLEMENTS = EhPanda/EhPanda.entitlements;
667672
CODE_SIGN_STYLE = Automatic;
668-
CURRENT_PROJECT_VERSION = 49;
673+
CURRENT_PROJECT_VERSION = 50;
669674
DEVELOPMENT_ASSET_PATHS = "";
670675
DEVELOPMENT_TEAM = 9SKQ7QTZ74;
671676
ENABLE_PREVIEWS = YES;
@@ -692,7 +697,7 @@
692697
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
693698
CODE_SIGN_ENTITLEMENTS = EhPanda/EhPanda.entitlements;
694699
CODE_SIGN_STYLE = Automatic;
695-
CURRENT_PROJECT_VERSION = 49;
700+
CURRENT_PROJECT_VERSION = 50;
696701
DEVELOPMENT_ASSET_PATHS = "";
697702
DEVELOPMENT_TEAM = 9SKQ7QTZ74;
698703
ENABLE_PREVIEWS = YES;

EhPanda/App/Extensions.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ extension String {
7474
) ?? ""
7575
}
7676

77+
var withComma: String? {
78+
guard let intSelf = Int(self) else { return nil }
79+
80+
return getStringWithComma(intSelf)
81+
}
82+
7783
func capitalizingFirstLetter() -> String {
7884
prefix(1).capitalized + dropFirst()
7985
}
@@ -172,14 +178,7 @@ extension Bundle {
172178

173179
extension Int {
174180
var withComma: String? {
175-
let decimalFormatter = NumberFormatter()
176-
decimalFormatter.numberStyle = .decimal
177-
decimalFormatter.locale = Locale.current
178-
179-
let string = decimalFormatter.string(
180-
from: self as NSNumber
181-
)
182-
return string
181+
getStringWithComma(self)
183182
}
184183
}
185184

EhPanda/App/Utility.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ func copyHTMLIfNeeded(_ html: String?) {
215215
}
216216
}
217217

218+
func getStringWithComma(_ value: Int) -> String? {
219+
let decimalFormatter = NumberFormatter()
220+
decimalFormatter.numberStyle = .decimal
221+
decimalFormatter.locale = Locale.current
222+
223+
let string = decimalFormatter.string(
224+
from: value as NSNumber
225+
)
226+
return string
227+
}
228+
218229
// MARK: UserDefaults
219230
let isDebugModeOn = UserDefaults.standard.bool(forKey: "debugModeOn")
220231

EhPanda/App/ja.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"Finish" = "完了";
9999
"Copy cookies" = "クッキーをコピー";
100100

101-
"Apperance" = "外観";
101+
"Appearance" = "外観";
102102
"Global" = "全般";
103103
"Theme" = "テーマ";
104104
"Tint Color" = "テーマの色";

EhPanda/App/zh-Hans.lproj/Localizable.strings

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

3232
// MARK: AlertView
3333
"Loading..." = "加载中...";
34-
"You need to login to use this app." = "请登陆以使用这个App";
35-
"Login" = "登陆";
34+
"You need to login to use this app." = "请登录以使用这个App";
35+
"Login" = "登录";
3636
"Your search didn't match any docs." = "未能找到你需要的信息";
3737
"Retry" = "重试";
3838
"A Network error occurred.\nPlease try again later." = "网络发生故障\n请稍后再试";
@@ -74,11 +74,11 @@
7474
"Setting" = "设置";
7575
"Account" = "账户";
7676
"Gallery" = "画廊";
77-
"Login" = "登陆";
78-
"Logout" = "退出登陆";
77+
"Login" = "登录";
78+
"Logout" = "退出登录";
7979
"Account configuration" = "账户设置";
8080
"Manage tags subscription" = "管理标签订阅";
81-
"Are you sure to logout?" = "确定要退出登陆吗?";
81+
"Are you sure to logout?" = "确定要退出登录吗?";
8282
"Are you sure to clear?" = "确定要清空吗?";
8383
"Clear" = "清空";
8484
"Warning" = "警告";
@@ -98,7 +98,7 @@
9898
"Finish" = "完成";
9999
"Copy cookies" = "复制Cookies";
100100

101-
"Apperance" = "外观";
101+
"Appearance" = "外观";
102102
"Global" = "全局";
103103
"Theme" = "主题";
104104
"Tint Color" = "主题色";

EhPanda/App/zh-Hant.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"Finish" = "完成";
9999
"Copy cookies" = "複製Cookies";
100100

101-
"Apperance" = "外觀";
101+
"Appearance" = "外觀";
102102
"Global" = "全局";
103103
"Theme" = "主題";
104104
"Tint Color" = "主題色";

EhPanda/View/Detail/ArchiveView.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ struct ArchiveView: View, StoreAccessor {
5454

5555
Spacer()
5656

57-
if let galleryPoints = currentGP,
58-
let credits = currentCredits
57+
if let galleryPoints = currentGP?.withComma,
58+
let credits = currentCredits?.withComma
5959
{
6060
BalanceView(galleryPoints: galleryPoints, credits: credits)
6161
}
@@ -243,10 +243,12 @@ private struct BalanceView: View {
243243
HStack(spacing: 3) {
244244
Image(systemName: "g.circle.fill")
245245
Text(galleryPoints)
246+
.lineLimit(1)
246247
}
247248
HStack(spacing: 3) {
248249
Image(systemName: "c.circle.fill")
249250
Text(credits)
251+
.lineLimit(1)
250252
}
251253
}
252254
.font(.headline)

EhPanda/View/Setting/AppearanceSettingView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct AppearanceSettingView: View, StoreAccessor {
8282
}
8383
}
8484
}
85-
.navigationBarTitle("Apperance")
85+
.navigationBarTitle("Appearance")
8686
}
8787
}
8888

EhPanda/View/Setting/ReadingSettingView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct ReadingSettingView: View, StoreAccessor {
3737
.pickerStyle(MenuPickerStyle())
3838
}
3939
}
40-
Section(header: Text("Apperance")) {
40+
Section(header: Text("Appearance")) {
4141
HStack {
4242
Text("Separator height")
4343
Spacer()

EhPanda/View/Setting/SettingView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct SettingView: View, StoreAccessor {
3232
)
3333
SettingRow(
3434
symbolName: "circle.righthalf.fill",
35-
text: "Apperance",
35+
text: "Appearance",
3636
destination: AppearanceSettingView()
3737
)
3838
SettingRow(

0 commit comments

Comments
 (0)