Commit bd86796d authored by Ruben Davila's avatar Ruben Davila

Add support to change language in profile form

parent acc807cd
...@@ -85,7 +85,8 @@ class ProfilesController < Profiles::ApplicationController ...@@ -85,7 +85,8 @@ class ProfilesController < Profiles::ApplicationController
:twitter, :twitter,
:username, :username,
:website_url, :website_url,
:organization :organization,
:preferred_language
) )
end end
end end
...@@ -72,6 +72,9 @@ ...@@ -72,6 +72,9 @@
= f.label :public_email, class: "label-light" = 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" = 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. %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 .form-group
= f.label :skype, class: "label-light" = f.label :skype, class: "label-light"
= f.text_field :skype, class: "form-control" = f.text_field :skype, class: "form-control"
......
module Gitlab
module I18n
AVAILABLE_LANGUAGES = [
[_('English'), 'en'],
[_('Spanish'), 'es'],
[_('Deutsch'), 'de']
]
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment