Module: I18n::MissingTranslation::Base
- Defined in:
- lib/translation_center/translation_helpers.rb
Instance Method Summary collapse
-
#html_message ⇒ Object
added another class to be used.
Instance Method Details
#html_message ⇒ Object
added another class to be used
114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/translation_center/translation_helpers.rb', line 114 def category = keys.first key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize } translation_key = keys # remove locale translation_key.shift translation_key = TranslationCenter::TranslationKey.find_by_name(translation_key.join('.')) # don't put the inspector class if inspector is off or the key belongs to translation_center if TranslationCenter::CONFIG['inspector'] == 'off' || category == 'translation_center' %(<span class="translation_missing" title="translation missing: #{keys.join('.')}">#{key}</span>) else %(<span class="translation_missing tc-inspector-key" data-locale='#{I18n.locale}' data-type="#{translation_key.status(I18n.locale)}" data-id="#{translation_key.id}" title="translation missing: #{keys.join('.')}">#{key}</span>) end end |