summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2017-04-12 23:23:02 -0500
committerRuben Davila <rdavila84@gmail.com>2017-04-12 23:23:02 -0500
commitbd86796dd0edae7e5db2bfbb887d3196498ebd49 (patch)
tree512f500bf4205de786d4cc6377cec51cff39a8fc
parentacc807cd30a4b0005b552d67583b20538474a1f2 (diff)
downloadgitlab-ce-bd86796dd0edae7e5db2bfbb887d3196498ebd49.tar.gz
Add support to change language in profile form
-rw-r--r--app/controllers/profiles_controller.rb3
-rw-r--r--app/views/profiles/show.html.haml3
-rw-r--r--lib/gitlab/i18n.rb9
3 files changed, 14 insertions, 1 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 987b95e89b9..57e23cea00e 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -85,7 +85,8 @@ class ProfilesController < Profiles::ApplicationController
:twitter,
:username,
:website_url,
- :organization
+ :organization,
+ :preferred_language
)
end
end
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index c74b3249a13..dc71a04cbf0 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -73,6 +73,9 @@
= 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"
.form-group
diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb
new file mode 100644
index 00000000000..8c578aa0b46
--- /dev/null
+++ b/lib/gitlab/i18n.rb
@@ -0,0 +1,9 @@
+module Gitlab
+ module I18n
+ AVAILABLE_LANGUAGES = [
+ [_('English'), 'en'],
+ [_('Spanish'), 'es'],
+ [_('Deutsch'), 'de']
+ ]
+ end
+end