From 46e8c12436785bee2befd9eb6f1c25e8c1294a58 Mon Sep 17 00:00:00 2001 From: antonyliu Date: Fri, 17 May 2019 13:59:31 +0800 Subject: Externalize strings of Two-Factor Authentication page in user profile --- app/controllers/profiles/accounts_controller.rb | 2 +- app/controllers/profiles/two_factor_auths_controller.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/controllers/profiles') diff --git a/app/controllers/profiles/accounts_controller.rb b/app/controllers/profiles/accounts_controller.rb index 0d2a6145d0e..b03f4b7435f 100644 --- a/app/controllers/profiles/accounts_controller.rb +++ b/app/controllers/profiles/accounts_controller.rb @@ -17,7 +17,7 @@ class Profiles::AccountsController < Profiles::ApplicationController if unlink_provider_allowed?(provider) identity.destroy else - flash[:alert] = "You are not allowed to unlink your primary login account" + flash[:alert] = _("You are not allowed to unlink your primary login account") end redirect_to profile_account_path diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 83e14275a8b..95b9344c551 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -18,7 +18,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController two_factor_authentication_reason( global: lambda do flash.now[:alert] = - s_('The global settings require you to enable Two-Factor Authentication for your account.') + _('The global settings require you to enable Two-Factor Authentication for your account.') end, group: lambda do |groups| flash.now[:alert] = groups_notification(groups) @@ -27,7 +27,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController unless two_factor_grace_period_expired? grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours - flash.now[:alert] = flash.now[:alert] + s_(" You need to do this before %{grace_period_deadline}.") % { grace_period_deadline: l(grace_period_deadline) } + flash.now[:alert] = flash.now[:alert] + _(" You need to do this before %{grace_period_deadline}.") % { grace_period_deadline: l(grace_period_deadline) } end end @@ -44,7 +44,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController render 'create' else - @error = s_('Invalid pin code') + @error = _('Invalid pin code') @qr_code = build_qr_code setup_u2f_registration render 'show' -- cgit v1.2.3