Fix lazy i18n lookups for browse error pages

`I18n.t` doesn't support lazy lookups, whereas the equivalent
rails `t` helper does. The code can also be simplified to avoid the
lookup table.

Fixes 1877
This commit is contained in:
Andy Allan 2018-06-06 13:24:01 +08:00
parent 892c30aa8c
commit 25c2feaec9
2 changed files with 4 additions and 20 deletions

View file

@ -1,12 +1,4 @@
<%
browse_not_found_type = {
'node' => I18n.t('.type.node'),
'way' => I18n.t('.type.way'),
'relation' => I18n.t('.type.relation'),
'changeset' => I18n.t('.type.changeset'),
};
%>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t '.sorry', :type=> browse_not_found_type[@type] , :id => params[:id] %></h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t ".sorry", :type => t(".type.#{@type}"), :id => params[:id] %>
</h2>

View file

@ -1,12 +1,4 @@
<%
browse_timeout_type = {
'node' => I18n.t('.type.node'),
'way' => I18n.t('.type.way'),
'relation' => I18n.t('.type.relation'),
'changeset' => I18n.t('.type.changeset'),
};
%>
<div class="browse-section">
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= t '.sorry', :type=> browse_timeout_type[@type] , :id => params[:id] %>
<%= t '.sorry', :type => t(".type.#{@type}"), :id => params[:id] %>
</div>