diff --git a/Example/Preferences.xcodeproj/project.pbxproj b/Example/Preferences.xcodeproj/project.pbxproj index fb7e6fe..080cdcf 100644 --- a/Example/Preferences.xcodeproj/project.pbxproj +++ b/Example/Preferences.xcodeproj/project.pbxproj @@ -7,9 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 1C83C8FE28A5768500D38612 /* Preferences in Frameworks */ = {isa = PBXBuildFile; productRef = 1C83C8FD28A5768500D38612 /* Preferences */; }; 502B68E72254947B00789D9F /* PreferencesStyle+UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 502B68E52254944600789D9F /* PreferencesStyle+UserDefaults.swift */; }; E3194E4122573FF3006FE775 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3194E4022573FF3006FE775 /* Utilities.swift */; }; - E340668C28ADAFF3002F8EA9 /* Preferences in Frameworks */ = {isa = PBXBuildFile; productRef = E340668B28ADAFF3002F8EA9 /* Preferences */; }; E34E9EEA20E6149B002F8F86 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34E9EE920E6149B002F8F86 /* AppDelegate.swift */; }; E34E9EEC20E6149D002F8F86 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E34E9EEB20E6149D002F8F86 /* Assets.xcassets */; }; E34E9EEF20E6149D002F8F86 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E34E9EED20E6149D002F8F86 /* MainMenu.xib */; }; @@ -20,23 +20,10 @@ E7059F1323C2AC7400F84762 /* AccountsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7059F1123C2AC3700F84762 /* AccountsScreen.swift */; }; /* End PBXBuildFile section */ -/* Begin PBXCopyFilesBuildPhase section */ - E34E9EF920E61508002F8F86 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ + 1C000DB328AE7A3100F2844C /* Preferences */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Preferences; path = ..; sourceTree = ""; }; 502B68E52254944600789D9F /* PreferencesStyle+UserDefaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "PreferencesStyle+UserDefaults.swift"; sourceTree = ""; usesTabs = 1; }; E3194E4022573FF3006FE775 /* Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = Utilities.swift; sourceTree = ""; usesTabs = 1; }; - E340668928ADAFD5002F8EA9 /* Preferences */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Preferences; path = ..; sourceTree = ""; }; E34E9EE720E6149B002F8F86 /* PreferencesExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PreferencesExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; E34E9EE920E6149B002F8F86 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = AppDelegate.swift; sourceTree = ""; usesTabs = 1; }; E34E9EEB20E6149D002F8F86 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -54,17 +41,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E340668C28ADAFF3002F8EA9 /* Preferences in Frameworks */, + 1C83C8FE28A5768500D38612 /* Preferences in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - E340668A28ADAFF3002F8EA9 /* Frameworks */ = { + 1C83C8FA28A5763E00D38612 /* Packages */ = { + isa = PBXGroup; + children = ( + 1C000DB328AE7A3100F2844C /* Preferences */, + ); + name = Packages; + sourceTree = ""; + }; + 1C83C8FC28A5768500D38612 /* Frameworks */ = { isa = PBXGroup; children = ( - E340668928ADAFD5002F8EA9 /* Preferences */, ); name = Frameworks; sourceTree = ""; @@ -98,9 +92,10 @@ OBJ_5 = { isa = PBXGroup; children = ( + 1C83C8FA28A5763E00D38612 /* Packages */, E34E9EE820E6149B002F8F86 /* Example */, - E340668A28ADAFF3002F8EA9 /* Frameworks */, OBJ_12 /* Products */, + 1C83C8FC28A5768500D38612 /* Frameworks */, ); sourceTree = ""; }; @@ -114,7 +109,6 @@ E34E9EE320E6149B002F8F86 /* Sources */, E34E9EE420E6149B002F8F86 /* Frameworks */, E34E9EE520E6149B002F8F86 /* Resources */, - E34E9EF920E61508002F8F86 /* Embed Frameworks */, ); buildRules = ( ); @@ -122,7 +116,7 @@ ); name = PreferencesExample; packageProductDependencies = ( - E340668B28ADAFF3002F8EA9 /* Preferences */, + 1C83C8FD28A5768500D38612 /* Preferences */, ); productName = PreferencesExample; productReference = E34E9EE720E6149B002F8F86 /* PreferencesExample.app */; @@ -406,7 +400,7 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - E340668B28ADAFF3002F8EA9 /* Preferences */ = { + 1C83C8FD28A5768500D38612 /* Preferences */ = { isa = XCSwiftPackageProductDependency; productName = Preferences; }; diff --git a/Package.swift b/Package.swift index 30372c7..cc42c34 100644 --- a/Package.swift +++ b/Package.swift @@ -3,6 +3,7 @@ import PackageDescription let package = Package( name: "Preferences", + defaultLocalization: "fr", platforms: [ .macOS(.v10_13) ], @@ -16,7 +17,8 @@ let package = Package( ], targets: [ .target( - name: "Preferences" + name: "Preferences", + resources: [.process("Resources")] ) ] ) diff --git a/Sources/Preferences/Localization.swift b/Sources/Preferences/Localization.swift deleted file mode 100644 index 62188dd..0000000 --- a/Sources/Preferences/Localization.swift +++ /dev/null @@ -1,135 +0,0 @@ -import Foundation - -struct Localization { - enum Identifier { - case preferences - case settings - } - - private static let localizedStrings: [Identifier: [String: String]] = [ - .preferences: [ - "ar": "تفضيلات", - "ca": "Preferències", - "cs": "Předvolby", - "da": "Indstillinger", - "de": "Einstellungen", - "el": "Προτιμήσεις", - "en": "Preferences", - "en-AU": "Preferences", - "en-GB": "Preferences", - "es": "Preferencias", - "es-419": "Preferencias", - "fi": "Asetukset", - "fr": "Préférences", - "fr-CA": "Préférences", - "he": "העדפות", - "hi": "प्राथमिकता", - "hr": "Postavke", - "hu": "Beállítások", - "id": "Preferensi", - "it": "Preferenze", - "ja": "環境設定", - "ko": "환경설정", - "ms": "Keutamaan", - "nl": "Voorkeuren", - "no": "Valg", - "pl": "Preferencje", - "pt": "Preferências", - "pt-PT": "Preferências", - "ro": "Preferințe", - "ru": "Настройки", - "sk": "Nastavenia", - "sv": "Inställningar", - "th": "การตั้งค่า", - "tr": "Tercihler", - "uk": "Параметри", - "vi": "Tùy chọn", - "zh-CN": "偏好设置", - "zh-HK": "偏好設定", - "zh-TW": "偏好設定" - ], - .settings: [ - "ar": "الإعدادات", - "ca": "Configuració", - "cs": "Nastavení", - "da": "Indstillinger", - "de": "Einstellungen", - "el": "Ρυθμίσεις", - "en": "Settings", - "en-AU": "Settings", - "en-GB": "Settings", - "es": "Ajustes", - "es-419": "Ajustes", - "fi": "Asetukset", - "fr": "Réglages", - "fr-CA": "Réglages", - "he": "הגדרות", - "hi": "समायोजन", - "hr": "Postavke", - "hu": "Beállítások", - "id": "Pengaturan", - "it": "Impostazioni", - "ja": "設定", - "ko": "설정", - "ms": "Tetapan", - "nl": "Instellingen", - "no": "Innstillinger", - "pl": "Ustawienia", - "pt": "Ajustes", - "pt-PT": "Definições", - "ro": "Configurări", - "ru": "Настройки", - "sk": "Nastavenia", - "sv": "Inställningar", - "th": "ค่าติดตั้ง", - "tr": "Ayarlar", - "uk": "Параметри", - "vi": "Cài đặt", - "zh-CN": "设置", - "zh-HK": "設定", - "zh-TW": "設定" - ] - ] - - /** - Returns the localized version of the given string. - - - Parameter identifier: Identifier of the string to localize. - - - Note: If the system's locale can't be determined, the English localization of the string will be returned. - */ - static subscript(identifier: Identifier) -> String { - // Force-unwrapped since all of the involved code is under our control. - let localizedDict = Localization.localizedStrings[identifier]! - let defaultLocalizedString = localizedDict["en"]! - - // Iterate through all user-preferred languages until we find one that has a valid language code. - let preferredLocale = Locale.preferredLanguages - // TODO: Use `.firstNonNil()` here when available. - .lazy - .map { Locale(identifier: $0) } - .first { $0.languageCode != nil } - ?? .current - - guard let languageCode = preferredLocale.languageCode else { - return defaultLocalizedString - } - - // Chinese is the only language where different region codes result in different translations. - if languageCode == "zh" { - let regionCode = preferredLocale.regionCode ?? "" - if regionCode == "HK" || regionCode == "TW" { - return localizedDict["\(languageCode)-\(regionCode)"]! - } else { - // Fall back to "regular" zh-CN if neither the HK or TW region codes are found. - return localizedDict["\(languageCode)-CN"]! - } - } else { - if let localizedString = localizedDict[languageCode] { - return localizedString - } - } - - return defaultLocalizedString - } -} diff --git a/Sources/Preferences/Resources/ar.lproj/Localizable.strings b/Sources/Preferences/Resources/ar.lproj/Localizable.strings new file mode 100644 index 0000000..6f881d2 --- /dev/null +++ b/Sources/Preferences/Resources/ar.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "تفضيلات"; +"settings" = "الإعدادات"; diff --git a/Sources/Preferences/Resources/ca.lproj/Localizable.strings b/Sources/Preferences/Resources/ca.lproj/Localizable.strings new file mode 100644 index 0000000..6051b8e --- /dev/null +++ b/Sources/Preferences/Resources/ca.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferències"; +"settings" = "Configuració"; diff --git a/Sources/Preferences/Resources/cs.lproj/Localizable.strings b/Sources/Preferences/Resources/cs.lproj/Localizable.strings new file mode 100644 index 0000000..a7403c9 --- /dev/null +++ b/Sources/Preferences/Resources/cs.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Předvolby"; +"settings" = "Nastavení"; diff --git a/Sources/Preferences/Resources/da.lproj/Localizable.strings b/Sources/Preferences/Resources/da.lproj/Localizable.strings new file mode 100644 index 0000000..2b9d838 --- /dev/null +++ b/Sources/Preferences/Resources/da.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Indstillinger"; +"settings" = "Indstillinger"; diff --git a/Sources/Preferences/Resources/de.lproj/Localizable.strings b/Sources/Preferences/Resources/de.lproj/Localizable.strings new file mode 100644 index 0000000..f4deac1 --- /dev/null +++ b/Sources/Preferences/Resources/de.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Einstellungen"; +"settings" = "Einstellungen"; diff --git a/Sources/Preferences/Resources/el.lproj/Localizable.strings b/Sources/Preferences/Resources/el.lproj/Localizable.strings new file mode 100644 index 0000000..e44ce0e --- /dev/null +++ b/Sources/Preferences/Resources/el.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Προτιμήσεις"; +"settings" = "Ρυθμίσεις"; diff --git a/Sources/Preferences/Resources/en-AU.lproj/Localizable.strings b/Sources/Preferences/Resources/en-AU.lproj/Localizable.strings new file mode 100644 index 0000000..6ccc96b --- /dev/null +++ b/Sources/Preferences/Resources/en-AU.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferences"; +"settings" = "Settings"; diff --git a/Sources/Preferences/Resources/en-GB.lproj/Localizable.strings b/Sources/Preferences/Resources/en-GB.lproj/Localizable.strings new file mode 100644 index 0000000..6ccc96b --- /dev/null +++ b/Sources/Preferences/Resources/en-GB.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferences"; +"settings" = "Settings"; diff --git a/Sources/Preferences/Resources/en.lproj/Localizable.strings b/Sources/Preferences/Resources/en.lproj/Localizable.strings new file mode 100644 index 0000000..6ccc96b --- /dev/null +++ b/Sources/Preferences/Resources/en.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferences"; +"settings" = "Settings"; diff --git a/Sources/Preferences/Resources/es-419.lproj/Localizable.strings b/Sources/Preferences/Resources/es-419.lproj/Localizable.strings new file mode 100644 index 0000000..0f0e312 --- /dev/null +++ b/Sources/Preferences/Resources/es-419.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferencias"; +"settings" = "Ajustes"; diff --git a/Sources/Preferences/Resources/es.lproj/Localizable.strings b/Sources/Preferences/Resources/es.lproj/Localizable.strings new file mode 100644 index 0000000..0f0e312 --- /dev/null +++ b/Sources/Preferences/Resources/es.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferencias"; +"settings" = "Ajustes"; diff --git a/Sources/Preferences/Resources/fi.lproj/Localizable.strings b/Sources/Preferences/Resources/fi.lproj/Localizable.strings new file mode 100644 index 0000000..1d3b2f9 --- /dev/null +++ b/Sources/Preferences/Resources/fi.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Asetukset"; +"settings" = "Asetukset"; diff --git a/Sources/Preferences/Resources/fr-CA.lproj/Localizable.strings b/Sources/Preferences/Resources/fr-CA.lproj/Localizable.strings new file mode 100644 index 0000000..4033496 --- /dev/null +++ b/Sources/Preferences/Resources/fr-CA.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Préférences"; +"settings" = "Réglages"; diff --git a/Sources/Preferences/Resources/fr.lproj/Localizable.strings b/Sources/Preferences/Resources/fr.lproj/Localizable.strings new file mode 100644 index 0000000..4033496 --- /dev/null +++ b/Sources/Preferences/Resources/fr.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Préférences"; +"settings" = "Réglages"; diff --git a/Sources/Preferences/Resources/he.lproj/Localizable.strings b/Sources/Preferences/Resources/he.lproj/Localizable.strings new file mode 100644 index 0000000..f84b70b --- /dev/null +++ b/Sources/Preferences/Resources/he.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "העדפות"; +"settings" = "הגדרות"; diff --git a/Sources/Preferences/Resources/hi.lproj/Localizable.strings b/Sources/Preferences/Resources/hi.lproj/Localizable.strings new file mode 100644 index 0000000..8603c9f --- /dev/null +++ b/Sources/Preferences/Resources/hi.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "प्राथमिकता"; +"settings" = "समायोजन"; diff --git a/Sources/Preferences/Resources/hr.lproj/Localizable.strings b/Sources/Preferences/Resources/hr.lproj/Localizable.strings new file mode 100644 index 0000000..2919ea1 --- /dev/null +++ b/Sources/Preferences/Resources/hr.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Postavke"; +"settings" = "Postavke"; diff --git a/Sources/Preferences/Resources/hu.lproj/Localizable.strings b/Sources/Preferences/Resources/hu.lproj/Localizable.strings new file mode 100644 index 0000000..a80dc5f --- /dev/null +++ b/Sources/Preferences/Resources/hu.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Beállítások"; +"settings" = "Beállítások"; diff --git a/Sources/Preferences/Resources/id.lproj/Localizable.strings b/Sources/Preferences/Resources/id.lproj/Localizable.strings new file mode 100644 index 0000000..af9d91a --- /dev/null +++ b/Sources/Preferences/Resources/id.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferensi"; +"settings" = "Pengaturan"; diff --git a/Sources/Preferences/Resources/it.lproj/Localizable.strings b/Sources/Preferences/Resources/it.lproj/Localizable.strings new file mode 100644 index 0000000..732453d --- /dev/null +++ b/Sources/Preferences/Resources/it.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferenze"; +"settings" = "Impostazioni"; diff --git a/Sources/Preferences/Resources/ja.lproj/Localizable.strings b/Sources/Preferences/Resources/ja.lproj/Localizable.strings new file mode 100644 index 0000000..d92668d --- /dev/null +++ b/Sources/Preferences/Resources/ja.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "環境設定"; +"settings" = "設定"; diff --git a/Sources/Preferences/Resources/ko.lproj/Localizable.strings b/Sources/Preferences/Resources/ko.lproj/Localizable.strings new file mode 100644 index 0000000..e14a2d7 --- /dev/null +++ b/Sources/Preferences/Resources/ko.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "환경설정"; +"settings" = "설정"; diff --git a/Sources/Preferences/Resources/ms.lproj/Localizable.strings b/Sources/Preferences/Resources/ms.lproj/Localizable.strings new file mode 100644 index 0000000..5344ae8 --- /dev/null +++ b/Sources/Preferences/Resources/ms.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Keutamaan"; +"settings" = "Tetapan"; diff --git a/Sources/Preferences/Resources/nl.lproj/Localizable.strings b/Sources/Preferences/Resources/nl.lproj/Localizable.strings new file mode 100644 index 0000000..8a84f97 --- /dev/null +++ b/Sources/Preferences/Resources/nl.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Voorkeuren"; +"settings" = "Instellingen"; diff --git a/Sources/Preferences/Resources/no.lproj/Localizable.strings b/Sources/Preferences/Resources/no.lproj/Localizable.strings new file mode 100644 index 0000000..7ed2bbb --- /dev/null +++ b/Sources/Preferences/Resources/no.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Valg"; +"settings" = "Innstillinger"; diff --git a/Sources/Preferences/Resources/pl.lproj/Localizable.strings b/Sources/Preferences/Resources/pl.lproj/Localizable.strings new file mode 100644 index 0000000..9e7a24a --- /dev/null +++ b/Sources/Preferences/Resources/pl.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferencje"; +"settings" = "Ustawienia"; diff --git a/Sources/Preferences/Resources/pt-PT.lproj/Localizable.strings b/Sources/Preferences/Resources/pt-PT.lproj/Localizable.strings new file mode 100644 index 0000000..149fedb --- /dev/null +++ b/Sources/Preferences/Resources/pt-PT.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferências"; +"settings" = "Definições"; diff --git a/Sources/Preferences/Resources/pt.lproj/Localizable.strings b/Sources/Preferences/Resources/pt.lproj/Localizable.strings new file mode 100644 index 0000000..fb27598 --- /dev/null +++ b/Sources/Preferences/Resources/pt.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferências"; +"settings" = "Ajustes"; diff --git a/Sources/Preferences/Resources/ro.lproj/Localizable.strings b/Sources/Preferences/Resources/ro.lproj/Localizable.strings new file mode 100644 index 0000000..b91117c --- /dev/null +++ b/Sources/Preferences/Resources/ro.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Preferințe"; +"settings" = "Configurări"; diff --git a/Sources/Preferences/Resources/ru.lproj/Localizable.strings b/Sources/Preferences/Resources/ru.lproj/Localizable.strings new file mode 100644 index 0000000..36ce0b5 --- /dev/null +++ b/Sources/Preferences/Resources/ru.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Настройки"; +"settings" = "Настройки"; diff --git a/Sources/Preferences/Resources/sk.lproj/Localizable.strings b/Sources/Preferences/Resources/sk.lproj/Localizable.strings new file mode 100644 index 0000000..c2179ae --- /dev/null +++ b/Sources/Preferences/Resources/sk.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Nastavenia"; +"settings" = "Nastavenia"; diff --git a/Sources/Preferences/Resources/sv.lproj/Localizable.strings b/Sources/Preferences/Resources/sv.lproj/Localizable.strings new file mode 100644 index 0000000..2ade583 --- /dev/null +++ b/Sources/Preferences/Resources/sv.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Inställningar"; +"settings" = "Inställningar"; diff --git a/Sources/Preferences/Resources/th.lproj/Localizable.strings b/Sources/Preferences/Resources/th.lproj/Localizable.strings new file mode 100644 index 0000000..dab185f --- /dev/null +++ b/Sources/Preferences/Resources/th.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "การตั้งค่า"; +"settings" = "ค่าติดตั้ง"; diff --git a/Sources/Preferences/Resources/tr.lproj/Localizable.strings b/Sources/Preferences/Resources/tr.lproj/Localizable.strings new file mode 100644 index 0000000..c55c1fb --- /dev/null +++ b/Sources/Preferences/Resources/tr.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Tercihler"; +"settings" = "Ayarlar"; diff --git a/Sources/Preferences/Resources/uk.lproj/Localizable.strings b/Sources/Preferences/Resources/uk.lproj/Localizable.strings new file mode 100644 index 0000000..0620aee --- /dev/null +++ b/Sources/Preferences/Resources/uk.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Параметри"; +"settings" = "Параметри"; diff --git a/Sources/Preferences/Resources/vi.lproj/Localizable.strings b/Sources/Preferences/Resources/vi.lproj/Localizable.strings new file mode 100644 index 0000000..ac99749 --- /dev/null +++ b/Sources/Preferences/Resources/vi.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "Tùy chọn"; +"settings" = "Cài đặt"; diff --git a/Sources/Preferences/Resources/zh-CN.lproj/Localizable.strings b/Sources/Preferences/Resources/zh-CN.lproj/Localizable.strings new file mode 100644 index 0000000..974ae4d --- /dev/null +++ b/Sources/Preferences/Resources/zh-CN.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "偏好设置"; +"settings" = "设置"; diff --git a/Sources/Preferences/Resources/zh-HK.lproj/Localizable.strings b/Sources/Preferences/Resources/zh-HK.lproj/Localizable.strings new file mode 100644 index 0000000..8371bfa --- /dev/null +++ b/Sources/Preferences/Resources/zh-HK.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "偏好設定"; +"settings" = "設定"; diff --git a/Sources/Preferences/Resources/zh-TW.lproj/Localizable.strings b/Sources/Preferences/Resources/zh-TW.lproj/Localizable.strings new file mode 100644 index 0000000..8371bfa --- /dev/null +++ b/Sources/Preferences/Resources/zh-TW.lproj/Localizable.strings @@ -0,0 +1,2 @@ +"preferences" = "偏好設定"; +"settings" = "設定"; diff --git a/Sources/Preferences/SettingsTabViewController.swift b/Sources/Preferences/SettingsTabViewController.swift index 9a79b90..c18fcdc 100644 --- a/Sources/Preferences/SettingsTabViewController.swift +++ b/Sources/Preferences/SettingsTabViewController.swift @@ -95,9 +95,9 @@ final class SettingsTabViewController: NSViewController, SettingsStyleController } else { let settings: String if #available(macOS 13, *) { - settings = Localization[.settings] + settings = NSLocalizedString("settings", bundle: .module, comment: "") } else { - settings = Localization[.preferences] + settings = NSLocalizedString("preferences", bundle: .module, comment: "") } let appName = Bundle.main.appName