3 !https://secure.travis-ci.org/svenfuchs/i18n.png?branch=master(Build Status)!:http://travis-ci.org/svenfuchs/i18n
5 Ruby Internationalization and localization solution.
9 * translation and localization
10 * interpolation of values to translations (Ruby 1.9 compatible syntax)
11 * pluralization (CLDR compatible)
12 * customizable transliteration to ASCII
15 * lambdas as translation data
16 * custom key/scope separator
17 * custom exception handlers
18 * extensible architecture with a swappable backend
23 * Pluralization: lambda pluralizers stored as translation data
24 * Locale fallbacks, RFC4647 compliant (optionally: RFC4646 locale validation)
26 * Translation metadata
31 * ActiveRecord (optionally: ActiveRecord::Missing and ActiveRecord::StoreProcs)
32 * KeyValue (uses active_support/json and cannot store procs)
34 For more information and lots of resources see: "http://ruby-i18n.org/wiki":http://ruby-i18n.org/wiki
40 h4. Rails version warning
42 On Rails < 2.3.6 the method I18n.localize will fail with MissingInterpolationArgument (issue "20":http://github.com/svenfuchs/i18n/issues/issue/20). Upgrade to Rails 2.3.6 or higher (2.3.8 preferably) is recommended.
44 h3. Installation on Rails < 2.3.5 (deprecated)
46 Up to version 2.3.4 Rails will not accept i18n gems > 0.1.3. There is an unpacked
47 gem inside of active_support/lib/vendor which gets loaded unless gem 'i18n', '~> 0.1.3'.
48 This requirement is relaxed in "6da03653":http://github.com/rails/rails/commit/6da03653
50 The new i18n gem can be loaded from vendor/plugins like this:
54 raise "Move to i18n version 0.2.0 or greater" if Rails.version > "2.3.4"
56 $:.grep(/i18n/).each { |path| $:.delete(path) }
57 I18n::Backend.send :remove_const, "Simple"
58 $: << Rails.root.join('vendor', 'plugins', 'i18n', 'lib').to_s
62 Then you can `reload_i18n!` inside an i18n initializer.
66 You can run tests both with
68 * `rake test` or just `rake`
69 * run any test file directly, e.g. `ruby -Ilib -Itest test/api/simple_test.rb`
70 * run all tests with `ruby -Ilib -Itest test/all.rb`
72 You can run all tests against all Gemfiles with
74 * `ruby test/run_all.rb`
76 The structure of the test suite is a bit unusual as it uses modules to reuse
77 particular tests in different test cases.
79 The reason for this is that we need to enforce the I18n API across various
80 combinations of extensions. E.g. the Simple backend alone needs to support
81 the same API as any combination of feature and/or optimization modules included
82 to the Simple backend. We test this by reusing the same API defition (implemented
83 as test methods) in test cases with different setups.
85 You can find the test cases that enforce the API in test/api. And you can find
86 the API definition test methods in test/api/tests.
88 All other test cases (e.g. as defined in test/backend, test/core\_ext) etc.
89 follow the usual test setup and should be easy to grok.
93 * "Sven Fuchs":http://www.artweb-design.de
94 * "Joshua Harvey":http://www.workingwithrails.com/person/759-joshua-harvey
95 * "Stephan Soller":http://www.arkanis-development.de
96 * "Saimon Moore":http://saimonmoore.net
97 * "Matt Aimonetti":http://railsontherun.com
101 http://github.com/svenfuchs/i18n/contributors
105 MIT License. See the included MIT-LICENSE file.