Last active
December 25, 2015 00:19
-
-
Save glebm/6887030 to your computer and use it in GitHub Desktop.
i18n-tasks html report example
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
require 'i18n/tasks/base_task' | |
... | |
def i18n_status | |
task = I18n::Tasks::BaseTask.new | |
@missing = task.missing_keys | |
@unused = task.unused_keys | |
end | |
... |
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
h1 I18n report | |
- if @missing.present? | |
.panel.panel-default | |
.panel-heading: h3.panel-title #{@missing.length} missing keys | |
.panel-body: table.table.table-striped.table-condensed | |
thead: tr | |
- @missing[0].attr.keys.each do |key| | |
th = key.to_s.humanize | |
tbody | |
- @missing.each do |k| | |
tr | |
- k.attr.values.each do |value| | |
td = value | |
- else | |
p.alert.alert-success No translations missing | |
- if @unused.present? | |
.panel.panel-default | |
.panel-heading: h3.panel-title #{@unused.length} unused keys | |
.panel-body: table.table.table-striped.table-condensed | |
thead: tr | |
th Key | |
th Value | |
- @unused.each do |key| | |
tr | |
td = key.key | |
td = key.value | |
- else | |
p.alert.alert-success No unused translations |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment