i18n 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of i18n might be problematic. Click here for more details.

Files changed (58) hide show
  1. checksums.yaml +15 -0
  2. data/CHANGELOG.textile +12 -3
  3. data/README.textile +4 -17
  4. data/lib/i18n.rb +5 -9
  5. data/lib/i18n/backend.rb +0 -1
  6. data/lib/i18n/backend/base.rb +4 -32
  7. data/lib/i18n/backend/gettext.rb +3 -3
  8. data/lib/i18n/backend/interpolation_compiler.rb +1 -1
  9. data/lib/i18n/backend/metadata.rb +1 -1
  10. data/lib/i18n/config.rb +1 -1
  11. data/lib/i18n/core_ext/kernel/surpress_warnings.rb +9 -0
  12. data/lib/i18n/core_ext/string/interpolate.rb +9 -0
  13. data/lib/i18n/exceptions.rb +1 -7
  14. data/lib/i18n/interpolate/ruby.rb +31 -0
  15. data/lib/i18n/locale/fallbacks.rb +3 -3
  16. data/lib/i18n/tests/localization/procs.rb +27 -26
  17. data/lib/i18n/version.rb +1 -1
  18. data/test/all.rb +8 -0
  19. data/test/api/all_features_test.rb +58 -0
  20. data/test/api/cascade_test.rb +28 -0
  21. data/test/api/chain_test.rb +24 -0
  22. data/test/api/fallbacks_test.rb +30 -0
  23. data/test/api/key_value_test.rb +28 -0
  24. data/test/api/memoize_test.rb +60 -0
  25. data/test/api/pluralization_test.rb +30 -0
  26. data/test/api/simple_test.rb +28 -0
  27. data/test/backend/cache_test.rb +83 -0
  28. data/test/backend/cascade_test.rb +85 -0
  29. data/test/backend/chain_test.rb +67 -0
  30. data/test/backend/exceptions_test.rb +23 -0
  31. data/test/backend/fallbacks_test.rb +116 -0
  32. data/test/backend/interpolation_compiler_test.rb +102 -0
  33. data/test/backend/key_value_test.rb +46 -0
  34. data/test/backend/memoize_test.rb +47 -0
  35. data/test/backend/metadata_test.rb +67 -0
  36. data/test/backend/pluralization_test.rb +44 -0
  37. data/test/backend/simple_test.rb +79 -0
  38. data/test/backend/transliterator_test.rb +81 -0
  39. data/test/core_ext/hash_test.rb +30 -0
  40. data/test/core_ext/string/interpolate_test.rb +99 -0
  41. data/test/gettext/api_test.rb +206 -0
  42. data/test/gettext/backend_test.rb +93 -0
  43. data/test/i18n/exceptions_test.rb +120 -0
  44. data/test/i18n/interpolate_test.rb +61 -0
  45. data/test/i18n/load_path_test.rb +26 -0
  46. data/test/i18n_test.rb +323 -0
  47. data/test/locale/fallbacks_test.rb +124 -0
  48. data/test/locale/tag/rfc4646_test.rb +142 -0
  49. data/test/locale/tag/simple_test.rb +32 -0
  50. data/test/run_all.rb +21 -0
  51. data/test/test_data/locales/de.po +72 -0
  52. data/test/test_data/locales/en.rb +3 -0
  53. data/test/test_data/locales/en.yml +3 -0
  54. data/test/test_data/locales/invalid/empty.yml +0 -0
  55. data/test/test_data/locales/plurals.rb +113 -0
  56. data/test/test_helper.rb +56 -0
  57. metadata +64 -48
  58. data/lib/i18n/backend/cldr.rb +0 -99
@@ -0,0 +1,124 @@
1
+ require 'test_helper'
2
+
3
+ include I18n::Locale
4
+
5
+ class I18nFallbacksDefaultsTest < Test::Unit::TestCase
6
+ def teardown
7
+ I18n.default_locale = :en
8
+ end
9
+
10
+ test "defaults reflect the I18n.default_locale if no default has been set manually" do
11
+ I18n.default_locale = :'en-US'
12
+ fallbacks = Fallbacks.new
13
+ assert_equal [:'en-US', :en], fallbacks.defaults
14
+ end
15
+
16
+ test "defaults reflect a manually passed default locale if any" do
17
+ fallbacks = Fallbacks.new(:'fi-FI')
18
+ assert_equal [:'fi-FI', :fi], fallbacks.defaults
19
+ I18n.default_locale = :'de-DE'
20
+ assert_equal [:'fi-FI', :fi], fallbacks.defaults
21
+ end
22
+
23
+ test "defaults allows to set multiple defaults" do
24
+ fallbacks = Fallbacks.new(:'fi-FI', :'se-FI')
25
+ assert_equal [:'fi-FI', :fi, :'se-FI', :se], fallbacks.defaults
26
+ end
27
+ end
28
+
29
+ class I18nFallbacksComputationTest < Test::Unit::TestCase
30
+ def setup
31
+ @fallbacks = Fallbacks.new(:'en-US')
32
+ end
33
+
34
+ test "with no mappings defined it returns [:es, :en-US] for :es" do
35
+ assert_equal [:es, :"en-US", :en], @fallbacks[:es]
36
+ end
37
+
38
+ test "with no mappings defined it returns [:es-ES, :es, :en-US] for :es-ES" do
39
+ assert_equal [:"es-ES", :es, :"en-US", :en], @fallbacks[:"es-ES"]
40
+ end
41
+
42
+ test "with no mappings defined it returns [:es-MX, :es, :en-US] for :es-MX" do
43
+ assert_equal [:"es-MX", :es, :"en-US", :en], @fallbacks[:"es-MX"]
44
+ end
45
+
46
+ test "with no mappings defined it returns [:es-Latn-ES, :es-Latn, :es, :en-US] for :es-Latn-ES" do
47
+ assert_equal [:"es-Latn-ES", :"es-Latn", :es, :"en-US", :en], @fallbacks[:'es-Latn-ES']
48
+ end
49
+
50
+ test "with no mappings defined it returns [:en, :en-US] for :en" do
51
+ assert_equal [:en, :"en-US"], @fallbacks[:en]
52
+ end
53
+
54
+ test "with no mappings defined it returns [:en-US, :en] for :en-US (special case: locale == default)" do
55
+ assert_equal [:"en-US", :en], @fallbacks[:"en-US"]
56
+ end
57
+
58
+ # Most people who speak Catalan also live in Spain, so it is safe to assume
59
+ # that they also speak Spanish as spoken in Spain.
60
+ test "with a Catalan mapping defined it returns [:ca, :es-ES, :es, :en-US] for :ca" do
61
+ @fallbacks.map(:ca => :"es-ES")
62
+ assert_equal [:ca, :"es-ES", :es, :"en-US", :en], @fallbacks[:ca]
63
+ end
64
+
65
+ test "with a Catalan mapping defined it returns [:ca-ES, :ca, :es-ES, :es, :en-US] for :ca-ES" do
66
+ @fallbacks.map(:ca => :"es-ES")
67
+ assert_equal [:"ca-ES", :ca, :"es-ES", :es, :"en-US", :en], @fallbacks[:"ca-ES"]
68
+ end
69
+
70
+ # People who speak Arabic as spoken in Palestine often times also speak
71
+ # Hebrew as spoken in Israel. However it is in no way safe to assume that
72
+ # everybody who speaks Arabic also speaks Hebrew.
73
+
74
+ test "with a Hebrew mapping defined it returns [:ar, :en-US] for :ar" do
75
+ @fallbacks.map(:"ar-PS" => :"he-IL")
76
+ assert_equal [:ar, :"en-US", :en], @fallbacks[:ar]
77
+ end
78
+
79
+ test "with a Hebrew mapping defined it returns [:ar-EG, :ar, :en-US] for :ar-EG" do
80
+ @fallbacks.map(:"ar-PS" => :"he-IL")
81
+ assert_equal [:"ar-EG", :ar, :"en-US", :en], @fallbacks[:"ar-EG"]
82
+ end
83
+
84
+ test "with a Hebrew mapping defined it returns [:ar-PS, :ar, :he-IL, :he, :en-US] for :ar-PS" do
85
+ @fallbacks.map(:"ar-PS" => :"he-IL")
86
+ assert_equal [:"ar-PS", :ar, :"he-IL", :he, :"en-US", :en], @fallbacks[:"ar-PS"]
87
+ end
88
+
89
+ # Sami people live in several scandinavian countries. In Finnland many people
90
+ # know Swedish and Finnish. Thus, it can be assumed that Sami living in
91
+ # Finnland also speak Swedish and Finnish.
92
+
93
+ test "with a Sami mapping defined it returns [:sms-FI, :sms, :se-FI, :se, :fi-FI, :fi, :en-US] for :sms-FI" do
94
+ @fallbacks.map(:sms => [:"se-FI", :"fi-FI"])
95
+ assert_equal [:"sms-FI", :sms, :"se-FI", :se, :"fi-FI", :fi, :"en-US", :en], @fallbacks[:"sms-FI"]
96
+ end
97
+
98
+ # Austrian people understand German as spoken in Germany
99
+
100
+ test "with a German mapping defined it returns [:de, :en-US] for de" do
101
+ @fallbacks.map(:"de-AT" => :"de-DE")
102
+ assert_equal [:de, :"en-US", :en], @fallbacks[:"de"]
103
+ end
104
+
105
+ test "with a German mapping defined it returns [:de-DE, :de, :en-US] for de-DE" do
106
+ @fallbacks.map(:"de-AT" => :"de-DE")
107
+ assert_equal [:"de-DE", :de, :"en-US", :en], @fallbacks[:"de-DE"]
108
+ end
109
+
110
+ test "with a German mapping defined it returns [:de-AT, :de, :de-DE, :en-US] for de-AT" do
111
+ @fallbacks.map(:"de-AT" => :"de-DE")
112
+ assert_equal [:"de-AT", :de, :"de-DE", :"en-US", :en], @fallbacks[:"de-AT"]
113
+ end
114
+
115
+ # Mapping :de => :en, :he => :en
116
+
117
+ test "with a mapping :de => :en, :he => :en defined it returns [:de, :en] for :de" do
118
+ assert_equal [:de, :"en-US", :en], @fallbacks[:de]
119
+ end
120
+
121
+ test "with a mapping :de => :en, :he => :en defined it [:he, :en] for :de" do
122
+ assert_equal [:he, :"en-US", :en], @fallbacks[:he]
123
+ end
124
+ end
@@ -0,0 +1,142 @@
1
+ # encoding: utf-8
2
+ require 'test_helper'
3
+
4
+ class I18nLocaleTagRfc4646ParserTest < Test::Unit::TestCase
5
+ include I18n::Locale
6
+
7
+ test "Rfc4646::Parser given a valid tag 'de' returns an array of subtags" do
8
+ assert_equal ['de', nil, nil, nil, nil, nil, nil], Tag::Rfc4646::Parser.match('de')
9
+ end
10
+
11
+ test "Rfc4646::Parser given a valid tag 'de-DE' returns an array of subtags" do
12
+ assert_equal ['de', nil, 'DE', nil, nil, nil, nil], Tag::Rfc4646::Parser.match('de-DE')
13
+ end
14
+
15
+ test "Rfc4646::Parser given a valid lowercase tag 'de-latn-de-variant-x-phonebk' returns an array of subtags" do
16
+ assert_equal ['de', 'latn', 'de', 'variant', nil, 'x-phonebk', nil], Tag::Rfc4646::Parser.match('de-latn-de-variant-x-phonebk')
17
+ end
18
+
19
+ test "Rfc4646::Parser given a valid uppercase tag 'DE-LATN-DE-VARIANT-X-PHONEBK' returns an array of subtags" do
20
+ assert_equal ['DE', 'LATN', 'DE', 'VARIANT', nil, 'X-PHONEBK', nil], Tag::Rfc4646::Parser.match('DE-LATN-DE-VARIANT-X-PHONEBK')
21
+ end
22
+
23
+ test "Rfc4646::Parser given an invalid tag 'a-DE' it returns false" do
24
+ assert_equal false, Tag::Rfc4646::Parser.match('a-DE')
25
+ end
26
+
27
+ test "Rfc4646::Parser given an invalid tag 'de-419-DE' it returns false" do
28
+ assert_equal false, Tag::Rfc4646::Parser.match('de-419-DE')
29
+ end
30
+ end
31
+
32
+ # Tag for the locale 'de-Latn-DE-Variant-a-ext-x-phonebk-i-klingon'
33
+
34
+ class I18nLocaleTagSubtagsTest < Test::Unit::TestCase
35
+ include I18n::Locale
36
+
37
+ def setup
38
+ subtags = %w(de Latn DE variant a-ext x-phonebk i-klingon)
39
+ @tag = Tag::Rfc4646.new(*subtags)
40
+ end
41
+
42
+ test "returns 'de' as the language subtag in lowercase" do
43
+ assert_equal 'de', @tag.language
44
+ end
45
+
46
+ test "returns 'Latn' as the script subtag in titlecase" do
47
+ assert_equal 'Latn', @tag.script
48
+ end
49
+
50
+ test "returns 'DE' as the region subtag in uppercase" do
51
+ assert_equal 'DE', @tag.region
52
+ end
53
+
54
+ test "returns 'variant' as the variant subtag in lowercase" do
55
+ assert_equal 'variant', @tag.variant
56
+ end
57
+
58
+ test "returns 'a-ext' as the extension subtag" do
59
+ assert_equal 'a-ext', @tag.extension
60
+ end
61
+
62
+ test "returns 'x-phonebk' as the privateuse subtag" do
63
+ assert_equal 'x-phonebk', @tag.privateuse
64
+ end
65
+
66
+ test "returns 'i-klingon' as the grandfathered subtag" do
67
+ assert_equal 'i-klingon', @tag.grandfathered
68
+ end
69
+
70
+ test "returns a formatted tag string from #to_s" do
71
+ assert_equal 'de-Latn-DE-variant-a-ext-x-phonebk-i-klingon', @tag.to_s
72
+ end
73
+
74
+ test "returns an array containing the formatted subtags from #to_a" do
75
+ assert_equal %w(de Latn DE variant a-ext x-phonebk i-klingon), @tag.to_a
76
+ end
77
+ end
78
+
79
+ # Tag inheritance
80
+
81
+ class I18nLocaleTagSubtagsTest < Test::Unit::TestCase
82
+ test "#parent returns 'de-Latn-DE-variant-a-ext-x-phonebk' as the parent of 'de-Latn-DE-variant-a-ext-x-phonebk-i-klingon'" do
83
+ tag = Tag::Rfc4646.new(*%w(de Latn DE variant a-ext x-phonebk i-klingon))
84
+ assert_equal 'de-Latn-DE-variant-a-ext-x-phonebk', tag.parent.to_s
85
+ end
86
+
87
+ test "#parent returns 'de-Latn-DE-variant-a-ext' as the parent of 'de-Latn-DE-variant-a-ext-x-phonebk'" do
88
+ tag = Tag::Rfc4646.new(*%w(de Latn DE variant a-ext x-phonebk))
89
+ assert_equal 'de-Latn-DE-variant-a-ext', tag.parent.to_s
90
+ end
91
+
92
+ test "#parent returns 'de-Latn-DE-variant' as the parent of 'de-Latn-DE-variant-a-ext'" do
93
+ tag = Tag::Rfc4646.new(*%w(de Latn DE variant a-ext))
94
+ assert_equal 'de-Latn-DE-variant', tag.parent.to_s
95
+ end
96
+
97
+ test "#parent returns 'de-Latn-DE' as the parent of 'de-Latn-DE-variant'" do
98
+ tag = Tag::Rfc4646.new(*%w(de Latn DE variant))
99
+ assert_equal 'de-Latn-DE', tag.parent.to_s
100
+ end
101
+
102
+ test "#parent returns 'de-Latn' as the parent of 'de-Latn-DE'" do
103
+ tag = Tag::Rfc4646.new(*%w(de Latn DE))
104
+ assert_equal 'de-Latn', tag.parent.to_s
105
+ end
106
+
107
+ test "#parent returns 'de' as the parent of 'de-Latn'" do
108
+ tag = Tag::Rfc4646.new(*%w(de Latn))
109
+ assert_equal 'de', tag.parent.to_s
110
+ end
111
+
112
+ # TODO RFC4647 says: "If no language tag matches the request, the "default" value is returned."
113
+ # where should we set the default language?
114
+ # test "#parent returns '' as the parent of 'de'" do
115
+ # tag = Tag::Rfc4646.new *%w(de)
116
+ # assert_equal '', tag.parent.to_s
117
+ # end
118
+
119
+ test "#parent returns an array of 5 parents for 'de-Latn-DE-variant-a-ext-x-phonebk-i-klingon'" do
120
+ parents = %w(de-Latn-DE-variant-a-ext-x-phonebk-i-klingon
121
+ de-Latn-DE-variant-a-ext-x-phonebk
122
+ de-Latn-DE-variant-a-ext
123
+ de-Latn-DE-variant
124
+ de-Latn-DE
125
+ de-Latn
126
+ de)
127
+ tag = Tag::Rfc4646.new(*%w(de Latn DE variant a-ext x-phonebk i-klingon))
128
+ assert_equal parents, tag.self_and_parents.map(&:to_s)
129
+ end
130
+
131
+ test "returns an array of 5 parents for 'de-Latn-DE-variant-a-ext-x-phonebk-i-klingon'" do
132
+ parents = %w(de-Latn-DE-variant-a-ext-x-phonebk-i-klingon
133
+ de-Latn-DE-variant-a-ext-x-phonebk
134
+ de-Latn-DE-variant-a-ext
135
+ de-Latn-DE-variant
136
+ de-Latn-DE
137
+ de-Latn
138
+ de)
139
+ tag = Tag::Rfc4646.new(*%w(de Latn DE variant a-ext x-phonebk i-klingon))
140
+ assert_equal parents, tag.self_and_parents.map(&:to_s)
141
+ end
142
+ end
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+ require 'test_helper'
3
+
4
+ class I18nLocaleTagSimpleTest < Test::Unit::TestCase
5
+ include I18n::Locale
6
+
7
+ test "returns 'de' as the language subtag in lowercase" do
8
+ assert_equal %w(de Latn DE), Tag::Simple.new('de-Latn-DE').subtags
9
+ end
10
+
11
+ test "returns a formatted tag string from #to_s" do
12
+ assert_equal 'de-Latn-DE', Tag::Simple.new('de-Latn-DE').to_s
13
+ end
14
+
15
+ test "returns an array containing the formatted subtags from #to_a" do
16
+ assert_equal %w(de Latn DE), Tag::Simple.new('de-Latn-DE').to_a
17
+ end
18
+
19
+ # Tag inheritance
20
+
21
+ test "#parent returns 'de-Latn' as the parent of 'de-Latn-DE'" do
22
+ assert_equal 'de-Latn', Tag::Simple.new('de-Latn-DE').parent.to_s
23
+ end
24
+
25
+ test "#parent returns 'de' as the parent of 'de-Latn'" do
26
+ assert_equal 'de', Tag::Simple.new('de-Latn').parent.to_s
27
+ end
28
+
29
+ test "#self_and_parents returns an array of 3 tags for 'de-Latn-DE'" do
30
+ assert_equal %w(de-Latn-DE de-Latn de), Tag::Simple.new('de-Latn-DE').self_and_parents.map { |tag| tag.to_s}
31
+ end
32
+ end
@@ -0,0 +1,21 @@
1
+ def bundle_check
2
+ `bundle check` == "Resolving dependencies...\nThe Gemfile's dependencies are satisfied\n"
3
+ end
4
+
5
+ command = 'bundle exec ruby -w -Ilib -Itest test/all.rb'
6
+ gemfiles = %w(Gemfile) + Dir['gemfiles/Gemfile*'].reject { |f| f.end_with?('.lock') }
7
+
8
+ results = gemfiles.map do |gemfile|
9
+ puts "BUNDLE_GEMFILE=#{gemfile}"
10
+ ENV['BUNDLE_GEMFILE'] = File.expand_path("../../#{gemfile}", __FILE__)
11
+
12
+ unless bundle_check
13
+ puts "bundle install"
14
+ system('bundle install')
15
+ end
16
+
17
+ puts command
18
+ system command
19
+ end
20
+
21
+ exit(results.inject(true) { |a, b| a && b })
@@ -0,0 +1,72 @@
1
+ # SOME DESCRIPTIVE TITLE.
2
+ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+ # This file is distributed under the same license as the PACKAGE package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: version 0.0.1\n"
10
+ "POT-Creation-Date: 2009-02-26 19:50+0100\n"
11
+ "PO-Revision-Date: 2009-02-18 14:53+0100\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=UTF-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
+
19
+ # #: app/helpers/translation_helper.rb:3
20
+ # msgid "%{relative_time} ago"
21
+ # msgstr "vor %{relative_time}"
22
+
23
+ #: app/views/cars/show.html.erb:5
24
+ msgid "Axis"
25
+ msgid_plural "Axis"
26
+ msgstr[0] "Achse"
27
+ msgstr[1] "Achsen"
28
+
29
+ #: app/controllers/cars_controller.rb:47
30
+ msgid "Car was successfully created."
31
+ msgstr "Auto wurde erfolgreich gespeichert"
32
+
33
+ #: app/controllers/cars_controller.rb:64
34
+ msgid "Car was successfully updated."
35
+ msgstr "Auto wurde erfolgreich aktualisiert"
36
+
37
+ #: app/views/cars/show.html.erb:1 locale/model_attributes.rb:3
38
+ msgid "Car|Model"
39
+ msgstr "Modell"
40
+
41
+ #: app/views/cars/show.html.erb:3 locale/model_attributes.rb:4
42
+ msgid "Car|Wheels count"
43
+ msgstr "Räderzahl"
44
+
45
+ #: app/views/cars/show.html.erb:7
46
+ msgid "Created"
47
+ msgstr "Erstellt"
48
+
49
+ #: app/views/cars/show.html.erb:9
50
+ msgid "Month"
51
+ msgstr "Monat"
52
+
53
+ #: locale/model_attributes.rb:2
54
+ msgid "car"
55
+ msgstr "Auto"
56
+
57
+ #: locale/testlog_phrases.rb:2
58
+ msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
59
+ msgstr ""
60
+ "Dies ist eine dynamische Übersetzung, die durch gettext_test_log "
61
+ "gefunden wurde!"
62
+
63
+ #: app/views/cars/nowhere_really
64
+ msgid "Car|wheel"
65
+ msgid_plural "Car|wheels"
66
+ msgstr[0] "Rad"
67
+ msgstr[1] "Räder"
68
+
69
+ msgid "On %{count} wheel."
70
+ msgid_plural "On %{count} wheels."
71
+ msgstr[0] "Auf %{count} Achse."
72
+ msgstr[1] "Auf %{count} Achsen."
@@ -0,0 +1,3 @@
1
+ # encoding: utf-8
2
+
3
+ { :en => { :fuh => { :bah => "bas" } } }
@@ -0,0 +1,3 @@
1
+ en:
2
+ foo:
3
+ bar: baz
@@ -0,0 +1,113 @@
1
+ # encoding: utf-8
2
+
3
+ {
4
+ :af => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
5
+ :am => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
6
+ :ar => { :i18n => { :plural => { :keys => [:zero, :one, :two, :few, :many, :other], :rule => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : [3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99].include?(n % 100) ? :many : :other } } } },
7
+ :az => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
8
+ :be => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
9
+ :bg => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
10
+ :bh => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
11
+ :bn => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
12
+ :bo => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
13
+ :bs => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
14
+ :ca => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
15
+ :cs => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other } } } },
16
+ :cy => { :i18n => { :plural => { :keys => [:one, :two, :many, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : n == 8 || n == 11 ? :many : :other } } } },
17
+ :da => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
18
+ :de => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
19
+ :dz => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
20
+ :el => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
21
+ :en => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
22
+ :eo => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
23
+ :es => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
24
+ :et => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
25
+ :eu => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
26
+ :fa => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
27
+ :fi => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
28
+ :fil => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
29
+ :fo => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
30
+ :fr => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n && n != 2 ? :one : :other } } } },
31
+ :fur => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
32
+ :fy => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
33
+ :ga => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
34
+ :gl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
35
+ :gu => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
36
+ :guw => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
37
+ :ha => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
38
+ :he => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
39
+ :hi => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
40
+ :hr => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
41
+ :hu => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
42
+ :id => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
43
+ :is => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
44
+ :it => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
45
+ :iw => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
46
+ :ja => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
47
+ :jv => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
48
+ :ka => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
49
+ :km => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
50
+ :kn => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
51
+ :ko => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
52
+ :ku => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
53
+ :lb => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
54
+ :ln => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
55
+ :lt => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n % 10 == 1 && ![11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :one : [2, 3, 4, 5, 6, 7, 8, 9].include?(n % 10) && ![11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :few : :other } } } },
56
+ :lv => { :i18n => { :plural => { :keys => [:zero, :one, :other], :rule => lambda { |n| n == 0 ? :zero : n % 10 == 1 && n % 100 != 11 ? :one : :other } } } },
57
+ :mg => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
58
+ :mk => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n % 10 == 1 ? :one : :other } } } },
59
+ :ml => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
60
+ :mn => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
61
+ :mo => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } } },
62
+ :mr => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
63
+ :ms => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
64
+ :mt => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n == 1 ? :one : n == 0 || [2, 3, 4, 5, 6, 7, 8, 9, 10].include?(n % 100) ? :few : [11, 12, 13, 14, 15, 16, 17, 18, 19].include?(n % 100) ? :many : :other } } } },
65
+ :my => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
66
+ :nah => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
67
+ :nb => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
68
+ :ne => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
69
+ :nl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
70
+ :nn => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
71
+ :no => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
72
+ :nso => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
73
+ :om => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
74
+ :or => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
75
+ :pa => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
76
+ :pap => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
77
+ :pl => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) && ![22, 23, 24].include?(n % 100) ? :few : :other } } } },
78
+ :ps => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
79
+ :pt => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
80
+ :"pt-PT" => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
81
+ :ro => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } } },
82
+ :ru => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
83
+ :se => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
84
+ :sh => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
85
+ :sk => { :i18n => { :plural => { :keys => [:one, :few, :other], :rule => lambda { |n| n == 1 ? :one : [2, 3, 4].include?(n) ? :few : :other } } } },
86
+ :sl => { :i18n => { :plural => { :keys => [:one, :two, :few, :other], :rule => lambda { |n| n % 100 == 1 ? :one : n % 100 == 2 ? :two : [3, 4].include?(n % 100) ? :few : :other } } } },
87
+ :sma => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
88
+ :smi => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
89
+ :smj => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
90
+ :smn => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
91
+ :sms => { :i18n => { :plural => { :keys => [:one, :two, :other], :rule => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } } },
92
+ :so => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
93
+ :sq => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
94
+ :sr => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
95
+ :sv => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
96
+ :sw => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
97
+ :ta => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
98
+ :te => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
99
+ :th => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
100
+ :ti => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
101
+ :tk => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
102
+ :tl => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
103
+ :to => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
104
+ :tr => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
105
+ :uk => { :i18n => { :plural => { :keys => [:one, :few, :many, :other], :rule => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : [2, 3, 4].include?(n % 10) && ![12, 13, 14].include?(n % 100) ? :few : n % 10 == 0 || [5, 6, 7, 8, 9].include?(n % 10) || [11, 12, 13, 14].include?(n % 100) ? :many : :other } } } },
106
+ :ur => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } },
107
+ :vi => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
108
+ :wa => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| [0, 1].include?(n) ? :one : :other } } } },
109
+ :yo => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
110
+ :zh => { :i18n => { :plural => { :keys => [:other], :rule => lambda { |n| :other } } } },
111
+ :zu => { :i18n => { :plural => { :keys => [:one, :other], :rule => lambda { |n| n == 1 ? :one : :other } } } }
112
+ }
113
+