diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-02-09 04:15:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 04:15:38 +0100 |
commit | 3aebe711fd54d75c1ea35e65a5dc342e78508d15 (patch) | |
tree | dfcf0267428ea30cce194e58d201d5cabcc1e0cc /app/helpers | |
parent | fd3a45e3482e86dad3c1dfc069144864c4ff0b0b (diff) |
Change languages to be listed under standard instead of native name in admin UI (#17485)
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/languages_helper.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/helpers/languages_helper.rb b/app/helpers/languages_helper.rb index f3ed7b314..3a65af686 100644 --- a/app/helpers/languages_helper.rb +++ b/app/helpers/languages_helper.rb @@ -209,8 +209,8 @@ module LanguagesHelper 'zh-TW': '繁體中文(臺灣)', }.freeze - def human_locale(locale) - if locale == 'und' + def native_locale_name(locale) + if locale.blank? || locale == 'und' I18n.t('generic.none') elsif (supported_locale = SUPPORTED_LOCALES[locale.to_sym]) supported_locale[1] @@ -221,6 +221,16 @@ module LanguagesHelper end end + def standard_locale_name(locale) + if locale.blank? + I18n.t('generic.none') + elsif (supported_locale = SUPPORTED_LOCALES[locale.to_sym]) + supported_locale[0] + else + locale + end + end + def valid_locale_or_nil(str) return if str.blank? |