57b79c10c9c155c32e9d6959e35f773fa0867d63
[packages/precise/mcollective.git] / lib / mcollective / vendor / i18n / README.textile
1 h1. Ruby I18n
2
3 !https://secure.travis-ci.org/svenfuchs/i18n.png?branch=master(Build Status)!:http://travis-ci.org/svenfuchs/i18n
4
5 Ruby Internationalization and localization solution.
6
7 Features:
8
9 * translation and localization
10 * interpolation of values to translations (Ruby 1.9 compatible syntax)
11 * pluralization (CLDR compatible)
12 * customizable transliteration to ASCII
13 * flexible defaults
14 * bulk lookup
15 * lambdas as translation data
16 * custom key/scope separator
17 * custom exception handlers
18 * extensible architecture with a swappable backend
19
20 Pluggable features:
21
22 * Cache
23 * Pluralization: lambda pluralizers stored as translation data
24 * Locale fallbacks, RFC4647 compliant (optionally: RFC4646 locale validation)
25 * Gettext support
26 * Translation metadata
27
28 Alternative backends:
29
30 * Chain
31 * ActiveRecord (optionally: ActiveRecord::Missing and ActiveRecord::StoreProcs)
32 * KeyValue (uses active_support/json and cannot store procs)
33
34 For more information and lots of resources see: "http://ruby-i18n.org/wiki":http://ruby-i18n.org/wiki
35
36 h2. Installation
37
38 gem install i18n
39
40 h4. Rails version warning
41
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.
43
44 h3. Installation on Rails < 2.3.5 (deprecated)
45
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
49
50 The new i18n gem can be loaded from vendor/plugins like this:
51
52 <pre>
53   def reload_i18n!
54     raise "Move to i18n version 0.2.0 or greater" if Rails.version > "2.3.4"
55
56     $:.grep(/i18n/).each { |path| $:.delete(path) }
57     I18n::Backend.send :remove_const, "Simple"
58     $: << Rails.root.join('vendor', 'plugins', 'i18n', 'lib').to_s
59   end
60 </pre>
61
62 Then you can `reload_i18n!` inside an i18n initializer.
63
64 h2. Tests
65
66 You can run tests both with
67
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`
71
72 You can run all tests against all Gemfiles with
73
74 * `ruby test/run_all.rb`
75
76 The structure of the test suite is a bit unusual as it uses modules to reuse
77 particular tests in different test cases.
78
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.
84
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.
87
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.
90
91 h2. Authors
92
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
98
99 h2. Contributors
100
101 http://github.com/svenfuchs/i18n/contributors
102
103 h2. License
104
105 MIT License. See the included MIT-LICENSE file.