Skip to content

Commit 9f5609d

Browse files
committed
AO3-6597 Finish up i18n of invite pages
1 parent aa4251f commit 9f5609d

File tree

5 files changed

+73
-41
lines changed

5 files changed

+73
-41
lines changed

app/views/admin/admin_invitations/index.html.erb

+26-26
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,52 @@
1010
</ul>
1111
<!--/subnav-->
1212
<!--main content-->
13-
<%= form_tag url_for(:controller => 'admin/admin_invitations', :action => :create) do |f| %>
13+
<%= form_tag url_for(controller: "admin/admin_invitations", action: :create) do %>
1414
<fieldset class="simple">
15-
<h3 class="heading">Send to email</h3>
16-
<p>Send an invite code to the following email address:
17-
<%= text_field_tag "invitation[invitee_email]", (@invitation.try(:invitee_email) || ""), :title => ts("invite by email") %>
18-
<span class="submit actions"><%= submit_tag ts('Invite user') %></span>
15+
<h3 class="heading"><%= t(".send_to_email.title") %></h3>
16+
<p><%= t(".send_to_email.send_code_to_email") %>
17+
<%= text_field_tag "invitation[invitee_email]", (@invitation.try(:invitee_email) || "") %>
18+
<span class="submit actions"><%= submit_tag t(".send_to_email.submit") %></span>
1919
</p>
2020
</fieldset>
2121
<% end %>
2222

23-
<%= form_tag url_for(:controller => 'admin/admin_invitations', :action => 'invite_from_queue') do %>
23+
<%= form_tag url_for(controller: "admin/admin_invitations", action: "invite_from_queue") do %>
2424
<fieldset class="simple">
25-
<h3 class="heading">Send invite codes to people in our <%= link_to 'invitations queue', invite_requests_path %></h3>
26-
<p>There are <%= InviteRequest.count %> requests in the queue.</p>
25+
<h3 class="heading"><%= t(".send_to_queue.title_html", invitations_queue_link: link_to(t(".send_to_queue.invitations_queue"), invite_requests_path)) %></h3>
26+
<p><%= t(".send_to_queue.current_request_count", count: InviteRequest.count) %></p>
2727
<p>
28-
<%= label_tag "invitation[invite_from_queue]", ts('Number of people to invite') %>: <%= text_field_tag "invitation[invite_from_queue]" %>
29-
<span class="submit actions"><%= submit_tag ts('Invite from queue') %></span>
28+
<%= label_tag "invitation[invite_from_queue]", t(".send_to_queue.invite_number") %> <%= text_field_tag "invitation[invite_from_queue]" %>
29+
<span class="submit actions"><%= submit_tag t(".send_to_queue.submit") %></span>
3030
</p>
3131
</fieldset>
3232
<% end %>
3333

34-
<%= form_tag url_for(:controller => 'admin/admin_invitations', :action => 'grant_invites_to_users') do %>
34+
<%= form_tag url_for(controller: "admin/admin_invitations", action: "grant_invites_to_users") do %>
3535
<fieldset>
36-
<h3 class="heading"><%=h 'Give invite codes to current users' %></h3>
36+
<h3 class="heading"><%= t(".grant_to_users.title") %></h3>
3737
<dl>
38-
<dt><%= label_tag "invitation[number_of_invites]", ts('Number of invitations') %>:</dt>
38+
<dt><%= label_tag "invitation[number_of_invites]", t(".grant_to_users.amount") %></dt>
3939
<dd><%= text_field_tag "invitation[number_of_invites]" %></dd>
40-
<dt><%= label_tag "invitation[user_group]", ts('Users') %>:</dt>
41-
<dd><%= select_tag "invitation[user_group]", "<option>All</option><option>With no unused invitations</option>".html_safe %></dd>
42-
<dt class="landmark">Submit</dt>
43-
<dd class="submit actions"><%= submit_tag "Generate invitations" %></dd>
40+
<dt><%= label_tag "invitation[user_group]", t(".grant_to_users.user_type") %></dt>
41+
<dd><%= select_tag "invitation[user_group]", "<option>All</option><option>With no unused invitations</option>".html_safe %></dd>
42+
<dt class="landmark"><%= t(".grant_to_users.submit_landmark") %></dt>
43+
<dd class="submit actions"><%= submit_tag t(".grant_to_users.submit") %></dd>
4444
</fieldset>
4545
<% end %>
4646

47-
<%= form_tag url_for(:controller => 'admin/admin_invitations', :action => 'find'), :method => :get do %>
47+
<%= form_tag url_for(controller: "admin/admin_invitations", action: "find"), method: :get do %>
4848
<fieldset>
49-
<h3 class="heading"><%=h 'Track invitations' %></h3>
49+
<h3 class="heading"><%= t(".track_invitations.title") %></h3>
5050
<dl>
51-
<dt><%= label_tag "invitation[user_name]", ts('Enter a user name') %>:</dt>
52-
<dd><%= text_field_tag "invitation[user_name]" %></dd>
53-
<dt><%= label_tag "invitation[token]", ts('Enter an invite token') %>:</dt>
54-
<dd><%= text_field_tag "invitation[token]" %></dd>
55-
<dt><%= label_tag "track_invitation_invitee_email", t(".email") %>:</dt>
51+
<dt><%= label_tag "invitation[user_name]", t(".track_invitations.user_name") %></dt>
52+
<dd><%= text_field_tag "invitation[user_name]" %></dd>
53+
<dt><%= label_tag "invitation[token]", t(".track_invitations.invite_token") %></dt>
54+
<dd><%= text_field_tag "invitation[token]" %></dd>
55+
<dt><%= label_tag "track_invitation_invitee_email", t(".track_invitations.email") %></dt>
5656
<dd><%= text_field_tag "invitation[invitee_email]", nil, id: "track_invitation_invitee_email" %></dd>
57-
<dt class="landmark">Submit</dt>
58-
<dd class="submit actions"><%= submit_tag "Go" %></dd>
57+
<dt class="landmark"><%= t(".track_invitations.submit_landmark") %></dt>
58+
<dd class="submit actions"><%= submit_tag t(".track_invitations.submit") %></dd>
5959
</dl>
6060
</fieldset>
6161
<% end %>

app/views/admin/settings/index.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<% if @admin_setting.invite_from_queue_enabled? %>
8383
<p>
8484
<%= t(".queue_status",
85-
number: @admin_setting.invite_from_queue_number,
85+
count: @admin_setting.invite_from_queue_number,
8686
time: l(@admin_setting.invite_from_queue_at, format: :long)) %>
8787
</p>
8888

app/views/invite_requests/_index_closed.html.erb

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
<!--Descriptive page name, messages and instructions-->
22
<h2 class="heading">
3-
<%= ts("Invitation Requests") %>
3+
<%= t(".page_heading") %>
44
</h2>
55

66
<p class="notice">
7-
<%= ts("<strong>New invitation requests are currently closed.</strong> For
8-
more information, please check the %{news}.",
9-
news: link_to("\"Invitations\" tag on AO3 News",
10-
admin_posts_path(tag: 143))
11-
).html_safe %>
7+
<%= t(".queue_disabled.html",
8+
closed_bold: tag.strong(t(".queue_disabled.closed")),
9+
news_link: link_to(t(".queue_disabled.news"), admin_posts_path(tag: 143))) %>
1210
</p>
1311
<p>
14-
<%= ts("If you have already requested an invitation, you can %{status}. There are %{count} people remaining on the waiting list.",
15-
status: link_to("check your position on the waiting list",
16-
status_invite_requests_path),
17-
count: InviteRequest.count
18-
).html_safe %>
12+
<%= t(".already_requested_html", check_waitlist_position_link: link_to(t(".check_waitlist_position"), status_invite_requests_path)) %>
13+
<%= t(".waiting_list_count", count: InviteRequest.count) %>
1914
<p>
2015
<!--/descriptions-->
2116

config/locales/views/en.yml

+39-2
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,35 @@ en:
8686
token: Enter an invite token
8787
user_name: Enter a user name
8888
index:
89-
email: Enter all or part of an email address
89+
grant_to_users:
90+
amount: 'Number of invitations:'
91+
submit: Generate invitations
92+
submit_landmark: Submit
93+
title: Give invite codes to current users
94+
user_type: 'Users:'
9095
navigation:
9196
queue: Manage Queue
9297
requests: Manage Requests
9398
page_heading: Invite New Users
99+
send_to_email:
100+
send_code_to_email: 'Send an invite code to the following email address:'
101+
submit: Invite user
102+
title: Send to email
103+
send_to_queue:
104+
current_request_count:
105+
one: There is %{count} request in the queue.
106+
other: There are %{count} requests in the queue.
107+
invitations_queue: invitations queue
108+
invite_number: 'Number of people to invite:'
109+
submit: Invite from queue
110+
title_html: Send invite codes to people in our %{invitations_queue_link}
111+
track_invitations:
112+
email: 'Enter all or part of an email address:'
113+
invite_token: 'Enter an invite token:'
114+
submit: Go
115+
submit_landmark: Submit
116+
title: Track invitations
117+
user_name: 'Enter a user name:'
94118
admin_nav:
95119
ao3_news: AO3 News
96120
archive_faq: Archive FAQ
@@ -347,7 +371,9 @@ en:
347371
actions: Actions
348372
disable_support_form: Turn Off Support Form
349373
performance_and_misc: Performance and Misc
350-
queue_status: "%{number} people are scheduled to be sent invitations at %{time}."
374+
queue_status:
375+
one: "%{count} person is scheduled to be sent an invitation at %{time}."
376+
other: "%{count} people are scheduled to be sent invitations at %{time}."
351377
queue_status_help: "(The automatic task that invites people from the queue runs at most every hour. Don't be alarmed if the time you see is within the last hour. Do be alarmed if the time you see is more than one hour in the past and the queue is supposed to be active.)"
352378
update: Update
353379
update:
@@ -1384,6 +1410,17 @@ en:
13841410
invitation:
13851411
email_address_label: Enter an email address
13861412
invite_requests:
1413+
index_closed:
1414+
already_requested_html: If you have already requested an invitation, you can %{check_waitlist_position_link}.
1415+
check_waitlist_position: check your position on the waiting list
1416+
page_heading: Invitation Requests
1417+
queue_disabled:
1418+
closed: New invitation requests are currently closed.
1419+
html: "%{closed_bold} For more information, please check the %{news_link}."
1420+
news: '"Invitations" tag on AO3 News'
1421+
waiting_list_count:
1422+
one: There is %{count} person remaining on the waiting list.
1423+
other: There are %{count} people remaining on the waiting list.
13871424
index_open:
13881425
add_to_list: Add me to the list
13891426
already_requested_html: If you have already requested an invitation, you can %{check_waitlist_position_link}.

features/other_a/invite_queue.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Feature: Invite queue management
5757
# check your place in the queue - invalid address
5858
When I check how long "[email protected]" will have to wait in the invite request queue
5959
Then I should see "Invitation Request Status"
60-
And I should see "We are sending out 10 invitations per 12 hours."
6160
And I should see "Sorry, we can't find the email address you entered."
6261
And I should not see "You are currently number"
6362

@@ -73,6 +72,7 @@ Feature: Invite queue management
7372
Then I should not see "Request an invitation"
7473
And I should not see "invite_request_email"
7574
And I should see "New invitation requests are currently closed."
75+
And I should see "There are 0 people remaining on the waiting list."
7676
And I should not see "Add me to the list"
7777

7878
Scenario: Can still check status when queue is off

0 commit comments

Comments
 (0)