Use lazy translation lookups for the user_blocks partials.

This commit is contained in:
Andy Allan 2018-04-18 14:20:41 +08:00
parent 30424e89d2
commit 736ff9b1a0
3 changed files with 29 additions and 28 deletions

View file

@ -11,14 +11,14 @@
<td class="<%= c1 %>"><%=h block_status(block) %></td>
<td class="<%= c1 %>">
<% 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 %>
</td>
<td class="<%= c1 %>"><%= link_to t('user_block.partial.show'), block %></td>
<td class="<%= c1 %>"><% 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 %></td>
<td class="<%= c1 %>"><%= link_to t('.show'), block %></td>
<td class="<%= c1 %>"><% if current_user and current_user.id == block.creator_id and block.active? %><%= link_to t('.edit'), edit_user_block_path(block) %><% end %></td>
<% if show_revoke_link %>
<td class="<%= c1 %>"><% if block.active? %><%= link_to t('user_block.partial.revoke'), :controller => 'user_blocks', :action => 'revoke', :id => block.id %><% end %></td>
<td class="<%= c1 %>"><% if block.active? %><%= link_to t('.revoke'), :controller => 'user_blocks', :action => 'revoke', :id => block.id %><% end %></td>
<% end %>
</tr>

View file

@ -1,14 +1,14 @@
<table id="block_list" cellpadding="3">
<tr>
<% if show_user_name %>
<th><%= t'user_block.partial.display_name' %></th>
<th><%= t '.display_name' %></th>
<% end %>
<% if show_creator_name %>
<th><%= t'user_block.partial.creator_name' %></th>
<th><%= t '.creator_name' %></th>
<% end %>
<th><%= t'user_block.partial.reason' %></th>
<th><%= t'user_block.partial.status' %></th>
<th><%= t'user_block.partial.revoker_name' %></th>
<th><%= t '.reason' %></th>
<th><%= t '.status' %></th>
<th><%= t '.revoker_name' %></th>
<th></th>
<th></th>
<% if show_revoke_link %>
@ -20,16 +20,16 @@
<ul class='secondary-actions'>
<% if @user_blocks_pages.current_page.number > 1 -%>
<li><%= link_to t('user_block.partial.previous'), @params.merge({ :page => @user_blocks_pages.current_page.number - 1 }) %></li>
<li><%= link_to t('.previous'), @params.merge({ :page => @user_blocks_pages.current_page.number - 1 }) %></li>
<% else -%>
<li><%= t('user_block.partial.previous') %></li>
<li><%= t('.previous') %></li>
<% end -%>
<li><%= t('user_block.partial.showing_page', :page => @user_blocks_pages.current_page.number) %></li>
<li><%= t('.showing_page', :page => @user_blocks_pages.current_page.number) %></li>
<% if @user_blocks_pages.current_page.number < @user_blocks_pages.page_count -%>
<li><%= link_to t('user_block.partial.next'), @params.merge({ :page => @user_blocks_pages.current_page.number + 1 }) %></li>
<li><%= link_to t('.next'), @params.merge({ :page => @user_blocks_pages.current_page.number + 1 }) %></li>
<% else -%>
<li><%= t('user_block.partial.next') %></li>
<li><%= t('.next') %></li>
<% end -%>
</ul>