Skip to content

Commit

Permalink
feat: Traditional Chinese translation & typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuz0u committed May 26, 2021
1 parent 574cc4a commit 3d766fb
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 23 deletions.
9 changes: 7 additions & 2 deletions EhPanda.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
ABCD2F09259763FC008E5A20 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = "<group>"; };
ABCD2F0D25976B95008E5A20 /* Parser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = "<group>"; };
ABD5FDD3263D05110021A4C6 /* .swiftlint.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .swiftlint.yml; sourceTree = SOURCE_ROOT; };
ABE9376C265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
ABE9376D265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
ABEA1FE525A9B40B002966B9 /* Setting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Setting.swift; sourceTree = "<group>"; };
ABEE0AFB2595C6F800C997AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
ABEE0AFE2595C73D00C997AE /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -395,6 +397,7 @@
Base,
ja,
"zh-Hans",
"zh-Hant",
);
mainGroup = ABC3C74B2593696C00E0C11B;
packageReferences = (
Expand Down Expand Up @@ -521,6 +524,7 @@
AB7E6B3125D24FE00035CC68 /* ja */,
AB7E6B3425D24FE40035CC68 /* zh-Hans */,
AB7E6B3525D24FE50035CC68 /* en */,
ABE9376D265DCD9400EA8B30 /* zh-Hant */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
Expand All @@ -531,6 +535,7 @@
ABEE0AFB2595C6F800C997AE /* en */,
ABEE0AFE2595C73D00C997AE /* zh-Hans */,
AB994DBB25986F7A00E9A367 /* ja */,
ABE9376C265DCD9400EA8B30 /* zh-Hant */,
);
name = Localizable.strings;
sourceTree = "<group>";
Expand Down Expand Up @@ -665,7 +670,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = EhPanda/EhPanda.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 49;
CURRENT_PROJECT_VERSION = 50;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 9SKQ7QTZ74;
ENABLE_PREVIEWS = YES;
Expand All @@ -692,7 +697,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = EhPanda/EhPanda.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 49;
CURRENT_PROJECT_VERSION = 50;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 9SKQ7QTZ74;
ENABLE_PREVIEWS = YES;
Expand Down
15 changes: 7 additions & 8 deletions EhPanda/App/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ extension String {
) ?? ""
}

var withComma: String? {
guard let intSelf = Int(self) else { return nil }

return getStringWithComma(intSelf)
}

func capitalizingFirstLetter() -> String {
prefix(1).capitalized + dropFirst()
}
Expand Down Expand Up @@ -172,14 +178,7 @@ extension Bundle {

extension Int {
var withComma: String? {
let decimalFormatter = NumberFormatter()
decimalFormatter.numberStyle = .decimal
decimalFormatter.locale = Locale.current

let string = decimalFormatter.string(
from: self as NSNumber
)
return string
getStringWithComma(self)
}
}

Expand Down
11 changes: 11 additions & 0 deletions EhPanda/App/Utility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,17 @@ func copyHTMLIfNeeded(_ html: String?) {
}
}

func getStringWithComma(_ value: Int) -> String? {
let decimalFormatter = NumberFormatter()
decimalFormatter.numberStyle = .decimal
decimalFormatter.locale = Locale.current

let string = decimalFormatter.string(
from: value as NSNumber
)
return string
}

// MARK: UserDefaults
let isDebugModeOn = UserDefaults.standard.bool(forKey: "debugModeOn")

Expand Down
2 changes: 1 addition & 1 deletion EhPanda/App/ja.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"Finish" = "完了";
"Copy cookies" = "クッキーをコピー";

"Apperance" = "外観";
"Appearance" = "外観";
"Global" = "全般";
"Theme" = "テーマ";
"Tint Color" = "テーマの色";
Expand Down
12 changes: 6 additions & 6 deletions EhPanda/App/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

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

"Apperance" = "外观";
"Appearance" = "外观";
"Global" = "全局";
"Theme" = "主题";
"Tint Color" = "主题色";
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/App/zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"Finish" = "完成";
"Copy cookies" = "複製Cookies";

"Apperance" = "外觀";
"Appearance" = "外觀";
"Global" = "全局";
"Theme" = "主題";
"Tint Color" = "主題色";
Expand Down
6 changes: 4 additions & 2 deletions EhPanda/View/Detail/ArchiveView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ struct ArchiveView: View, StoreAccessor {

Spacer()

if let galleryPoints = currentGP,
let credits = currentCredits
if let galleryPoints = currentGP?.withComma,
let credits = currentCredits?.withComma
{
BalanceView(galleryPoints: galleryPoints, credits: credits)
}
Expand Down Expand Up @@ -243,10 +243,12 @@ private struct BalanceView: View {
HStack(spacing: 3) {
Image(systemName: "g.circle.fill")
Text(galleryPoints)
.lineLimit(1)
}
HStack(spacing: 3) {
Image(systemName: "c.circle.fill")
Text(credits)
.lineLimit(1)
}
}
.font(.headline)
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/View/Setting/AppearanceSettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct AppearanceSettingView: View, StoreAccessor {
}
}
}
.navigationBarTitle("Apperance")
.navigationBarTitle("Appearance")
}
}

Expand Down
2 changes: 1 addition & 1 deletion EhPanda/View/Setting/ReadingSettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct ReadingSettingView: View, StoreAccessor {
.pickerStyle(MenuPickerStyle())
}
}
Section(header: Text("Apperance")) {
Section(header: Text("Appearance")) {
HStack {
Text("Separator height")
Spacer()
Expand Down
2 changes: 1 addition & 1 deletion EhPanda/View/Setting/SettingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct SettingView: View, StoreAccessor {
)
SettingRow(
symbolName: "circle.righthalf.fill",
text: "Apperance",
text: "Appearance",
destination: AppearanceSettingView()
)
SettingRow(
Expand Down

0 comments on commit 3d766fb

Please sign in to comment.