Commit 8021efb7 authored by antony liu's avatar antony liu Committed by Rémy Coutable

i18n: externalize strings from user profile settings

parent a64904e4
...@@ -15,7 +15,7 @@ class ProfilesController < Profiles::ApplicationController ...@@ -15,7 +15,7 @@ class ProfilesController < Profiles::ApplicationController
result = Users::UpdateService.new(current_user, user_params.merge(user: @user)).execute result = Users::UpdateService.new(current_user, user_params.merge(user: @user)).execute
if result[:status] == :success if result[:status] == :success
message = "Profile was successfully updated" message = s_("Profiles|Profile was successfully updated")
format.html { redirect_back_or_default(default: { action: 'show' }, options: { notice: message }) } format.html { redirect_back_or_default(default: { action: 'show' }, options: { notice: message }) }
format.json { render json: { message: message } } format.json { render json: { message: message } }
...@@ -31,7 +31,7 @@ class ProfilesController < Profiles::ApplicationController ...@@ -31,7 +31,7 @@ class ProfilesController < Profiles::ApplicationController
user.reset_incoming_email_token! user.reset_incoming_email_token!
end end
flash[:notice] = "Incoming email token was successfully reset" flash[:notice] = s_("Profiles|Incoming email token was successfully reset")
redirect_to profile_personal_access_tokens_path redirect_to profile_personal_access_tokens_path
end end
...@@ -41,7 +41,7 @@ class ProfilesController < Profiles::ApplicationController ...@@ -41,7 +41,7 @@ class ProfilesController < Profiles::ApplicationController
user.reset_feed_token! user.reset_feed_token!
end end
flash[:notice] = 'Feed token was successfully reset' flash[:notice] = s_('Profiles|Feed token was successfully reset')
redirect_to profile_personal_access_tokens_path redirect_to profile_personal_access_tokens_path
end end
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= link_to profile_path, title: _('Profile Settings') do = link_to profile_path, title: _('Profile Settings') do
.avatar-container.s40.settings-avatar .avatar-container.s40.settings-avatar
= image_tag avatar_icon_for_user(current_user, 40), class: "avatar s40 avatar-tile", alt: current_user.name = image_tag avatar_icon_for_user(current_user, 40), class: "avatar s40 avatar-tile", alt: current_user.name
.sidebar-context-title User Settings .sidebar-context-title= _('User Settings')
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path do = link_to profile_path do
......
...@@ -92,8 +92,8 @@ ...@@ -92,8 +92,8 @@
= f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name' }, = f.text_field :name, required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name' },
help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) } help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) }
- else - else
= f.text_field :name, label: 'Full name', required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you") = f.text_field :name, label: s_('Profiles|Full name'), required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you")
= f.text_field :id, readonly: true, label: 'User ID', wrapper: { class: 'col-md-3' } = f.text_field :id, readonly: true, label: s_('Profiles|User ID'), wrapper: { class: 'col-md-3' }
= render_if_exists 'profiles/email_settings', form: f = render_if_exists 'profiles/email_settings', form: f
= f.text_field :skype, class: 'input-md', placeholder: s_("Profiles|username") = f.text_field :skype, class: 'input-md', placeholder: s_("Profiles|username")
...@@ -103,18 +103,18 @@ ...@@ -103,18 +103,18 @@
- if @user.read_only_attribute?(:location) - if @user.read_only_attribute?(:location)
= f.text_field :location, readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) } = f.text_field :location, readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) }
- else - else
= f.text_field :location, class: 'input-lg', placeholder: s_("Profiles|City, country") = f.text_field :location, label: s_('Profiles|Location'), class: 'input-lg', placeholder: s_("Profiles|City, country")
= f.text_field :organization, class: 'input-md', help: s_("Profiles|Who you represent or work for") = f.text_field :organization, label: s_('Profiles|Organization'), class: 'input-md', help: s_("Profiles|Who you represent or work for")
= f.text_area :bio, rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters") = f.text_area :bio, label: s_('Profiles|Bio'), rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters")
%hr %hr
%h5= ("Private profile") %h5= s_("Private profile")
.checkbox-icon-inline-wrapper .checkbox-icon-inline-wrapper
- private_profile_label = capture do - private_profile_label = capture do
= s_("Profiles|Don't display activity-related personal information on your profiles") = s_("Profiles|Don't display activity-related personal information on your profiles")
= f.check_box :private_profile, label: private_profile_label, inline: true, wrapper_class: 'mr-0' = f.check_box :private_profile, label: private_profile_label, inline: true, wrapper_class: 'mr-0'
= link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'private-profile') = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'private-profile')
%h5= s_("Profiles|Private contributions") %h5= s_("Profiles|Private contributions")
= f.check_box :include_private_contributions, label: 'Include private contributions on my profile', wrapper_class: 'mb-2', inline: true = f.check_box :include_private_contributions, label: s_('Profiles|Include private contributions on my profile'), wrapper_class: 'mb-2', inline: true
.help-block .help-block
= s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information") = s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information")
.prepend-top-default.append-bottom-default .prepend-top-default.append-bottom-default
......
---
title: 'i18n: externalize strings from user profile settings'
merge_request: 28088
author: Antony Liu
type: other
...@@ -7061,6 +7061,9 @@ msgstr "" ...@@ -7061,6 +7061,9 @@ msgstr ""
msgid "Private - The group and its projects can only be viewed by members." msgid "Private - The group and its projects can only be viewed by members."
msgstr "" msgstr ""
msgid "Private profile"
msgstr ""
msgid "Private projects can be created in your personal namespace with:" msgid "Private projects can be created in your personal namespace with:"
msgstr "" msgstr ""
...@@ -7100,6 +7103,9 @@ msgstr "" ...@@ -7100,6 +7103,9 @@ msgstr ""
msgid "Profiles|Avatar will be removed. Are you sure?" msgid "Profiles|Avatar will be removed. Are you sure?"
msgstr "" msgstr ""
msgid "Profiles|Bio"
msgstr ""
msgid "Profiles|Change username" msgid "Profiles|Change username"
msgstr "" msgstr ""
...@@ -7160,6 +7166,18 @@ msgstr "" ...@@ -7160,6 +7166,18 @@ msgstr ""
msgid "Profiles|Enter your name, so people you know can recognize you" msgid "Profiles|Enter your name, so people you know can recognize you"
msgstr "" msgstr ""
msgid "Profiles|Feed token was successfully reset"
msgstr ""
msgid "Profiles|Full name"
msgstr ""
msgid "Profiles|Include private contributions on my profile"
msgstr ""
msgid "Profiles|Incoming email token was successfully reset"
msgstr ""
msgid "Profiles|Increase your account's security by enabling Two-Factor Authentication (2FA)" msgid "Profiles|Increase your account's security by enabling Two-Factor Authentication (2FA)"
msgstr "" msgstr ""
...@@ -7172,6 +7190,9 @@ msgstr "" ...@@ -7172,6 +7190,9 @@ msgstr ""
msgid "Profiles|Learn more" msgid "Profiles|Learn more"
msgstr "" msgstr ""
msgid "Profiles|Location"
msgstr ""
msgid "Profiles|Made a private contribution" msgid "Profiles|Made a private contribution"
msgstr "" msgstr ""
...@@ -7181,6 +7202,9 @@ msgstr "" ...@@ -7181,6 +7202,9 @@ msgstr ""
msgid "Profiles|No file chosen" msgid "Profiles|No file chosen"
msgstr "" msgstr ""
msgid "Profiles|Organization"
msgstr ""
msgid "Profiles|Path" msgid "Profiles|Path"
msgstr "" msgstr ""
...@@ -7190,6 +7214,9 @@ msgstr "" ...@@ -7190,6 +7214,9 @@ msgstr ""
msgid "Profiles|Private contributions" msgid "Profiles|Private contributions"
msgstr "" msgstr ""
msgid "Profiles|Profile was successfully updated"
msgstr ""
msgid "Profiles|Public Avatar" msgid "Profiles|Public Avatar"
msgstr "" msgstr ""
...@@ -7253,6 +7280,9 @@ msgstr "" ...@@ -7253,6 +7280,9 @@ msgstr ""
msgid "Profiles|Use a private email - %{email}" msgid "Profiles|Use a private email - %{email}"
msgstr "" msgstr ""
msgid "Profiles|User ID"
msgstr ""
msgid "Profiles|Username change failed - %{message}" msgid "Profiles|Username change failed - %{message}"
msgstr "" msgstr ""
......
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