Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# views/home/missing_keys.html.erb
<h1>Localization</h1>
<ul>
<li><%= link_to "Unlocalized", "#unlocalized" %></li>
<li><%= link_to "Localized", "#localized" %></li>
</ul>
<h2 id="unlocalized">Unlocalized: <%= @missing_keys.count %> missing out of <%= @missing_keys.count + @found_keys.count %></h2>
<ul style="list-style:none; line-height:22px; margin-left:-40px">
<% @missing_keys.each do |key, value| %>
<% # Default to :en for readability. %>
<% translation = value.include?(I18n.locale) ? t(key) : t(key, :locale => :en) %>
<li><strong><%= key %></strong> <span style="color:#666">[<%= value.join(",") %>]</span>: <%= translation %></li>
<% end %>
</ul>
<h2 id="localized">Localized: <%= @found_keys.count %> out of <%= @missing_keys.count + @found_keys.count %></h2>
<ul style="list-style:none; line-height:22px; margin-left:-40px">
<% @found_keys.each do |key| %>
<li><strong><%= key %></strong>: <%= t(key) %></li>
<% end %>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment