Commit f16112e3 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ee-mw-i18n-flashes' into 'master'

(EE port) Externalize strings in flash messages

See merge request gitlab-org/gitlab-ee!10641
parents f4c80603 21e9bbc0
......@@ -16,7 +16,7 @@ class AbuseReportsController < ApplicationController
if @abuse_report.save
@abuse_report.notify
message = "Thank you for your report. A GitLab administrator will look into it shortly."
message = _("Thank you for your report. A GitLab administrator will look into it shortly.")
redirect_to @abuse_report.user, notice: message
else
render :new
......@@ -37,9 +37,9 @@ class AbuseReportsController < ApplicationController
@user = User.find_by(id: params[:user_id])
if @user.nil?
redirect_to root_path, alert: "Cannot create the abuse report. The user has been deleted."
redirect_to root_path, alert: _("Cannot create the abuse report. The user has been deleted.")
elsif @user.blocked?
redirect_to @user, alert: "Cannot create the abuse report. This user has been blocked."
redirect_to @user, alert: _("Cannot create the abuse report. This user has been blocked.")
end
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -293,7 +293,7 @@ class ApplicationController < ActionController::Base
unless Gitlab::Auth::LDAP::Access.allowed?(current_user)
sign_out current_user
flash[:alert] = "Access denied for your LDAP account."
flash[:alert] = _("Access denied for your LDAP account.")
redirect_to new_user_session_path
end
end
......@@ -340,7 +340,7 @@ class ApplicationController < ActionController::Base
def require_email
if current_user && current_user.temp_oauth_email? && session[:impersonator_id].nil?
return redirect_to profile_path, notice: 'Please complete your profile with email address'
return redirect_to profile_path, notice: _('Please complete your profile with email address')
end
end
......
......@@ -22,7 +22,7 @@ class ConfirmationsController < Devise::ConfirmationsController
after_sign_in(resource)
else
Gitlab::AppLogger.info("Email Confirmed: username=#{resource.username} email=#{resource.email} ip=#{request.remote_ip}")
flash[:notice] = flash[:notice] + " Please sign in."
flash[:notice] = flash[:notice] + _(" Please sign in.")
new_session_path(:user, anchor: 'login-pane')
end
end
......
......@@ -13,9 +13,9 @@ class InvitesController < ApplicationController
if member.accept_invite!(current_user)
label, path = source_info(member.source)
redirect_to path, notice: "You have been granted #{member.human_access} access to #{label}."
redirect_to path, notice: _("You have been granted %{member_human_access} access to %{label}.") % { member_human_access: member.human_access, label: label }
else
redirect_back_or_default(options: { alert: "The invitation could not be accepted." })
redirect_back_or_default(options: { alert: _("The invitation could not be accepted.") })
end
end
......@@ -30,9 +30,9 @@ class InvitesController < ApplicationController
new_user_session_path
end
redirect_to path, notice: "You have declined the invitation to join #{label}."
redirect_to path, notice: _("You have declined the invitation to join %{label}.") % { label: label }
else
redirect_back_or_default(options: { alert: "The invitation could not be declined." })
redirect_back_or_default(options: { alert: _("The invitation could not be declined.") })
end
end
......
......@@ -105,11 +105,11 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
def redirect_identity_link_failed(error_message)
redirect_to profile_account_path, notice: "Authentication failed: #{error_message}"
redirect_to profile_account_path, notice: _("Authentication failed: %{error_message}") % { error_message: error_message }
end
def redirect_identity_linked
redirect_to profile_account_path, notice: 'Authentication method updated'
redirect_to profile_account_path, notice: _('Authentication method updated')
end
def handle_service_ticket(provider, ticket)
......@@ -147,10 +147,10 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def handle_signup_error
label = Gitlab::Auth::OAuth::Provider.label_for(oauth['provider'])
message = ["Signing in using your #{label} account without a pre-existing GitLab account is not allowed."]
message = [_("Signing in using your %{label} account without a pre-existing GitLab account is not allowed.") % { label: label }]
if Gitlab::CurrentSettings.allow_signup?
message << "Create a GitLab account first, and then connect it to your #{label} account."
message << _("Create a GitLab account first, and then connect it to your %{label} account.") % { label: label }
end
flash[:notice] = message.join(' ')
......@@ -168,14 +168,14 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
def fail_auth0_login
flash[:alert] = 'Wrong extern UID provided. Make sure Auth0 is configured correctly.'
flash[:alert] = _('Wrong extern UID provided. Make sure Auth0 is configured correctly.')
redirect_to new_user_session_path
end
def handle_disabled_provider
label = Gitlab::Auth::OAuth::Provider.label_for(oauth['provider'])
flash[:alert] = "Signing in using #{label} has been disabled"
flash[:alert] = _("Signing in using %{label} has been disabled") % { label: label }
redirect_to new_user_session_path
end
......
......@@ -22,7 +22,7 @@ class PasswordsController < Devise::PasswordsController
).first_or_initialize
unless user.reset_password_period_valid?
flash[:alert] = 'Your password reset token has expired.'
flash[:alert] = _('Your password reset token has expired.')
redirect_to(new_user_password_url(user_email: user['email']))
end
end
......@@ -52,7 +52,7 @@ class PasswordsController < Devise::PasswordsController
end
redirect_to after_sending_reset_password_instructions_path_for(resource_name),
alert: "Password authentication is unavailable."
alert: _("Password authentication is unavailable.")
end
def throttle_reset
......
......@@ -15,9 +15,9 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
new_chat_name = current_user.chat_names.new(chat_name_params)
if new_chat_name.save
flash[:notice] = "Authorized #{new_chat_name.chat_name}"
flash[:notice] = _("Authorized %{new_chat_name}") % { new_chat_name: new_chat_name.chat_name }
else
flash[:alert] = "Could not authorize chat nickname. Try again!"
flash[:alert] = _("Could not authorize chat nickname. Try again!")
end
delete_chat_name_token
......@@ -27,7 +27,7 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
def deny
delete_chat_name_token
flash[:notice] = "Denied authorization of chat nickname #{chat_name_params[:user_name]}."
flash[:notice] = _("Denied authorization of chat nickname %{user_name}.") % { user_name: chat_name_params[:user_name] }
redirect_to profile_chat_names_path
end
......@@ -36,9 +36,9 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
@chat_name = chat_names.find(params[:id])
if @chat_name.destroy
flash[:notice] = "Deleted chat nickname: #{@chat_name.chat_name}!"
flash[:notice] = _("Deleted chat nickname: %{chat_name}!") % { chat_name: @chat_name.chat_name }
else
flash[:alert] = "Could not delete chat nickname #{@chat_name.chat_name}."
flash[:alert] = _("Could not delete chat nickname %{chat_name}.") % { chat_name: @chat_name.chat_name }
end
redirect_to profile_chat_names_path, status: :found
......
......@@ -11,7 +11,7 @@ class Profiles::PersonalAccessTokensController < Profiles::ApplicationController
if @personal_access_token.save
PersonalAccessToken.redis_store!(current_user.id, @personal_access_token.token)
redirect_to profile_personal_access_tokens_path, notice: "Your new personal access token has been created."
redirect_to profile_personal_access_tokens_path, notice: _("Your new personal access token has been created.")
else
set_index_vars
render :index
......@@ -22,9 +22,9 @@ class Profiles::PersonalAccessTokensController < Profiles::ApplicationController
@personal_access_token = finder.find(params[:id])
if @personal_access_token.revoke!
flash[:notice] = "Revoked personal access token #{@personal_access_token.name}!"
flash[:notice] = _("Revoked personal access token %{personal_access_token_name}!") % { personal_access_token_name: @personal_access_token.name }
else
flash[:alert] = "Could not revoke personal access token #{@personal_access_token.name}."
flash[:alert] = _("Could not revoke personal access token %{personal_access_token_name}.") % { personal_access_token_name: @personal_access_token.name }
end
redirect_to profile_personal_access_tokens_path
......
......@@ -11,13 +11,13 @@ class Profiles::PreferencesController < Profiles::ApplicationController
result = Users::UpdateService.new(current_user, preferences_params.merge(user: user)).execute
if result[:status] == :success
flash[:notice] = 'Preferences saved.'
flash[:notice] = _('Preferences saved.')
else
flash[:alert] = 'Failed to save preferences.'
flash[:alert] = _('Failed to save preferences.')
end
rescue ArgumentError => e
# Raised when `dashboard` is given an invalid value.
flash[:alert] = "Failed to save preferences (#{e.message})."
flash[:alert] = _("Failed to save preferences (%{error_message}).") % { error_message: e.message }
end
respond_to do |format|
......
......@@ -4,6 +4,6 @@ class Profiles::U2fRegistrationsController < Profiles::ApplicationController
def destroy
u2f_registration = current_user.u2f_registrations.find(params[:id])
u2f_registration.destroy
redirect_to profile_two_factor_auth_path, status: 302, notice: "Successfully deleted U2F device."
redirect_to profile_two_factor_auth_path, status: 302, notice: _("Successfully deleted U2F device.")
end
end
......@@ -27,7 +27,7 @@ class RegistrationsController < Devise::RegistrationsController
persist_accepted_terms_if_required(new_user)
end
else
flash[:alert] = 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.'
flash[:alert] = s_('Profiles|There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
flash.delete :recaptcha_error
render action: 'new'
end
......
......@@ -16,7 +16,7 @@ class SentNotificationsController < ApplicationController
noteable = @sent_notification.noteable
noteable.unsubscribe(@sent_notification.recipient, @sent_notification.project)
flash[:notice] = "You have been unsubscribed from this thread."
flash[:notice] = _("You have been unsubscribed from this thread.")
if current_user
redirect_to noteable_path(noteable)
......
......@@ -70,7 +70,7 @@ class SessionsController < Devise::SessionsController
increment_failed_login_captcha_counter
self.resource = resource_class.new
flash[:alert] = 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.'
flash[:alert] = _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
flash.delete :recaptcha_error
respond_with_navigational(resource) { render :new }
......@@ -122,7 +122,7 @@ class SessionsController < Devise::SessionsController
end
redirect_to edit_user_password_path(reset_password_token: @token),
notice: "Please create a password for your new account."
notice: _("Please create a password for your new account.")
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -16,6 +16,9 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
msgid " Please sign in."
msgstr ""
msgid " Status"
msgstr ""
......@@ -509,6 +512,9 @@ msgstr ""
msgid "Access Tokens"
msgstr ""
msgid "Access denied for your LDAP account."
msgstr ""
msgid "Access denied! Please verify you can add deploy keys to this repository."
msgstr ""
......@@ -1371,12 +1377,18 @@ msgstr ""
msgid "Authentication Log"
msgstr ""
msgid "Authentication failed: %{error_message}"
msgstr ""
msgid "Authentication log"
msgstr ""
msgid "Authentication method"
msgstr ""
msgid "Authentication method updated"
msgstr ""
msgid "Authentication via U2F device failed."
msgstr ""
......@@ -1398,6 +1410,9 @@ msgstr ""
msgid "Authorize %{link_to_client} to use your account?"
msgstr ""
msgid "Authorized %{new_chat_name}"
msgstr ""
msgid "Authorized At"
msgstr ""
......@@ -1944,6 +1959,12 @@ msgstr ""
msgid "Cannot be merged automatically"
msgstr ""
msgid "Cannot create the abuse report. The user has been deleted."
msgstr ""
msgid "Cannot create the abuse report. This user has been blocked."
msgstr ""
msgid "Cannot modify managed Kubernetes cluster"
msgstr ""
......@@ -3125,12 +3146,18 @@ msgstr ""
msgid "Copy token to clipboard"
msgstr ""
msgid "Could not authorize chat nickname. Try again!"
msgstr ""
msgid "Could not connect to FogBugz, check your URL"
msgstr ""
msgid "Could not create Wiki Repository at this time. Please try again later."
msgstr ""
msgid "Could not delete chat nickname %{chat_name}."
msgstr ""
msgid "Could not remove the trigger."
msgstr ""
......@@ -3140,6 +3167,9 @@ msgstr ""
msgid "Could not revoke impersonation token %{token_name}."
msgstr ""
msgid "Could not revoke personal access token %{personal_access_token_name}."
msgstr ""
msgid "Coverage"
msgstr ""
......@@ -3152,6 +3182,9 @@ msgstr ""
msgid "Create New Domain"
msgstr ""
msgid "Create a GitLab account first, and then connect it to your %{label} account."
msgstr ""
msgid "Create a new branch"
msgstr ""
......@@ -3440,6 +3473,9 @@ msgstr ""
msgid "Deleted"
msgstr ""
msgid "Deleted chat nickname: %{chat_name}!"
msgstr ""
msgid "Deleting the license failed."
msgstr ""
......@@ -3449,6 +3485,9 @@ msgstr ""
msgid "Deleting the license failed. You are not permitted to perform this action."
msgstr ""
msgid "Denied authorization of chat nickname %{user_name}."
msgstr ""
msgid "Deny"
msgstr ""
......@@ -4465,6 +4504,12 @@ msgstr ""
msgid "Failed to save new settings"
msgstr ""
msgid "Failed to save preferences (%{error_message})."
msgstr ""
msgid "Failed to save preferences."
msgstr ""
msgid "Failed to signing using smartcard authentication"
msgstr ""
......@@ -7764,6 +7809,9 @@ msgstr ""
msgid "Password"
msgstr ""
msgid "Password authentication is unavailable."
msgstr ""
msgid "Past due"
msgstr ""
......@@ -8043,12 +8091,18 @@ msgstr ""
msgid "Please choose a group URL with no special characters."
msgstr ""
msgid "Please complete your profile with email address"
msgstr ""
msgid "Please convert them to %{link_to_git}, and go through the %{link_to_import_flow} again."
msgstr ""
msgid "Please convert them to Git on Google Code, and go through the %{link_to_import_flow} again."
msgstr ""
msgid "Please create a password for your new account."
msgstr ""
msgid "Please create a username with only alphanumeric characters."
msgstr ""
......@@ -8109,6 +8163,9 @@ msgstr ""
msgid "Preferences"
msgstr ""
msgid "Preferences saved."
msgstr ""
msgid "Preferences|Navigation theme"
msgstr ""
......@@ -8316,6 +8373,9 @@ msgstr ""
msgid "Profiles|The maximum file size allowed is 200KB."
msgstr ""
msgid "Profiles|There was an error with the reCAPTCHA. Please solve the reCAPTCHA again."
msgstr ""
msgid "Profiles|This doesn't look like a public SSH key, are you sure you want to add it?"
msgstr ""
......@@ -9284,6 +9344,9 @@ msgstr ""
msgid "Revoked impersonation token %{token_name}!"
msgstr ""
msgid "Revoked personal access token %{personal_access_token_name}!"
msgstr ""
msgid "Roadmap"
msgstr ""
......@@ -9958,6 +10021,12 @@ msgstr ""
msgid "Sign-up restrictions"
msgstr ""
msgid "Signing in using %{label} has been disabled"
msgstr ""
msgid "Signing in using your %{label} account without a pre-existing GitLab account is not allowed."
msgstr ""
msgid "Similar issues"
msgstr ""
......@@ -10507,6 +10576,9 @@ msgstr ""
msgid "Successfully confirmed"
msgstr ""
msgid "Successfully deleted U2F device."
msgstr ""
msgid "Successfully removed email."
msgstr ""
......@@ -10684,6 +10756,9 @@ msgstr ""
msgid "Test failed."
msgstr ""
msgid "Thank you for your report. A GitLab administrator will look into it shortly."
msgstr ""
msgid "Thanks! Don't show me this again"
msgstr ""
......@@ -10770,6 +10845,12 @@ msgstr ""
msgid "The import will time out after %{timeout}. For repositories that take longer, use a clone/push combination."
msgstr ""
msgid "The invitation could not be accepted."
msgstr ""
msgid "The invitation could not be declined."
msgstr ""
msgid "The invitation has already been accepted."
msgstr ""
......@@ -12417,6 +12498,9 @@ msgstr ""
msgid "Write milestone description..."
msgstr ""
msgid "Wrong extern UID provided. Make sure Auth0 is configured correctly."
msgstr ""
msgid "Yes"
msgstr ""
......@@ -12549,6 +12633,15 @@ msgstr ""
msgid "You don't have any deployments right now."
msgstr ""
msgid "You have been granted %{member_human_access} access to %{label}."
msgstr ""
msgid "You have been unsubscribed from this thread."
msgstr ""
msgid "You have declined the invitation to join %{label}."
msgstr ""
msgid "You have no permissions"
msgstr ""
......@@ -12720,6 +12813,12 @@ msgstr ""
msgid "Your new SCIM token"
msgstr ""
msgid "Your new personal access token has been created."
msgstr ""
msgid "Your password reset token has expired."
msgstr ""
msgid "Your project limit is %{limit} projects! Please contact your administrator to increase it"
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