Created
September 4, 2014 21:29
-
-
Save bdunagan/1deda73cd88c49866644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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