debian-mirror-gitlab/app/controllers/concerns/preferred_language_switcher.rb

19 lines
410 B
Ruby
Raw Normal View History

2023-01-13 00:05:48 +05:30
# frozen_string_literal: true
module PreferredLanguageSwitcher
extend ActiveSupport::Concern
private
def init_preferred_language
cookies[:preferred_language] = preferred_language
end
def preferred_language
cookies[:preferred_language].presence_in(Gitlab::I18n.available_locales) ||
Gitlab::CurrentSettings.default_preferred_language
end
end
2023-03-04 22:38:38 +05:30
PreferredLanguageSwitcher.prepend_mod