Giter VIP home page Giter VIP logo

locale's Introduction

locale - locale for Ruby

Locale gem is the pure ruby library which provides basic and general purpose APIs for localization.

This library was called as “Ruby-Locale”. Since 2.0.6, this library is called just “locale”. You can call this library as “locale gem” or “Ruby Locale” to distinguish from other “locale”s.

This library aims to support all environments which Ruby works and all kind of programs (GUI, WWW, library, etc), and becomes the hub of other i18n/l10n libs/apps to handle major locale ID standards.

  • Manage Locale ID(Language Tag)

    • Each thread has a Locale ID.

    • POSIX, CLDR, IETF(RFC4646, 3066(BCP47)), Win32 and Java language tags and convert the tag string to each other.

    • Auto detect Locale ID. POSIX(Unix/Linux/*BSD), Win32, JRuby, CGI(CGI, Rack, others).

  • Resources

    • ISO 639-3 languages

    • ISO 3166 region(countries).

  • Support Ruby 1.8.7, Ruby 1.9.1, JRuby 1.1.4. Tested on Win32 and Linux.

Website

Requirements

Install

% gem install locale

The simplest usage

require 'rubygems'
require 'locale'

p Locale.candidates

APIs

The most important APIs are defined in Locale module.

  • Locale.candidates - Returns the current locale candidates.

  • Locale.current= - Sets the current locale(in a thread).

  • Locale.default= - Sets the default locale(in the whole program).

  • Locale.set_app_language_tags - Sets the locale that is supported by the App.

License

This program is licenced under the same licence as Ruby(See COPYING) or LGPL(Lesser General Public License: www.gnu.org/licenses/lgpl-3.0.txt).

  • locale/language.rb, locale/region.rb, locale/data/language.tab.gz, locale/data/region.tab.gz:

    • Copyright © 2006 Brian Pontarelli, Antonio Terceiro

    • Copyright © 2008,2009 Masao Mutoh <mutomasa at gmail.com>

  • Others(Some files are separated from Ruby-GetText-Package-1.92.0)

    • Copyright © 2008,2009 Masao Mutoh <mutoh at highwhay.ne.jp>

References

Other libraries

Documents

Maintainer

Active

Kouhei Sutou <[email protected]>

Inactive

Masao Mutoh <mutomasa at gmail.com>

locale's People

Contributors

kou avatar mutoh avatar pupeno avatar sakuro avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.