Fix localization issues and export strings for translation

Changelog-Fixed: Fix localization issues and export strings for translation
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
2023-07-14 00:21:08 -04:00
committed by William Casarin
parent 4830a6f3b7
commit 8a9e3ea76b
21 changed files with 148 additions and 215 deletions

View File

@@ -32,3 +32,9 @@ func localeToLanguage(_ locale: String) -> String? {
return NSLocale(localeIdentifier: locale).languageCode
}
}
/// Returns a localized string that is pluralized based on a single Int-typed count variable.
func pluralizedString(key: String, count: Int, locale: Locale = Locale.current) -> String {
let format = localizedStringFormat(key: key, locale: locale)
return String(format: format, locale: locale, count)
}