Ruby I18n
Ruby Internationalization and localization solution.
Features:
- translation and localization
- interpolation of values to translations (Ruby 1.9 compatible syntax)
- pluralization (CLDR compatible)
- flexible defaults
- bulk lookup
- lambdas as translation data
- custom key/scope separator
- custom exception handlers
- extensible architecture with a swappable backend
Experimental, pluggable features:
- lambda pluralizers stored as translation data
- RFC4647 compliant locale fallbacks (with optional RFC4646 locale validation)
- backend cache
For more information and lots of resources see: http://rails-i18n.org/wiki
Fast backend
This fork includes a Fast
backend that optimizes for the most common lookups and makes them about 20x (for t(:'foo.bar.baz')
) or 6x (for t(:'foo.bar.baz', :a=>'A', :b=>'B')
) times faster than the original Simple
backend. The Fast
backend is slightly less memory efficient and is slower to reload!
, but should be a great choice for production environment.
Branches
2-3-stable branch is for the old I18n
gem shipped with Rails 2.3
master is for the current I18n
gem version
Usage
Clone the repo as a plugin into your Rails app.
# in initializer or enviroment.rb
I18n.backend = I18n::Backend::Fast.new
Authors
- Sven Fuchs
- Joshua Harvey
- Stephan Soller
- Saimon Moore
- Matt Aimonetti
- thedarkone (
Fast
backend)
License
MIT License. See the included MIT-LICENCE file.