Sha256: 26b23cad34f15ad8b85017655dd00b75a3df188cdf5a9801bdde1286972d5d1c

Contents?: true

Size: 841 Bytes

Versions: 1

Compression:

Stored size: 841 Bytes

Contents

module Lolita
  module I18nHelper
    def locale_options
      ::I18n::available_locales.collect{|locale| 
        [::I18n.t(locale, :default => locale), locale] unless [::I18n.default_locale,@active_locale].include?(locale)
      }.compact.insert(0,[::I18n.t("lolita-i18n.choose-other-language", :default => "Choose other language"),""])
    end

    def show_translation key
      value = ::I18n.t(key, :locale => @active_locale, :default => '')
      unless value.blank?
        value
      else
        value = Lolita::I18n::GoogleTranslate.get_translation(@active_locale,key)
        unless value.blank?
          content_tag(:span, value, :class => "unapproved")
        end
      end
    end

    def is_untranslated key
      Lolita::I18n::GoogleTranslate.get_translation(@active_locale,key)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lolita-i18n-0.1.4 app/helpers/lolita/i18n_helper.rb