From: Andy Allan Date: Wed, 18 Apr 2018 06:20:41 +0000 (+0800) Subject: Use lazy translation lookups for the user_blocks partials. X-Git-Tag: live~3601^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/736ff9b1a0fd251778c06e785a78ceebac960190 Use lazy translation lookups for the user_blocks partials. --- diff --git a/app/views/user_blocks/_block.html.erb b/app/views/user_blocks/_block.html.erb index d91168f54..b8a753e04 100644 --- a/app/views/user_blocks/_block.html.erb +++ b/app/views/user_blocks/_block.html.erb @@ -11,14 +11,14 @@ <%=h block_status(block) %> <% if block.revoker_id.nil? %> - <%= t('user_block.partial.not_revoked') %> + <%= t('.not_revoked') %> <% else %> <%= link_to h(block.revoker.display_name), user_path(block.revoker) %> <% end %> - <%= link_to t('user_block.partial.show'), block %> - <% if current_user and current_user.id == block.creator_id and block.active? %><%= link_to t('user_block.partial.edit'), edit_user_block_path(block) %><% end %> + <%= link_to t('.show'), block %> + <% if current_user and current_user.id == block.creator_id and block.active? %><%= link_to t('.edit'), edit_user_block_path(block) %><% end %> <% if show_revoke_link %> - <% if block.active? %><%= link_to t('user_block.partial.revoke'), :controller => 'user_blocks', :action => 'revoke', :id => block.id %><% end %> + <% if block.active? %><%= link_to t('.revoke'), :controller => 'user_blocks', :action => 'revoke', :id => block.id %><% end %> <% end %> diff --git a/app/views/user_blocks/_blocks.html.erb b/app/views/user_blocks/_blocks.html.erb index e9dfc7185..01e54de21 100644 --- a/app/views/user_blocks/_blocks.html.erb +++ b/app/views/user_blocks/_blocks.html.erb @@ -1,14 +1,14 @@ <% if show_user_name %> - + <% end %> <% if show_creator_name %> - + <% end %> - - - + + + <% if show_revoke_link %> @@ -20,16 +20,16 @@ diff --git a/config/locales/en.yml b/config/locales/en.yml index 7df06b277..b31ce4d5d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2159,20 +2159,6 @@ en: period: one: "1 hour" other: "%{count} hours" - partial: - show: "Show" - edit: "Edit" - revoke: "Revoke!" - confirm: "Are you sure?" - display_name: "Blocked User" - creator_name: "Creator" - reason: "Reason for block" - status: "Status" - revoker_name: "Revoked by" - not_revoked: "(not revoked)" - showing_page: "Page %{page}" - next: "Next »" - previous: "« Previous" helper: time_future: "Ends in %{time}." until_login: "Active until the user logs in." @@ -2202,6 +2188,21 @@ en: back: "View all blocks" revoker: "Revoker:" needs_view: "The user needs to log in before this block will be cleared." + user_blocks: + block: + not_revoked: "(not revoked)" + show: "Show" + edit: "Edit" + revoke: "Revoke!" + blocks: + display_name: "Blocked User" + creator_name: "Creator" + reason: "Reason for block" + status: "Status" + revoker_name: "Revoked by" + showing_page: "Page %{page}" + next: "Next »" + previous: "« Previous" note: description: opened_at_html: "Created %{when} ago"
<%= t'user_block.partial.display_name' %><%= t '.display_name' %><%= t'user_block.partial.creator_name' %><%= t '.creator_name' %><%= t'user_block.partial.reason' %><%= t'user_block.partial.status' %><%= t'user_block.partial.revoker_name' %><%= t '.reason' %><%= t '.status' %><%= t '.revoker_name' %>