Use lazy lookups for site translations

This commit is contained in:
Andy Allan 2018-04-25 16:04:34 +08:00
parent 4a9846b078
commit 8d45f1a5cf
3 changed files with 18 additions and 18 deletions

View file

@ -1,26 +1,26 @@
<h4 class='heading'><%= t "site.markdown_help.title_html" %></h4>
<h4 class='heading'><%= t ".title_html" %></h4>
<ul>
<li>
<h4><%= t "site.markdown_help.headings" %></h4>
<p># <%= t "site.markdown_help.heading" %><br>
## <%= t "site.markdown_help.subheading" %></p>
<h4><%= t ".headings" %></h4>
<p># <%= t ".heading" %><br>
## <%= t ".subheading" %></p>
</li>
<li>
<h4><%= t "site.markdown_help.unordered" %></h4>
<p>* <%= t "site.markdown_help.first" %><br>
* <%= t "site.markdown_help.second" %></p>
<h4><%= t ".unordered" %></h4>
<p>* <%= t ".first" %><br>
* <%= t ".second" %></p>
</li>
<li>
<h4><%= t "site.markdown_help.ordered" %></h4>
<p>1. <%= t "site.markdown_help.first" %><br>
2. <%= t "site.markdown_help.second" %></p>
<h4><%= t ".ordered" %></h4>
<p>1. <%= t ".first" %><br>
2. <%= t ".second" %></p>
</li>
<li>
<h4><%= t "site.markdown_help.link" %></h4>
<span>[<%= t "site.markdown_help.text" %>](<%= t "site.markdown_help.url" %>)</span>
<h4><%= t ".link" %></h4>
<span>[<%= t ".text" %>](<%= t ".url" %>)</span>
</li>
<li>
<h4><%= t "site.markdown_help.image" %></h4>
<span>![<%= t "site.markdown_help.alt" %>](<%= t "site.markdown_help.url" %>)</span>
<h4><%= t ".image" %></h4>
<span>![<%= t ".alt" %>](<%= t ".url" %>)</span>
</li>
</ul>

View file

@ -4,9 +4,9 @@
<% elsif STATUS == :database_readonly or STATUS == :api_readonly %>
<p><%= t 'layouts.osm_read_only' %></p>
<% elsif !current_user.data_public? %>
<p><%= t 'site.edit.not_public' %></p>
<p><%= raw t 'site.edit.not_public_description', :user_page => (link_to t('site.edit.user_page_link'), {:controller => 'user', :action => 'account', :display_name => current_user.display_name, :anchor => 'public'}) %></p>
<p><%= raw t 'site.edit.anon_edits', :link => link_to(t('site.edit.anon_edits_link_text'), t('site.edit.anon_edits_link')) %></p>
<p><%= t '.not_public' %></p>
<p><%= raw t '.not_public_description', :user_page => (link_to t('.user_page_link'), {:controller => 'user', :action => 'account', :display_name => current_user.display_name, :anchor => 'public'}) %></p>
<p><%= raw t 'site.edit.anon_edits', :link => link_to(t('.anon_edits_link_text'), t('.anon_edits_link')) %></p>
<% else %>
<%= render :partial => preferred_editor %>
<% end %>

View file

@ -7,7 +7,7 @@
<%= image_tag "key/#{name}/#{entry['image']}" %>
</td>
<td class="mapkey-table-value">
<%= [*t("site.key.table.entry.#{entry['name']}")].to_sentence %>
<%= [*t(".table.entry.#{entry['name']}")].to_sentence %>
</td>
</tr>
<% end %>