Sha256: fe999b2ba3aacdd8b0ab165785aa5c3c6337a09b07f1790a2be4181e93867bc5

Contents?: true

Size: 316 Bytes

Versions: 4

Compression:

Stored size: 316 Bytes

Contents

module Trestle
  module I18nHelper
    def i18n_fallbacks(locale=I18n.locale)
      if I18n.respond_to?(:fallbacks)
        I18n.fallbacks[locale]
      elsif locale.to_s.include?("-")
        fallback = locale.to_s.split("-").first
        [locale, fallback]
      else
        [locale]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.8.11 app/helpers/trestle/i18n_helper.rb
trestle-0.8.10 app/helpers/trestle/i18n_helper.rb
trestle-0.8.9 app/helpers/trestle/i18n_helper.rb
trestle-0.8.8 app/helpers/trestle/i18n_helper.rb