0.0
No commit activity in last 3 years
No release in over 3 years
Localization of languages to a given language or its own language. All languages can be queried or imported in yaml-format.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
~> 0
~> 0
~> 0
 Project Readme

cdlr-languages

Status

https://travis-ci.org/fschaeffler/cldr-languages Build Status

Installation

gem install cldr-languages

Usage

require 'cldr'
require 'languages'
include Cldr
include Languages

# imports all available languages to the folder config/locales
import

# retrieves a list of available language codes
language_codes

# retrieves a hash of available language codes and language names in English
localized_languages

# retrieves a hash of available language codes and language name in German with fallback English
localized_languages(language: 'de')

# retrieves a hash of available language codes and language name in German with fallback French
localized_languages(language: 'de', :fallback 'fr')


# please be aware that a call with 'zxx' as language parameter is very expensive. perhaps it's better to import
# this localization and use the cached version.

# retrieves a hash of available language codes and language name localized to the language code with fallback English
localized_languages(language: 'zxx')

# retrieves a hash of available language codes and language name localized to the language code with fallback German
localized_languages(language: 'zxx', fallback: 'de')