public
Description: Ruby-Locale is the pure ruby library which provides basic and general purpose APIs for localization.
Homepage: http://www.rubyforge.org/projects/locale
Clone URL: git://github.com/mutoh/locale.git
locale /
name age message
file COPYING Loading commit data...
file ChangeLog
file README.rdoc
file Rakefile Sun May 17 08:59:07 -0700 2009 Fixed to get wrong charset on Win32. [Repoterd ... [mutoh]
directory lib/
directory samples/ Sat Apr 25 12:07:46 -0700 2009 * locale/driver/cgi.rb: Add Locale.set_request.... [mutoh]
file setup.rb Tue Feb 17 06:17:41 -0800 2009 Move from svn(rubyforge.org). [mutoh]
directory test/
README.rdoc

Ruby-Locale

Ruby-Locale is the pure ruby library which provides basic and general purpose APIs for localization. It 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.
  • 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: ($ su)
     # gem install locale
    
  • tar-ball: Download tar-ball from rubyforge.org/projects/locale/ De-Compress archive and enter its top directory. Then type:
     ($ su)
     # ruby setup.rb
    

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 the file ‘COPYING’.)

  • locale/language.rb, locale/region.rb, locale/data/language.tab.gz, locale/data/region.tab.gz:
    • Copyright (C) 2006 Brian Pontarelli, Antonio Terceiro
    • Copyright (C) 2008 Masao Mutoh <mutomasa at gmail.com>
  • setup.rb version 3.4.1
    • Copyright (C) 2000-2005 Minero Aoki <aamine at loveruby.net>
    • This file is released under LGPL. See the top of the setup.rb.
  • Others(Some files are separated from Ruby-GetText-Package-1.92.0)
    • Copyright (C) 2008 Masao Mutoh <mutoh at highwhay.ne.jp>

References

Other libraries

Documents

Maintainer

Masao Mutoh <mutomasa at gmail.com>