diff options
Diffstat (limited to 'app/helpers/preferences_helper.rb')
-rw-r--r-- | app/helpers/preferences_helper.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb index add6e1eaf6f..d851ed3db8f 100644 --- a/app/helpers/preferences_helper.rb +++ b/app/helpers/preferences_helper.rb @@ -4,8 +4,8 @@ module PreferencesHelper def layout_choices [ - ['Fixed', :fixed], - ['Fluid', :fluid] + ['Fixed', :fixed], + ['Fluid', :fluid] ] end @@ -76,7 +76,7 @@ module PreferencesHelper def language_choices options_for_select( - Gitlab::I18n.selectable_locales.map(&:reverse).sort, + selectable_locales_with_translation_level.sort, current_user.preferred_language ) end @@ -107,6 +107,18 @@ module PreferencesHelper def default_first_day_of_week first_day_of_week_choices.rassoc(Gitlab::CurrentSettings.first_day_of_week).first end + + def selectable_locales_with_translation_level + Gitlab::I18n.selectable_locales.map do |code, language| + [ + s_("i18n|%{language} (%{percent_translated}%% translated)") % { + language: language, + percent_translated: Gitlab::I18n.percentage_translated_for(code) + }, + code + ] + end + end end -PreferencesHelper.prepend_if_ee('EE::PreferencesHelper') +PreferencesHelper.prepend_mod_with('PreferencesHelper') |