diff --git a/EhPanda.xcodeproj/project.pbxproj b/EhPanda.xcodeproj/project.pbxproj index 5b416500..29239cae 100644 --- a/EhPanda.xcodeproj/project.pbxproj +++ b/EhPanda.xcodeproj/project.pbxproj @@ -108,6 +108,8 @@ ABCD2F09259763FC008E5A20 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; ABCD2F0D25976B95008E5A20 /* Parser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Parser.swift; sourceTree = ""; }; 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 = ""; }; + ABE9376D265DCD9400EA8B30 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/InfoPlist.strings"; sourceTree = ""; }; ABEA1FE525A9B40B002966B9 /* Setting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Setting.swift; sourceTree = ""; }; ABEE0AFB2595C6F800C997AE /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; ABEE0AFE2595C73D00C997AE /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; @@ -395,6 +397,7 @@ Base, ja, "zh-Hans", + "zh-Hant", ); mainGroup = ABC3C74B2593696C00E0C11B; packageReferences = ( @@ -521,6 +524,7 @@ AB7E6B3125D24FE00035CC68 /* ja */, AB7E6B3425D24FE40035CC68 /* zh-Hans */, AB7E6B3525D24FE50035CC68 /* en */, + ABE9376D265DCD9400EA8B30 /* zh-Hant */, ); name = InfoPlist.strings; sourceTree = ""; @@ -531,6 +535,7 @@ ABEE0AFB2595C6F800C997AE /* en */, ABEE0AFE2595C73D00C997AE /* zh-Hans */, AB994DBB25986F7A00E9A367 /* ja */, + ABE9376C265DCD9400EA8B30 /* zh-Hant */, ); name = Localizable.strings; sourceTree = ""; @@ -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; @@ -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; diff --git a/EhPanda/App/Extensions.swift b/EhPanda/App/Extensions.swift index d9bf0ca7..da7af94a 100644 --- a/EhPanda/App/Extensions.swift +++ b/EhPanda/App/Extensions.swift @@ -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() } @@ -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) } } diff --git a/EhPanda/App/Utility.swift b/EhPanda/App/Utility.swift index 0c3c8987..6b4d7440 100644 --- a/EhPanda/App/Utility.swift +++ b/EhPanda/App/Utility.swift @@ -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") diff --git a/EhPanda/App/ja.lproj/Localizable.strings b/EhPanda/App/ja.lproj/Localizable.strings index b8c60e77..3ec07089 100644 --- a/EhPanda/App/ja.lproj/Localizable.strings +++ b/EhPanda/App/ja.lproj/Localizable.strings @@ -98,7 +98,7 @@ "Finish" = "完了"; "Copy cookies" = "クッキーをコピー"; -"Apperance" = "外観"; +"Appearance" = "外観"; "Global" = "全般"; "Theme" = "テーマ"; "Tint Color" = "テーマの色"; diff --git a/EhPanda/App/zh-Hans.lproj/Localizable.strings b/EhPanda/App/zh-Hans.lproj/Localizable.strings index 05fbcabd..47fb4ee0 100644 --- a/EhPanda/App/zh-Hans.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hans.lproj/Localizable.strings @@ -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请稍后再试"; @@ -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" = "警告"; @@ -98,7 +98,7 @@ "Finish" = "完成"; "Copy cookies" = "复制Cookies"; -"Apperance" = "外观"; +"Appearance" = "外观"; "Global" = "全局"; "Theme" = "主题"; "Tint Color" = "主题色"; diff --git a/EhPanda/App/zh-Hant.lproj/Localizable.strings b/EhPanda/App/zh-Hant.lproj/Localizable.strings index 4938bfe4..3cd6a57d 100644 --- a/EhPanda/App/zh-Hant.lproj/Localizable.strings +++ b/EhPanda/App/zh-Hant.lproj/Localizable.strings @@ -98,7 +98,7 @@ "Finish" = "完成"; "Copy cookies" = "複製Cookies"; -"Apperance" = "外觀"; +"Appearance" = "外觀"; "Global" = "全局"; "Theme" = "主題"; "Tint Color" = "主題色"; diff --git a/EhPanda/View/Detail/ArchiveView.swift b/EhPanda/View/Detail/ArchiveView.swift index a9a052a4..369a0403 100644 --- a/EhPanda/View/Detail/ArchiveView.swift +++ b/EhPanda/View/Detail/ArchiveView.swift @@ -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) } @@ -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) diff --git a/EhPanda/View/Setting/AppearanceSettingView.swift b/EhPanda/View/Setting/AppearanceSettingView.swift index 9178108f..2fc59a04 100644 --- a/EhPanda/View/Setting/AppearanceSettingView.swift +++ b/EhPanda/View/Setting/AppearanceSettingView.swift @@ -82,7 +82,7 @@ struct AppearanceSettingView: View, StoreAccessor { } } } - .navigationBarTitle("Apperance") + .navigationBarTitle("Appearance") } } diff --git a/EhPanda/View/Setting/ReadingSettingView.swift b/EhPanda/View/Setting/ReadingSettingView.swift index 0bc89632..dc9d6176 100644 --- a/EhPanda/View/Setting/ReadingSettingView.swift +++ b/EhPanda/View/Setting/ReadingSettingView.swift @@ -37,7 +37,7 @@ struct ReadingSettingView: View, StoreAccessor { .pickerStyle(MenuPickerStyle()) } } - Section(header: Text("Apperance")) { + Section(header: Text("Appearance")) { HStack { Text("Separator height") Spacer() diff --git a/EhPanda/View/Setting/SettingView.swift b/EhPanda/View/Setting/SettingView.swift index f64b3727..34c7e1f4 100644 --- a/EhPanda/View/Setting/SettingView.swift +++ b/EhPanda/View/Setting/SettingView.swift @@ -32,7 +32,7 @@ struct SettingView: View, StoreAccessor { ) SettingRow( symbolName: "circle.righthalf.fill", - text: "Apperance", + text: "Appearance", destination: AppearanceSettingView() ) SettingRow(