Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Make I18n.t calls Ruby 3.0 compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
OtherCroissant committed Jan 4, 2021
1 parent eded53f commit 64a8c54
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions app/views/devise/enable_authy.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h2><%= I18n.t('authy_register_title', {:scope => 'devise'}) %></h2>
<h2><%= I18n.t('authy_register_title', scope: 'devise') %></h2>

<%= enable_authy_form do %>
<%= text_field_tag :country_code, '', :autocomplete => :off, :placeholder => I18n.t('devise.country'), :id => "authy-countries"%>
<%= text_field_tag :cellphone, '', :autocomplete => :off, :placeholder => I18n.t('devise.cellphone'), :id => "authy-cellphone"%>
<p><%= submit_tag I18n.t('enable_authy', {:scope => 'devise'}) %></p>
<p><%= submit_tag I18n.t('enable_authy', scope: 'devise') %></p>
<% end %>
4 changes: 2 additions & 2 deletions app/views/devise/enable_authy.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%h2= I18n.t('authy_register_title', {:scope => 'devise'})
%h2= I18n.t('authy_register_title', scope: 'devise')
= enable_authy_form do
= text_field_tag :country_code, '', :autocomplete => :off, :placeholder => I18n.t('devise.country'), :id => "authy-countries"
= text_field_tag :cellphone, '', :autocomplete => :off, :placeholder => I18n.t('devise.cellphone'), :id => "authy-cellphone"
%p= submit_tag I18n.t('enable_authy', {:scope => 'devise'})
%p= submit_tag I18n.t('enable_authy', scope: 'devise')
8 changes: 4 additions & 4 deletions app/views/devise/verify_authy.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h2>
<%= I18n.t('submit_token_title', {:scope => 'devise'}) %>
<%= I18n.t('submit_token_title', scope: 'devise') %>
</h2>

<%= verify_authy_form do %>
<legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
<legend><%= I18n.t('submit_token_title', scope: 'devise') %></legend>
<%= label_tag 'authy-token' %>
<%= text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token' %>
<label>
<%= check_box_tag :remember_device %>
<span><%= I18n.t('remember_device', {:scope => 'devise'}) %></span>
<span><%= I18n.t('remember_device', scope: 'devise') %></span>
</label>

<!-- Help tooltip -->
Expand All @@ -17,7 +17,7 @@
<!-- <%= link_to '?', '#', :id => 'authy-help' %> -->

<%= authy_request_sms_link %>
<%= submit_tag I18n.t('submit_token', {:scope => 'devise'}), :class => 'btn' %>
<%= submit_tag I18n.t('submit_token', scope: 'devise'), :class => 'btn' %>
<% end %>

<% if @onetouch_uuid %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/devise/verify_authy.html.haml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
%h2= I18n.t('authy_register_title', {:scope => 'devise'})
%h2= I18n.t('authy_register_title', scope: 'devise')

= verify_authy_form do
%legend= I18n.t('submit_token_title', {:scope => 'devise'})
%legend= I18n.t('submit_token_title', scope: 'devise')
= hidden_field_tag :"#{resource_name}_id", @resource.id
= label_tag 'authy-token'
= text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token'
%label
= check_box_tag :remember_device
%span= I18n.t('remember_device', {:scope => 'devise'})
%span= I18n.t('remember_device', scope: 'devise')

/ Help Tooltip
/ You need to configure a help message.
/ See documentation: https://github.com/authy/authy-form-helpers#help-tooltip
/ = link_to '?', '#', :id => 'authy-help', :'data-message' => 'a message'
= authy_request_sms_link
= submit_tag I18n.t('submit_token', {:scope => 'devise'}), :class => 'btn'
= submit_tag I18n.t('submit_token', scope: 'devise'), :class => 'btn'

- if @onetouch_uuid
:javascript
Expand Down
12 changes: 6 additions & 6 deletions app/views/devise/verify_authy_installation.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<h2><%= I18n.t('authy_verify_installation_title', {:scope => 'devise'}) %></h2>
<h2><%= I18n.t('authy_verify_installation_title', scope: 'devise') %></h2>

<% if @authy_qr_code %>
<%= image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', {:scope => 'devise'}) %>
<p><%= I18n.t('authy_qr_code_instructions', {:scope => 'devise'}) %></p>
<%= image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', scope: 'devise') %>
<p><%= I18n.t('authy_qr_code_instructions', scope: 'devise') %></p>
<% end %>

<%= verify_authy_installation_form do %>
<legend><%= I18n.t('submit_token_title', {:scope => 'devise'}) %></legend>
<legend><%= I18n.t('submit_token_title', scope: 'devise') %></legend>
<%= label_tag :token %>
<%= text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token' %>
<label>
<%= check_box_tag :remember_device %>
<span><%= I18n.t('remember_device', {:scope => 'devise'}) %></span>
<span><%= I18n.t('remember_device', scope: 'devise') %></span>
</label>
<%= authy_request_sms_link %>
<%= submit_tag I18n.t('enable_my_account', {:scope => 'devise'}), :class => 'btn' %>
<%= submit_tag I18n.t('enable_my_account', scope: 'devise'), :class => 'btn' %>
<% end %>
12 changes: 6 additions & 6 deletions app/views/devise/verify_authy_installation.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
%h2= I18n.t('authy_verify_installation_title', {:scope => 'devise'})
%h2= I18n.t('authy_verify_installation_title', scope: 'devise')

- if @authy_qr_code
= image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', {:scope => 'devise'})
%p= I18n.t('authy_qr_code_instructions', {:scope => 'devise'})
= image_tag @authy_qr_code, :size => '256x256', :alt => I18n.t('authy_qr_code_alt', scope: 'devise')
%p= I18n.t('authy_qr_code_instructions', scope: 'devise')

= verify_authy_installation_form do
%legend= I18n.t('submit_token_title', {:scope => 'devise'})
%legend= I18n.t('submit_token_title', scope: 'devise')
= label_tag :token
= text_field_tag :token, "", :autocomplete => "one-time-code", :inputmode => "numeric", :pattern => "[0-9]*", :id => 'authy-token'
%label
= check_box_tag :remember_device
%span= I18n.t('remember_device', {:scope => 'devise'})
%span= I18n.t('remember_device', scope: 'devise')
= authy_request_sms_link
= submit_tag I18n.t('enable_my_account', {:scope => 'devise'}), :class => 'btn'
= submit_tag I18n.t('enable_my_account', scope: 'devise'), :class => 'btn'

2 changes: 1 addition & 1 deletion lib/devise-authy/controllers/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def verify_authy_path_for(resource_or_scope = nil)
end

def send_one_touch_request(authy_id)
Authy::OneTouch.send_approval_request(id: authy_id, message: I18n.t('request_to_login', { :scope => 'devise' }))
Authy::OneTouch.send_approval_request(id: authy_id, message: I18n.t('request_to_login', scope: 'devise'))
end

def record_authy_authentication
Expand Down
2 changes: 1 addition & 1 deletion lib/devise-authy/controllers/view_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Views
module Helpers
def authy_request_phone_call_link(opts = {})
title = opts.delete(:title) do
I18n.t('request_phone_call', { :scope => 'devise' })
I18n.t('request_phone_call', scope: 'devise')
end
opts = {
:id => "authy-request-phone-call-link",
Expand Down

0 comments on commit 64a8c54

Please sign in to comment.