Skip to content

Commit

Permalink
fix: differentiate languages variants based on the locale
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Sep 9, 2024
1 parent cb34081 commit d327ff0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/helpers/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ export function getLocaleDisplayName(locale?) {
if (!currentLocale) {
currentLocale = NSLocale.alloc().initWithLocaleIdentifier(lang);
}
const localeStr = currentLocale.localizedStringForLanguageCode(locale || lang);
const localeStr = currentLocale.displayNameForKeyForValue(NSLocaleIdentifier, locale || lang);
return localeStr ? capitalize(localeStr) : locale || lang;
} else {
if (!currentLocale) {
currentLocale = java.util.Locale.forLanguageTag(lang);
}
return capitalize(java.util.Locale.forLanguageTag(locale || lang).getDisplayLanguage(currentLocale));
return capitalize(java.util.Locale.forLanguageTag(locale || lang).getDisplayName(currentLocale));
}
}
export function getCurrentISO3Language() {
Expand Down

0 comments on commit d327ff0

Please sign in to comment.