Add support to change language in profile form

This commit is contained in:
Ruben Davila 2017-04-12 23:23:02 -05:00
parent acc807cd30
commit bd86796dd0
3 changed files with 14 additions and 1 deletions

View File

@ -85,7 +85,8 @@ class ProfilesController < Profiles::ApplicationController
:twitter,
:username,
:website_url,
:organization
:organization,
:preferred_language
)
end
end

View File

@ -72,6 +72,9 @@
= f.label :public_email, class: "label-light"
= f.select :public_email, options_for_select(@user.all_emails, selected: @user.public_email), { include_blank: 'Do not show on profile' }, class: "select2"
%span.help-block This email will be displayed on your public profile.
.form-group
= f.label :preferred_language, class: "label-light"
= f.select :preferred_language, Gitlab::I18n::AVAILABLE_LANGUAGES, {}, class: "select2"
.form-group
= f.label :skype, class: "label-light"
= f.text_field :skype, class: "form-control"

9
lib/gitlab/i18n.rb Normal file
View File

@ -0,0 +1,9 @@
module Gitlab
module I18n
AVAILABLE_LANGUAGES = [
[_('English'), 'en'],
[_('Spanish'), 'es'],
[_('Deutsch'), 'de']
]
end
end