diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /app/helpers/preferences_helper.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'app/helpers/preferences_helper.rb')
-rw-r--r-- | app/helpers/preferences_helper.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb index 57afe0ed0be..f2b7c0064e4 100644 --- a/app/helpers/preferences_helper.rb +++ b/app/helpers/preferences_helper.rb @@ -100,11 +100,19 @@ module PreferencesHelper def language_choices options_for_select( - selectable_locales_with_translation_level.sort, + selectable_locales_with_translation_level(Gitlab::I18n::MINIMUM_TRANSLATION_LEVEL).sort, current_user.preferred_language ) end + def default_preferred_language_choices + options_for_select( + selectable_locales_with_translation_level( + PreferredLanguageSwitcherHelper::SWITCHER_MINIMUM_TRANSLATION_LEVEL).sort, + Gitlab::CurrentSettings.default_preferred_language + ) + end + def integration_views [].tap do |views| views << { name: 'gitpod', message: gitpod_enable_description, message_url: gitpod_url_placeholder, help_link: help_page_path('integration/gitpod.md') } if Gitlab::CurrentSettings.gitpod_enabled @@ -136,8 +144,8 @@ module PreferencesHelper 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| + def selectable_locales_with_translation_level(minimum_level) + Gitlab::I18n.selectable_locales(minimum_level).map do |code, language| [ s_("i18n|%{language} (%{percent_translated}%% translated)") % { language: language, |