Sha256: 201df7677944b41e2710fc73b6d79d1d3808b573a6d48d22963fdef0f5411bf1
Contents?: true
Size: 819 Bytes
Versions: 2
Compression:
Stored size: 819 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lolita-i18n-0.1.18 | app/helpers/lolita/i18n_helper.rb |
lolita-i18n-0.2.0 | app/helpers/lolita/i18n_helper.rb |