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.1.0.dev.425 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.420 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.419 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.418 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.417 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.416 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.415 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.414 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.413 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.412 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.411 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.410 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.409 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.407 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.408 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.398 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.397 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.396 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.0.0.dev.395 lib/lalala/ext_i18n/name_for_locale.rb
lalala-4.1.0.dev.394 lib/lalala/ext_i18n/name_for_locale.rb