lib/i18n/tasks/reports/base.rb in i18n-tasks-0.2.20 vs lib/i18n/tasks/reports/base.rb in i18n-tasks-0.2.21
- old
+ new
@@ -25,9 +25,11 @@
def unused_title(recs)
"Unused keys (#{recs.length})"
end
def used_title(keys)
- "#{keys.length} keys used #{keys.map { |k| k[:usages].size }.reduce(:+)} times"
+ filter = keys.attr[:key_filter]
+ used_n = keys.map { |k| k[:usages].size }.reduce(:+).to_i
+ "#{keys.length} key#{'s' if keys.size != 1}#{" ~ '#{filter}'" if filter}#{" (#{used_n} usage#{'s' if used_n != 1})" if used_n > 0}"
end
end
end