Module: Locomotive::TranslationsHelper

Defined in:
app/helpers/locomotive/translations_helper.rb

Instance Method Summary collapse

Instance Method Details

#untranslated_locales(site, translation) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/locomotive/translations_helper.rb', line 4

def untranslated_locales(site, translation)
  list = site.locales.inject([]) do |memo,locale|
    translation.values[locale].present? ? memo :  memo << I18n.t("locomotive.locales.#{locale}")
  end

  if list.empty?
    ''
  else
    haml_tag :span, :class => 'untranslated' do
      haml_tag :em, I18n.t('locomotive.translations.untranslated', :list => list.to_sentence)
    end
  end
end