Skip to content

Instantly share code, notes, and snippets.

@bdunagan
Created September 4, 2014 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdunagan/1deda73cd88c49866644 to your computer and use it in GitHub Desktop.
Save bdunagan/1deda73cd88c49866644 to your computer and use it in GitHub Desktop.
# 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