From a00dae9b0a32286b68a9af517d1d637977fb69b1 Mon Sep 17 00:00:00 2001 From: Jinyu Meng Date: Sat, 20 Jan 2024 13:28:15 +0900 Subject: [PATCH 1/6] Create an extension for hiding strings from localizations. --- Xcodes.xcodeproj/project.pbxproj | 4 ++++ Xcodes/Frontend/Common/String+.swift | 16 ++++++++++++++++ .../Frontend/InfoPane/CornerRadiusModifier.swift | 2 +- .../Frontend/InfoPane/IdenticalBuildView.swift | 2 +- .../Preferences/AdvancedPreferencePane.swift | 2 +- .../Frontend/SignIn/SignInCredentialsView.swift | 2 +- .../Frontend/XcodeList/AppStoreButtonStyle.swift | 12 ++++++------ 7 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 Xcodes/Frontend/Common/String+.swift diff --git a/Xcodes.xcodeproj/project.pbxproj b/Xcodes.xcodeproj/project.pbxproj index 45239003..a190ae54 100644 --- a/Xcodes.xcodeproj/project.pbxproj +++ b/Xcodes.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ B0C6AD042AD6E65700E64698 /* ReleaseDateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD032AD6E65700E64698 /* ReleaseDateView.swift */; }; B0C6AD0B2AD9178E00E64698 /* IdenticalBuildView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD0A2AD9178E00E64698 /* IdenticalBuildView.swift */; }; B0C6AD0D2AD91D7900E64698 /* IconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD0C2AD91D7900E64698 /* IconView.swift */; }; + C02500722B5B7F7300E826A1 /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02500712B5B7F7300E826A1 /* String+.swift */; }; CA11E7BA2598476C00D2EE1C /* XcodeCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA11E7B92598476C00D2EE1C /* XcodeCommands.swift */; }; CA2518EC25A7FF2B00F08414 /* AppStateUpdateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA2518EB25A7FF2B00F08414 /* AppStateUpdateTests.swift */; }; CA25192A25A9644800F08414 /* XcodeInstallState.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA25192925A9644800F08414 /* XcodeInstallState.swift */; }; @@ -209,6 +210,7 @@ B0C6AD032AD6E65700E64698 /* ReleaseDateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReleaseDateView.swift; sourceTree = ""; }; B0C6AD0A2AD9178E00E64698 /* IdenticalBuildView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdenticalBuildView.swift; sourceTree = ""; }; B0C6AD0C2AD91D7900E64698 /* IconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconView.swift; sourceTree = ""; }; + C02500712B5B7F7300E826A1 /* String+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+.swift"; sourceTree = ""; }; CA11E7B92598476C00D2EE1C /* XcodeCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeCommands.swift; sourceTree = ""; }; CA2518EB25A7FF2B00F08414 /* AppStateUpdateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStateUpdateTests.swift; sourceTree = ""; }; CA25192925A9644800F08414 /* XcodeInstallState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeInstallState.swift; sourceTree = ""; }; @@ -380,6 +382,7 @@ 536CFDD3263C9A8000026CE0 /* XcodesSheet.swift */, 53CBAB2B263DCC9100410495 /* XcodesAlert.swift */, E84B7D0C2B296A8900DBDA2B /* NavigationSplitViewWrapper.swift */, + C02500712B5B7F7300E826A1 /* String+.swift */, ); path = Common; sourceTree = ""; @@ -886,6 +889,7 @@ CA9FF8662595130600E47BAF /* View+IsHidden.swift in Sources */, CAE4248C259A68B800B8B246 /* Optional+IsNotNil.swift in Sources */, B0C6AD0D2AD91D7900E64698 /* IconView.swift in Sources */, + C02500722B5B7F7300E826A1 /* String+.swift in Sources */, CA9FF9362595B44700E47BAF /* HelperClient.swift in Sources */, B0C6AD042AD6E65700E64698 /* ReleaseDateView.swift in Sources */, CAA8587C25A2B37900ACF8C0 /* IsTesting.swift in Sources */, diff --git a/Xcodes/Frontend/Common/String+.swift b/Xcodes/Frontend/Common/String+.swift new file mode 100644 index 00000000..cab5f894 --- /dev/null +++ b/Xcodes/Frontend/Common/String+.swift @@ -0,0 +1,16 @@ +// +// String+.swift +// Xcodes +// +// Created by Jinyu Meng on 2024/01/20. +// Copyright © 2024 Robots and Pencils. All rights reserved. +// + +import Foundation + +extension String { + // Declare String as String explicitly. Prevent it from being recognized as a LocalizedStringKey. + var hideInLocalizations: String { + return String(self) + } +} diff --git a/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift b/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift index 4d9d7e27..8b71b370 100644 --- a/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift +++ b/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift @@ -29,7 +29,7 @@ extension View { struct Previews_CornerRadius_Previews: PreviewProvider { static var previews: some View { HStack { - Text("XCODES RULES!") + Text("XCODES RULES!".hideInLocalizations) }.xcodesBackground() } } diff --git a/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift b/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift index 04ef3b82..78de8f60 100644 --- a/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift +++ b/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift @@ -29,7 +29,7 @@ struct IdenticalBuildsView: View { .font(.headline) ForEach(builds, id: \.description) { version in - Text("• \(version.appleDescription)") + Text("• \(version.appleDescription)".hideInLocalizations) .font(.subheadline) } } diff --git a/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift b/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift index 21d6b8cf..eef31b59 100644 --- a/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift +++ b/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift @@ -80,7 +80,7 @@ struct AdvancedPreferencePane: View { GroupBox(label: Text("Active/Select")) { VStack(alignment: .leading) { - Picker("OnSelect", selection: $appState.onSelectActionType) { + Picker("OnSelect".hideInLocalizations, selection: $appState.onSelectActionType) { Text(SelectedActionType.none.description) .tag(SelectedActionType.none) diff --git a/Xcodes/Frontend/SignIn/SignInCredentialsView.swift b/Xcodes/Frontend/SignIn/SignInCredentialsView.swift index 6d070657..8dabd39b 100644 --- a/Xcodes/Frontend/SignIn/SignInCredentialsView.swift +++ b/Xcodes/Frontend/SignIn/SignInCredentialsView.swift @@ -13,7 +13,7 @@ struct SignInCredentialsView: View { HStack { Text("AppleID") .frame(minWidth: 100, alignment: .trailing) - TextField("example@icloud.com", text: $username) + TextField("example@icloud.com".hideInLocalizations, text: $username) } HStack { Text("Password") diff --git a/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift b/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift index 3b7b7df3..74cd042a 100644 --- a/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift +++ b/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift @@ -97,33 +97,33 @@ struct AppStoreButtonStyle_Previews: PreviewProvider { Group { ForEach([ColorScheme.light, .dark], id: \.self) { colorScheme in Group { - Button("OPEN", action: {}) + Button("OPEN".hideInLocalizations, action: {}) .buttonStyle(AppStoreButtonStyle(primary: true, highlighted: false)) .padding() .background(Color(.textBackgroundColor)) .previewDisplayName("Primary") - Button("OPEN", action: {}) + Button("OPEN".hideInLocalizations, action: {}) .buttonStyle(AppStoreButtonStyle(primary: true, highlighted: true)) .padding() .background(Color(.controlAccentColor)) .previewDisplayName("Primary, Highlighted") - Button("OPEN", action: {}) + Button("OPEN".hideInLocalizations, action: {}) .buttonStyle(AppStoreButtonStyle(primary: true, highlighted: false)) .padding() .disabled(true) .background(Color(.textBackgroundColor)) .previewDisplayName("Primary, Disabled") - Button("INSTALL", action: {}) + Button("INSTALL".hideInLocalizations, action: {}) .buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false)) .padding() .background(Color(.textBackgroundColor)) .previewDisplayName("Secondary") - Button("INSTALL", action: {}) + Button("INSTALL".hideInLocalizations, action: {}) .buttonStyle(AppStoreButtonStyle(primary: false, highlighted: true)) .padding() .background(Color(.controlAccentColor)) .previewDisplayName("Secondary, Highlighted") - Button("INSTALL", action: {}) + Button("INSTALL".hideInLocalizations, action: {}) .buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false)) .padding() .disabled(true) From a078b8f7d0019063615ed89d3097364311924680 Mon Sep 17 00:00:00 2001 From: Jinyu Meng Date: Sat, 20 Jan 2024 13:29:04 +0900 Subject: [PATCH 2/6] Update zh_Hans localizations. Remove old or useless items. --- Xcodes/Resources/Localizable.xcstrings | 478 ++++--------------------- 1 file changed, 73 insertions(+), 405 deletions(-) diff --git a/Xcodes/Resources/Localizable.xcstrings b/Xcodes/Resources/Localizable.xcstrings index 74a637f2..a5df6f54 100644 --- a/Xcodes/Resources/Localizable.xcstrings +++ b/Xcodes/Resources/Localizable.xcstrings @@ -37,16 +37,6 @@ } } }, - "• %@" : { - "localizations" : { - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "• %@" - } - } - } - }, "AccessDenied" : { "localizations" : { "ca" : { @@ -1055,6 +1045,12 @@ "state" : "translated", "value" : "Xcode %@ sürümünü yüklemeyi durdurmak istediğine emin misin?" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "你确定要停止安装Xcode %@吗?" + } } } }, @@ -1186,6 +1182,12 @@ "state" : "translated", "value" : "Supprimer" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "删除" + } } } }, @@ -1203,6 +1205,12 @@ "state" : "translated", "value" : "Êtes-vous sûr de vouloir supprimer %@ ?" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "你确定要删除%@吗?" + } } } }, @@ -1762,7 +1770,7 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "无法执行安装前置步骤" + "value" : "无法执行安装后准备步骤" } }, "zh-Hant" : { @@ -1987,7 +1995,7 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "Xcodes使用一个独立的提权帮助程序来以root身份执行任务。就是那些需要在命令行中用sudo执行的命令。包括安装前置步骤以及用xcode-select切换Xcode版本。\n\n您需要提供当前用户的密码来安装它。" + "value" : "Xcodes使用一个独立的提权帮助程序来以root身份执行任务。就是那些需要在命令行中用sudo执行的命令。包括安装后准备步骤以及用xcode-select切换Xcode版本。\n\n您需要提供当前用户的密码来安装它。" } }, "zh-Hant" : { @@ -6570,15 +6578,11 @@ "state" : "translated", "value" : "Erreur" } - } - } - }, - "example@icloud.com" : { - "localizations" : { - "tr" : { + }, + "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "ornek@icloud.com" + "value" : "错误" } } } @@ -7927,6 +7931,12 @@ "state" : "translated", "value" : "Gizli" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "隐藏" + } } } }, @@ -8606,22 +8616,6 @@ } } }, - "INSTALL" : { - "localizations" : { - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "INSTALLER" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "YÜKLE" - } - } - } - }, "InstallationError.CodesignVerifyFailed" : { "extractionState" : "manual", "localizations" : { @@ -9855,7 +9849,7 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "安装已完成,但一些前置步骤没有被自动执行。它们将会在您第一次运行Xcode %@时执行。" + "value" : "安装已完成,但一些安装后准备步骤没有被自动执行。它们将会在您第一次运行Xcode %@时执行。" } }, "zh-Hant" : { @@ -9968,7 +9962,7 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "安装已完成,但一些前置步骤没有被自动执行。Xcodes使用一个提权帮助程序来执行这些步骤,但帮助程序似乎没有被安装。您可以从 偏好设置 > 高级 中安装。\n\n这些步骤将会在您第一次运行Xcode %@时执行。" + "value" : "安装已完成,但一些安装后准备步骤没有被自动执行。Xcodes使用一个提权帮助程序来执行这些步骤,但帮助程序似乎没有被安装。您可以从 偏好设置 > 高级 中安装。\n\n这些步骤将会在您第一次运行Xcode %@时执行。" } }, "zh-Hant" : { @@ -13034,6 +13028,12 @@ "state" : "translated", "value" : "Gizli Değil" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "未隐藏" + } } } }, @@ -14034,16 +14034,6 @@ } } }, - "OnSelect" : { - "localizations" : { - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "OnSelect" - } - } - } - }, "OnSelectDoNothing" : { "extractionState" : "manual", "localizations" : { @@ -14434,34 +14424,24 @@ } } }, - "OPEN" : { + "Open In Rosetta" : { "localizations" : { "fr" : { "stringUnit" : { "state" : "translated", - "value" : "OUVRIR" + "value" : "Ouvrir avec Rosetta" } }, "tr" : { "stringUnit" : { "state" : "translated", - "value" : "AÇ" - } - } - } - }, - "Open In Rosetta" : { - "localizations" : { - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Ouvrir avec Rosetta" + "value" : "Rosetta ile Aç" } }, - "tr" : { + "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "Rosetta ile Aç" + "value" : "在Rosetta中打开" } } } @@ -14703,6 +14683,12 @@ "state" : "translated", "value" : "Yükleme sonrası adımları uygula" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "执行安装后准备步骤" + } } } }, @@ -14713,6 +14699,12 @@ "state" : "translated", "value" : "Platformlar" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "平台" + } } } }, @@ -14730,6 +14722,12 @@ "state" : "translated", "value" : "Ci-dessous une liste des plateformes installées sur cette machine." } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "下面是在这台设备上已经安装的平台列表。" + } } } }, @@ -15164,7 +15162,7 @@ "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "Xcodes使用一个独立的提权帮助程序来以root身份执行任务。就是那些需要在命令行中用sudo执行的命令。包括一些安装前置步骤以及用xcode-select切换Xcode版本。\n\n您需要提供当前用户的密码来安装它。" + "value" : "Xcodes使用一个独立的提权帮助程序来以root身份执行任务。就是那些需要在命令行中用sudo执行的命令。包括一些安装后准备步骤以及用xcode-select切换Xcode版本。\n\n您需要提供当前用户的密码来安装它。" } }, "zh-Hant" : { @@ -15618,119 +15616,6 @@ } } }, - "ReleaseNotes" : { - "extractionState" : "stale", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Notes de la versió" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Release-Notes" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Release Notes" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Notas del lanzamiento" - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "Julkaisutiedot" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Notes de Mise à Jour" - } - }, - "hi" : { - "stringUnit" : { - "state" : "translated", - "value" : "रिलीज नोट्स" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Note di Rilascio" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "リリースノート" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "릴리즈 노트" - } - }, - "nl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Release Notes" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Notatki wydania" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Notas de lançamento" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Примечания к выпуску" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Yayınlanma Notları" - } - }, - "uk" : { - "stringUnit" : { - "state" : "translated", - "value" : "Деталі релізу" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "更新说明" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "版本附註" - } - } - } - }, "ReleaseNotes.help" : { "localizations" : { "ca" : { @@ -16279,232 +16164,6 @@ } } }, - "Search" : { - "extractionState" : "stale", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Cercar..." - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Suchen ..." - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Search..." - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Buscar..." - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "Etsi..." - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Rechercher..." - } - }, - "hi" : { - "stringUnit" : { - "state" : "translated", - "value" : "खोज..." - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Cerca..." - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "検索…" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "검색하기..." - } - }, - "nl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Zoeken..." - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Szukaj..." - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Procurar..." - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Поиск..." - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Ara..." - } - }, - "uk" : { - "stringUnit" : { - "state" : "translated", - "value" : "Пошук..." - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "搜索…" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "搜尋⋯" - } - } - } - }, - "SearchDescription" : { - "extractionState" : "stale", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Llistat de cerca" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Suchliste" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Search list" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Lista de búsqueda" - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "Hakulista" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Liste de recherche" - } - }, - "hi" : { - "stringUnit" : { - "state" : "translated", - "value" : "खोज सूची" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Lista Ricerca" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "一覧の検索" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "목록 검색하기" - } - }, - "nl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Zoek lijst" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Przeszukaj listę" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Lista de procura" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Поиск по списку" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Arama listesi" - } - }, - "uk" : { - "stringUnit" : { - "state" : "translated", - "value" : "Список знайденого" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "搜索列表" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "搜尋列表" - } - } - } - }, "Select" : { "localizations" : { "ca" : { @@ -18606,6 +18265,12 @@ "state" : "translated", "value" : "Xcode" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } } } }, @@ -18616,11 +18281,14 @@ "state" : "translated", "value" : "Xcodes" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } } } - }, - "XCODES RULES!" : { - } }, "version" : "1.0" From 0e76a181689f0e8d2859368e6dacfd399eea901d Mon Sep 17 00:00:00 2001 From: Jinyu Meng Date: Sat, 20 Jan 2024 13:35:57 +0900 Subject: [PATCH 3/6] Remove more useless localizations. --- Xcodes/Frontend/View+IsHidden.swift | 4 +-- Xcodes/Resources/Localizable.xcstrings | 44 -------------------------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/Xcodes/Frontend/View+IsHidden.swift b/Xcodes/Frontend/View+IsHidden.swift index 4da6da01..20f66c94 100644 --- a/Xcodes/Frontend/View+IsHidden.swift +++ b/Xcodes/Frontend/View+IsHidden.swift @@ -14,10 +14,10 @@ extension View { struct View_IsHidden_Previews: PreviewProvider { static var previews: some View { Group { - Text("Not Hidden") + Text("Not Hidden".hideInLocalizations) .isHidden(false) - Text("Hidden") + Text("Hidden".hideInLocalizations) .isHidden(true) } } diff --git a/Xcodes/Resources/Localizable.xcstrings b/Xcodes/Resources/Localizable.xcstrings index a5df6f54..cacb3595 100644 --- a/Xcodes/Resources/Localizable.xcstrings +++ b/Xcodes/Resources/Localizable.xcstrings @@ -7918,28 +7918,6 @@ } } }, - "Hidden" : { - "localizations" : { - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Masqué" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Gizli" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "隐藏" - } - } - } - }, "IdenticalBuilds" : { "comment" : "Info Pane", "localizations" : { @@ -13015,28 +12993,6 @@ } } }, - "Not Hidden" : { - "localizations" : { - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Visible" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Gizli Değil" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "未隐藏" - } - } - } - }, "Notification.FinishedInstalling" : { "extractionState" : "manual", "localizations" : { From 144c591a41e3fac43864d13491c83cc27e019159 Mon Sep 17 00:00:00 2001 From: Jinyu Meng Date: Thu, 8 Feb 2024 12:27:29 +0900 Subject: [PATCH 4/6] Use Text(verbatim:) instead. --- Xcodes.xcodeproj/project.pbxproj | 4 ---- Xcodes/Frontend/Common/String+.swift | 16 ---------------- .../Frontend/InfoPane/CornerRadiusModifier.swift | 2 +- .../Frontend/InfoPane/IdenticalBuildView.swift | 2 +- .../Preferences/AdvancedPreferencePane.swift | 4 +++- .../Frontend/SignIn/SignInCredentialsView.swift | 4 +++- Xcodes/Frontend/View+IsHidden.swift | 4 ++-- Xcodes/Resources/Localizable.xcstrings | 6 ++++++ 8 files changed, 16 insertions(+), 26 deletions(-) delete mode 100644 Xcodes/Frontend/Common/String+.swift diff --git a/Xcodes.xcodeproj/project.pbxproj b/Xcodes.xcodeproj/project.pbxproj index a190ae54..45239003 100644 --- a/Xcodes.xcodeproj/project.pbxproj +++ b/Xcodes.xcodeproj/project.pbxproj @@ -25,7 +25,6 @@ B0C6AD042AD6E65700E64698 /* ReleaseDateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD032AD6E65700E64698 /* ReleaseDateView.swift */; }; B0C6AD0B2AD9178E00E64698 /* IdenticalBuildView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD0A2AD9178E00E64698 /* IdenticalBuildView.swift */; }; B0C6AD0D2AD91D7900E64698 /* IconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C6AD0C2AD91D7900E64698 /* IconView.swift */; }; - C02500722B5B7F7300E826A1 /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02500712B5B7F7300E826A1 /* String+.swift */; }; CA11E7BA2598476C00D2EE1C /* XcodeCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA11E7B92598476C00D2EE1C /* XcodeCommands.swift */; }; CA2518EC25A7FF2B00F08414 /* AppStateUpdateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA2518EB25A7FF2B00F08414 /* AppStateUpdateTests.swift */; }; CA25192A25A9644800F08414 /* XcodeInstallState.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA25192925A9644800F08414 /* XcodeInstallState.swift */; }; @@ -210,7 +209,6 @@ B0C6AD032AD6E65700E64698 /* ReleaseDateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReleaseDateView.swift; sourceTree = ""; }; B0C6AD0A2AD9178E00E64698 /* IdenticalBuildView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdenticalBuildView.swift; sourceTree = ""; }; B0C6AD0C2AD91D7900E64698 /* IconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconView.swift; sourceTree = ""; }; - C02500712B5B7F7300E826A1 /* String+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+.swift"; sourceTree = ""; }; CA11E7B92598476C00D2EE1C /* XcodeCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeCommands.swift; sourceTree = ""; }; CA2518EB25A7FF2B00F08414 /* AppStateUpdateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStateUpdateTests.swift; sourceTree = ""; }; CA25192925A9644800F08414 /* XcodeInstallState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeInstallState.swift; sourceTree = ""; }; @@ -382,7 +380,6 @@ 536CFDD3263C9A8000026CE0 /* XcodesSheet.swift */, 53CBAB2B263DCC9100410495 /* XcodesAlert.swift */, E84B7D0C2B296A8900DBDA2B /* NavigationSplitViewWrapper.swift */, - C02500712B5B7F7300E826A1 /* String+.swift */, ); path = Common; sourceTree = ""; @@ -889,7 +886,6 @@ CA9FF8662595130600E47BAF /* View+IsHidden.swift in Sources */, CAE4248C259A68B800B8B246 /* Optional+IsNotNil.swift in Sources */, B0C6AD0D2AD91D7900E64698 /* IconView.swift in Sources */, - C02500722B5B7F7300E826A1 /* String+.swift in Sources */, CA9FF9362595B44700E47BAF /* HelperClient.swift in Sources */, B0C6AD042AD6E65700E64698 /* ReleaseDateView.swift in Sources */, CAA8587C25A2B37900ACF8C0 /* IsTesting.swift in Sources */, diff --git a/Xcodes/Frontend/Common/String+.swift b/Xcodes/Frontend/Common/String+.swift deleted file mode 100644 index cab5f894..00000000 --- a/Xcodes/Frontend/Common/String+.swift +++ /dev/null @@ -1,16 +0,0 @@ -// -// String+.swift -// Xcodes -// -// Created by Jinyu Meng on 2024/01/20. -// Copyright © 2024 Robots and Pencils. All rights reserved. -// - -import Foundation - -extension String { - // Declare String as String explicitly. Prevent it from being recognized as a LocalizedStringKey. - var hideInLocalizations: String { - return String(self) - } -} diff --git a/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift b/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift index 8b71b370..2d7332f0 100644 --- a/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift +++ b/Xcodes/Frontend/InfoPane/CornerRadiusModifier.swift @@ -29,7 +29,7 @@ extension View { struct Previews_CornerRadius_Previews: PreviewProvider { static var previews: some View { HStack { - Text("XCODES RULES!".hideInLocalizations) + Text(verbatim: "XCODES RULES!") }.xcodesBackground() } } diff --git a/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift b/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift index 78de8f60..7d2d11a7 100644 --- a/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift +++ b/Xcodes/Frontend/InfoPane/IdenticalBuildView.swift @@ -29,7 +29,7 @@ struct IdenticalBuildsView: View { .font(.headline) ForEach(builds, id: \.description) { version in - Text("• \(version.appleDescription)".hideInLocalizations) + Text(verbatim: "• \(version.appleDescription)") .font(.subheadline) } } diff --git a/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift b/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift index eef31b59..2d01e1a4 100644 --- a/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift +++ b/Xcodes/Frontend/Preferences/AdvancedPreferencePane.swift @@ -80,12 +80,14 @@ struct AdvancedPreferencePane: View { GroupBox(label: Text("Active/Select")) { VStack(alignment: .leading) { - Picker("OnSelect".hideInLocalizations, selection: $appState.onSelectActionType) { + Picker(selection: $appState.onSelectActionType) { Text(SelectedActionType.none.description) .tag(SelectedActionType.none) Text(SelectedActionType.rename.description) .tag(SelectedActionType.rename) + } label: { + Text(verbatim: "OnSelect") } .labelsHidden() .pickerStyle(.inline) diff --git a/Xcodes/Frontend/SignIn/SignInCredentialsView.swift b/Xcodes/Frontend/SignIn/SignInCredentialsView.swift index 8dabd39b..0aecd285 100644 --- a/Xcodes/Frontend/SignIn/SignInCredentialsView.swift +++ b/Xcodes/Frontend/SignIn/SignInCredentialsView.swift @@ -13,7 +13,9 @@ struct SignInCredentialsView: View { HStack { Text("AppleID") .frame(minWidth: 100, alignment: .trailing) - TextField("example@icloud.com".hideInLocalizations, text: $username) + TextField(text: $username) { + Text(verbatim: "example@icloud.com") + } } HStack { Text("Password") diff --git a/Xcodes/Frontend/View+IsHidden.swift b/Xcodes/Frontend/View+IsHidden.swift index 20f66c94..887605f2 100644 --- a/Xcodes/Frontend/View+IsHidden.swift +++ b/Xcodes/Frontend/View+IsHidden.swift @@ -14,10 +14,10 @@ extension View { struct View_IsHidden_Previews: PreviewProvider { static var previews: some View { Group { - Text("Not Hidden".hideInLocalizations) + Text(verbatim: "Not Hidden") .isHidden(false) - Text("Hidden".hideInLocalizations) + Text(verbatim: "Hidden") .isHidden(true) } } diff --git a/Xcodes/Resources/Localizable.xcstrings b/Xcodes/Resources/Localizable.xcstrings index cacb3595..b8a1b0c3 100644 --- a/Xcodes/Resources/Localizable.xcstrings +++ b/Xcodes/Resources/Localizable.xcstrings @@ -3073,6 +3073,12 @@ "state" : "translated", "value" : "Apple Silikon" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } } } }, From 8a7597e70bf08becd544c8c66d97fd93bead25f6 Mon Sep 17 00:00:00 2001 From: Jinyu Meng Date: Thu, 8 Feb 2024 12:32:36 +0900 Subject: [PATCH 5/6] Update more files. --- .../XcodeList/AppStoreButtonStyle.swift | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift b/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift index 74cd042a..4bad83d6 100644 --- a/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift +++ b/Xcodes/Frontend/XcodeList/AppStoreButtonStyle.swift @@ -97,33 +97,45 @@ struct AppStoreButtonStyle_Previews: PreviewProvider { Group { ForEach([ColorScheme.light, .dark], id: \.self) { colorScheme in Group { - Button("OPEN".hideInLocalizations, action: {}) + Button{ } label: { + Text(verbatim: "OPEN") + } .buttonStyle(AppStoreButtonStyle(primary: true, highlighted: false)) .padding() .background(Color(.textBackgroundColor)) .previewDisplayName("Primary") - Button("OPEN".hideInLocalizations, action: {}) + Button{ } label: { + Text(verbatim: "OPEN") + } .buttonStyle(AppStoreButtonStyle(primary: true, highlighted: true)) .padding() .background(Color(.controlAccentColor)) .previewDisplayName("Primary, Highlighted") - Button("OPEN".hideInLocalizations, action: {}) + Button{ } label: { + Text(verbatim: "OPEN") + } .buttonStyle(AppStoreButtonStyle(primary: true, highlighted: false)) .padding() .disabled(true) .background(Color(.textBackgroundColor)) .previewDisplayName("Primary, Disabled") - Button("INSTALL".hideInLocalizations, action: {}) + Button{ } label: { + Text(verbatim: "INSTALL") + } .buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false)) .padding() .background(Color(.textBackgroundColor)) .previewDisplayName("Secondary") - Button("INSTALL".hideInLocalizations, action: {}) + Button{ } label: { + Text(verbatim: "INSTALL") + } .buttonStyle(AppStoreButtonStyle(primary: false, highlighted: true)) .padding() .background(Color(.controlAccentColor)) .previewDisplayName("Secondary, Highlighted") - Button("INSTALL".hideInLocalizations, action: {}) + Button{ } label: { + Text(verbatim: "INSTALL") + } .buttonStyle(AppStoreButtonStyle(primary: false, highlighted: false)) .padding() .disabled(true) From 49eb2f4cf2e0a7c7d16382a1dddee43105873b92 Mon Sep 17 00:00:00 2001 From: Jinyu Meng Date: Sat, 10 Feb 2024 15:38:48 +0900 Subject: [PATCH 6/6] Update localizations to remove old items and add "Support Xcodes". --- Xcodes/Resources/Localizable.xcstrings | 250 +++---------------------- 1 file changed, 24 insertions(+), 226 deletions(-) diff --git a/Xcodes/Resources/Localizable.xcstrings b/Xcodes/Resources/Localizable.xcstrings index b8a1b0c3..07a3ec7f 100644 --- a/Xcodes/Resources/Localizable.xcstrings +++ b/Xcodes/Resources/Localizable.xcstrings @@ -8,6 +8,12 @@ "state" : "translated", "value" : "" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } } } }, @@ -18,6 +24,12 @@ "state" : "translated", "value" : "%@" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } } } }, @@ -34,6 +46,12 @@ "state" : "translated", "value" : "%1$@ %2$@ %3$@" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "" + } } } }, @@ -8261,232 +8279,6 @@ } } }, - "Info" : { - "extractionState" : "stale", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Informació" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info" - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "Tietoja" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Informations" - } - }, - "hi" : { - "stringUnit" : { - "state" : "translated", - "value" : "जानकारी" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "情報" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "정보" - } - }, - "nl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Informacje" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Informação" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Информация" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Bilgi" - } - }, - "uk" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "信息" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "資訊" - } - } - } - }, - "InfoDescription" : { - "extractionState" : "stale", - "localizations" : { - "ca" : { - "stringUnit" : { - "state" : "translated", - "value" : "Mostrar o ocultar el panell d'informació" - } - }, - "de" : { - "stringUnit" : { - "state" : "translated", - "value" : "Info-Panel anzeigen oder verbergen" - } - }, - "en" : { - "stringUnit" : { - "state" : "translated", - "value" : "Show or hide the info pane" - } - }, - "es" : { - "stringUnit" : { - "state" : "translated", - "value" : "Mostrar u ocultar el panel de información" - } - }, - "fi" : { - "stringUnit" : { - "state" : "translated", - "value" : "Näytä tai piilota tietoruutu" - } - }, - "fr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Afficher ou masquer le volet d'informations" - } - }, - "hi" : { - "stringUnit" : { - "state" : "translated", - "value" : "जानकारी फलक दिखाएँ या छिपाएँ" - } - }, - "it" : { - "stringUnit" : { - "state" : "translated", - "value" : "Mostra o nascondi pannello informazioni" - } - }, - "ja" : { - "stringUnit" : { - "state" : "translated", - "value" : "情報パネルの切り替え" - } - }, - "ko" : { - "stringUnit" : { - "state" : "translated", - "value" : "정보창 표시 또는 숨기기" - } - }, - "nl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Show or hide the info pane" - } - }, - "pl" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pokaż lub ukryj okno informacji" - } - }, - "pt-BR" : { - "stringUnit" : { - "state" : "translated", - "value" : "Mostrar ou esconder o painel de informações" - } - }, - "ru" : { - "stringUnit" : { - "state" : "translated", - "value" : "Показать или скрыть информационную панель" - } - }, - "tr" : { - "stringUnit" : { - "state" : "translated", - "value" : "Bilgi panelini göster ya da gizle" - } - }, - "uk" : { - "stringUnit" : { - "state" : "translated", - "value" : "Показати або сховати панель інформації" - } - }, - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "显示或隐藏信息面板" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "顯示或隱藏資訊面板" - } - } - } - }, "Install" : { "comment" : "Common", "localizations" : { @@ -17112,6 +16904,12 @@ "state" : "translated", "value" : "Support Xcodes" } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "支持Xcodes" + } } } },