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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user