Fix localization issues, and export and import translations

This commit is contained in:
tyiu committed 2023-03-16 23:00:52 -04:00
1 parent eabbb12195
commit f367df2225
27 files changed
+715 -56

No files matched your search

+6
View File
@@ -15,3 +15,9 @@ func bundleForLocale(locale: Locale?) -> Bundle {
let path = Bundle.main.path(forResource: locale!.identifier, ofType: "lproj")
return path != nil ? (Bundle(path: path!) ?? Bundle.main) : Bundle.main
}
func localizedStringFormat(key: String, locale: Locale?) -> String {
let bundle = bundleForLocale(locale: locale)
let fallback = bundleForLocale(locale: Locale(identifier: "en-US")).localizedString(forKey: key, value: nil, table: nil)
return bundle.localizedString(forKey: key, value: fallback, table: nil)
}