Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fschaeffler/cldr-languages
https://github.com/fschaeffler/cldr-languages
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/fschaeffler/cldr-languages
- Owner: fschaeffler
- License: mit
- Created: 2014-01-30T01:02:06.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-07T06:45:02.000Z (almost 11 years ago)
- Last Synced: 2024-12-23T20:24:22.656Z (14 days ago)
- Language: Ruby
- Size: 188 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cdlr-languages
==============
Status
------
https://travis-ci.org/fschaeffler/cldr-languages
[![Build Status](https://secure.travis-ci.org/fschaeffler/cldr-languages.png)](http://travis-ci.org/fschaeffler/cldr-languages)Installation
------------
gem install cldr-languagesUsage
-----
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')