Sha256: b62a565b5fe13c78a15c1ec587e891b61c188539a5714def7ffc346b0290da7d

Contents?: true

Size: 224 Bytes

Versions: 98

Compression:

Stored size: 224 Bytes

Contents

module Lalala::ExtI18n::NameForLocale

  def self.name_for_locale(locale)
    I18n.backend.translate(locale, "i18n.languages.#{locale}", default: locale.to_s)
  rescue I18n::MissingTranslationData
    locale.to_s
  end

end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
lalala-4.0.0.dev.264 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.260 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.258 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.256 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.255 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.254 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.249 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.246 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.244 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.243 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.242 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.240 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.239 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.236 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.231 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.229 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.227 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.224 lib/lalala/ext_i18n/name_for_locale.rb