pepe-i18n 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. data/CHANGELOG.textile +57 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.textile +42 -0
  4. data/Rakefile +21 -0
  5. data/VERSION +1 -0
  6. data/lib/i18n.rb +270 -0
  7. data/lib/i18n/backend/base.rb +251 -0
  8. data/lib/i18n/backend/cache.rb +71 -0
  9. data/lib/i18n/backend/chain.rb +64 -0
  10. data/lib/i18n/backend/fallbacks.rb +53 -0
  11. data/lib/i18n/backend/gettext.rb +65 -0
  12. data/lib/i18n/backend/pluralization.rb +56 -0
  13. data/lib/i18n/backend/simple.rb +23 -0
  14. data/lib/i18n/exceptions.rb +61 -0
  15. data/lib/i18n/gettext.rb +25 -0
  16. data/lib/i18n/helpers/gettext.rb +35 -0
  17. data/lib/i18n/locale/fallbacks.rb +100 -0
  18. data/lib/i18n/locale/tag.rb +27 -0
  19. data/lib/i18n/locale/tag/parents.rb +24 -0
  20. data/lib/i18n/locale/tag/rfc4646.rb +78 -0
  21. data/lib/i18n/locale/tag/simple.rb +44 -0
  22. data/lib/i18n/string.rb +95 -0
  23. data/test/all.rb +5 -0
  24. data/test/api/basics.rb +15 -0
  25. data/test/api/interpolation.rb +85 -0
  26. data/test/api/lambda.rb +52 -0
  27. data/test/api/link.rb +47 -0
  28. data/test/api/localization/date.rb +65 -0
  29. data/test/api/localization/date_time.rb +63 -0
  30. data/test/api/localization/lambda.rb +26 -0
  31. data/test/api/localization/time.rb +63 -0
  32. data/test/api/pluralization.rb +37 -0
  33. data/test/api/translation.rb +51 -0
  34. data/test/backend/cache/cache_test.rb +57 -0
  35. data/test/backend/chain/api_test.rb +80 -0
  36. data/test/backend/chain/chain_test.rb +64 -0
  37. data/test/backend/fallbacks/api_test.rb +79 -0
  38. data/test/backend/fallbacks/fallbacks_test.rb +29 -0
  39. data/test/backend/pluralization/api_test.rb +81 -0
  40. data/test/backend/pluralization/pluralization_test.rb +39 -0
  41. data/test/backend/simple/all.rb +5 -0
  42. data/test/backend/simple/api_test.rb +90 -0
  43. data/test/backend/simple/lookup_test.rb +24 -0
  44. data/test/backend/simple/setup.rb +147 -0
  45. data/test/backend/simple/translations_test.rb +89 -0
  46. data/test/fixtures/locales/de.po +61 -0
  47. data/test/fixtures/locales/en.rb +3 -0
  48. data/test/fixtures/locales/en.yml +3 -0
  49. data/test/fixtures/locales/plurals.rb +112 -0
  50. data/test/gettext/api_test.rb +78 -0
  51. data/test/gettext/backend_test.rb +35 -0
  52. data/test/i18n_exceptions_test.rb +97 -0
  53. data/test/i18n_load_path_test.rb +23 -0
  54. data/test/i18n_test.rb +163 -0
  55. data/test/locale/fallbacks_test.rb +128 -0
  56. data/test/locale/tag/rfc4646_test.rb +147 -0
  57. data/test/locale/tag/simple_test.rb +35 -0
  58. data/test/string_test.rb +94 -0
  59. data/test/test_helper.rb +71 -0
  60. data/test/with_options.rb +34 -0
  61. metadata +151 -0
@@ -0,0 +1,24 @@
1
+ # encoding: utf-8
2
+
3
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
4
+
5
+ class I18nSimpleBackendLookupTest < Test::Unit::TestCase
6
+ include Tests::Backend::Simple::Setup::Base
7
+
8
+ # useful because this way we can use the backend with no key for interpolation/pluralization
9
+ def test_lookup_given_nil_as_a_key_returns_nil
10
+ assert_nil I18n.backend.send(:lookup, :en, nil)
11
+ end
12
+
13
+ def test_lookup_given_nested_keys_looks_up_a_nested_hash_value
14
+ assert_equal 'bar', I18n.backend.send(:lookup, :en, :bar, [:foo])
15
+ end
16
+
17
+ def test_lookup_using_a_custom_separator
18
+ assert_equal 'bar', I18n.backend.send(:lookup, :en, 'foo|bar', [], '|')
19
+ end
20
+
21
+ def test_default_using_a_custom_separator
22
+ assert_equal 'bar', I18n.backend.send(:default, :en, :'does_not_exist', :'foo|bar', :separator => '|')
23
+ end
24
+ end
@@ -0,0 +1,147 @@
1
+ # encoding: utf-8
2
+
3
+ module Tests
4
+ module Backend
5
+ module Simple
6
+ module Setup
7
+ module Base
8
+ def setup
9
+ super
10
+ I18n.locale = nil
11
+ I18n.default_locale = :en
12
+ I18n.backend = I18n::Backend::Simple.new
13
+ backend_store_translations :en, :foo => {:bar => 'bar', :baz => 'baz'}
14
+ end
15
+
16
+ def teardown
17
+ super
18
+ I18n.load_path = []
19
+ I18n.backend = nil
20
+ end
21
+ end
22
+
23
+ module Localization
24
+ include Base
25
+
26
+ def setup
27
+ super
28
+ setup_datetime_translations
29
+ setup_datetime_lambda_translations
30
+ @old_timezone, ENV['TZ'] = ENV['TZ'], 'UTC'
31
+ end
32
+
33
+ def teardown
34
+ super
35
+ @old_timezone ? ENV['TZ'] = @old_timezone : ENV.delete('TZ')
36
+ end
37
+
38
+ def setup_datetime_translations
39
+ backend_store_translations :de, {
40
+ :date => {
41
+ :formats => {
42
+ :default => "%d.%m.%Y",
43
+ :short => "%d. %b",
44
+ :long => "%d. %B %Y",
45
+ :long_ordinalized => lambda { |date, options|
46
+ tz = " (#{options[:timezone]})" if options[:timezone]
47
+ "#{date.day}ter %B %Y#{tz}"
48
+ }
49
+ },
50
+ :day_names => %w(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag),
51
+ :abbr_day_names => %w(So Mo Di Mi Do Fr Sa),
52
+ :month_names => %w(Januar Februar März April Mai Juni Juli August September Oktober November Dezember).unshift(nil),
53
+ :abbr_month_names => %w(Jan Feb Mar Apr Mai Jun Jul Aug Sep Okt Nov Dez).unshift(nil),
54
+ :order => [:day, :month, :year]
55
+ },
56
+ :time => {
57
+ :formats => {
58
+ :default => "%a, %d. %b %Y %H:%M:%S %z",
59
+ :short => "%d. %b %H:%M",
60
+ :long => "%d. %B %Y %H:%M",
61
+ :long_ordinalized => lambda { |date, options|
62
+ tz = " (#{options[:timezone]})" if options[:timezone]
63
+ "#{date.day}ter %B %Y, %H:%M Uhr#{tz}"
64
+ }
65
+ },
66
+ :am => 'am',
67
+ :pm => 'pm'
68
+ },
69
+ :datetime => {
70
+ :distance_in_words => {
71
+ :half_a_minute => 'half a minute',
72
+ :less_than_x_seconds => {
73
+ :one => 'less than 1 second',
74
+ :other => 'less than {{count}} seconds'
75
+ },
76
+ :x_seconds => {
77
+ :one => '1 second',
78
+ :other => '{{count}} seconds'
79
+ },
80
+ :less_than_x_minutes => {
81
+ :one => 'less than a minute',
82
+ :other => 'less than {{count}} minutes'
83
+ },
84
+ :x_minutes => {
85
+ :one => '1 minute',
86
+ :other => '{{count}} minutes'
87
+ },
88
+ :about_x_hours => {
89
+ :one => 'about 1 hour',
90
+ :other => 'about {{count}} hours'
91
+ },
92
+ :x_days => {
93
+ :one => '1 day',
94
+ :other => '{{count}} days'
95
+ },
96
+ :about_x_months => {
97
+ :one => 'about 1 month',
98
+ :other => 'about {{count}} months'
99
+ },
100
+ :x_months => {
101
+ :one => '1 month',
102
+ :other => '{{count}} months'
103
+ },
104
+ :about_x_years => {
105
+ :one => 'about 1 year',
106
+ :other => 'about {{count}} year'
107
+ },
108
+ :over_x_years => {
109
+ :one => 'over 1 year',
110
+ :other => 'over {{count}} years'
111
+ }
112
+ }
113
+ }
114
+ }
115
+ end
116
+
117
+ def setup_datetime_lambda_translations
118
+ backend_store_translations 'ru', {
119
+ :date => {
120
+ :'day_names' => lambda { |key, options|
121
+ (options[:format] =~ /^%A/) ?
122
+ %w(Воскресенье Понедельник Вторник Среда Четверг Пятница Суббота) :
123
+ %w(воскресенье понедельник вторник среда четверг пятница суббота)
124
+ },
125
+ :'abbr_day_names' => %w(Вс Пн Вт Ср Чт Пт Сб),
126
+ :'month_names' => lambda { |key, options|
127
+ (options[:format] =~ /(%d|%e)(\s*)?(%B)/) ?
128
+ %w(января февраля марта апреля мая июня июля августа сентября октября ноября декабря).unshift(nil) :
129
+ %w(Январь Февраль Март Апрель Май Июнь Июль Август Сентябрь Октябрь Ноябрь Декабрь).unshift(nil)
130
+ },
131
+ :'abbr_month_names' => lambda { |key, options|
132
+ (options[:format] =~ /(%d|%e)(\s*)(%b)/) ?
133
+ %w(янв. февр. марта апр. мая июня июля авг. сент. окт. нояб. дек.).unshift(nil) :
134
+ %w(янв. февр. март апр. май июнь июль авг. сент. окт. нояб. дек.).unshift(nil)
135
+ },
136
+ },
137
+ :time => {
138
+ :am => "утра",
139
+ :pm => "вечера"
140
+ }
141
+ }
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,89 @@
1
+ # encoding: utf-8
2
+
3
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
4
+
5
+ class I18nSimpleBackendLoadTranslationsTest < Test::Unit::TestCase
6
+ include Tests::Backend::Simple::Setup::Base
7
+
8
+ def test_load_translations_with_unknown_file_type_raises_exception
9
+ assert_raises(I18n::UnknownFileType) { I18n.backend.load_translations "#{locales_dir}/en.xml" }
10
+ end
11
+
12
+ def test_load_translations_with_ruby_file_type_does_not_raise_exception
13
+ assert_nothing_raised { I18n.backend.load_translations "#{locales_dir}/en.rb" }
14
+ end
15
+
16
+ def test_load_rb_loads_data_from_ruby_file
17
+ data = I18n.backend.send :load_rb, "#{locales_dir}/en.rb"
18
+ assert_equal({ :en => { :fuh => { :bah => 'bas' } } }, data)
19
+ end
20
+
21
+ def test_load_rb_loads_data_from_yaml_file
22
+ data = I18n.backend.send :load_yml, "#{locales_dir}/en.yml"
23
+ assert_equal({ 'en' => { 'foo' => { 'bar' => 'baz' } } }, data)
24
+ end
25
+
26
+ def test_load_translations_loads_from_different_file_formats
27
+ I18n.backend = I18n::Backend::Simple.new
28
+ I18n.backend.load_translations "#{locales_dir}/en.rb", "#{locales_dir}/en.yml"
29
+ expected = { :en => { :fuh => { :bah => "bas" }, :foo => { :bar => "baz" } } }
30
+ assert_equal expected, backend_get_translations
31
+ end
32
+ end
33
+
34
+ class I18nSimpleBackendStoreTranslationsTest < Test::Unit::TestCase
35
+ include Tests::Backend::Simple::Setup::Base
36
+
37
+ def test_store_translations_adds_translations # no, really :-)
38
+ I18n.backend.store_translations :'en', :foo => 'bar'
39
+ assert_equal Hash[:'en', {:foo => 'bar'}], backend_get_translations
40
+ end
41
+
42
+ def test_store_translations_deep_merges_translations
43
+ I18n.backend.store_translations :'en', :foo => {:bar => 'bar'}
44
+ I18n.backend.store_translations :'en', :foo => {:baz => 'baz'}
45
+ assert_equal Hash[:'en', {:foo => {:bar => 'bar', :baz => 'baz'}}], backend_get_translations
46
+ end
47
+
48
+ def test_store_translations_forces_locale_to_sym
49
+ I18n.backend.store_translations 'en', :foo => 'bar'
50
+ assert_equal Hash[:'en', {:foo => 'bar'}], backend_get_translations
51
+ end
52
+
53
+ def test_store_translations_converts_keys_to_symbols
54
+ # backend_reset_translations!
55
+ I18n.backend.store_translations 'en', 'foo' => {'bar' => 'bar', 'baz' => 'baz'}
56
+ assert_equal Hash[:'en', {:foo => {:bar => 'bar', :baz => 'baz'}}], backend_get_translations
57
+ end
58
+
59
+ def test_deep_symbolize_keys_works
60
+ result = I18n.backend.send :deep_symbolize_keys, 'foo' => {'bar' => {'baz' => 'bar'}}
61
+ expected = {:foo => {:bar => {:baz => 'bar'}}}
62
+ assert_equal expected, result
63
+ end
64
+ end
65
+
66
+ class I18nSimpleBackendReloadTranslationsTest < Test::Unit::TestCase
67
+ include Tests::Backend::Simple::Setup::Base
68
+
69
+ def setup
70
+ I18n.backend = I18n::Backend::Simple.new
71
+ I18n.load_path = [locales_dir + '/en.yml']
72
+ assert_nil backend_get_translations
73
+ I18n.backend.send :init_translations
74
+ end
75
+
76
+ def test_setup
77
+ assert_not_nil backend_get_translations
78
+ end
79
+
80
+ def test_reload_translations_unloads_translations
81
+ I18n.backend.reload!
82
+ assert_nil backend_get_translations
83
+ end
84
+
85
+ def test_reload_translations_uninitializes_translations
86
+ I18n.backend.reload!
87
+ assert_equal I18n.backend.initialized?, false
88
+ end
89
+ end
@@ -0,0 +1,61 @@
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!"
@@ -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,112 @@
1
+ # encoding: utf-8
2
+
3
+ {
4
+ :af => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
5
+ :am => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
6
+ :ar => { :i18n => { :pluralize => lambda { |n| n == 0 ? :zero : n == 1 ? :one : n == 2 ? :two : (3..10).include?(n % 100) ? :few : (11..99).include?(n % 100) ? :many : :other } } },
7
+ :az => { :i18n => { :pluralize => lambda { |n| :other } } },
8
+ :be => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
9
+ :bg => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
10
+ :bh => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
11
+ :bn => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
12
+ :bo => { :i18n => { :pluralize => lambda { |n| :other } } },
13
+ :bs => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
14
+ :ca => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
15
+ :cs => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : (2..4).include?(n) ? :few : :other } } },
16
+ :cy => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : n == 8 || n == 11 ? :many : :other } } },
17
+ :da => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
18
+ :de => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
19
+ :dz => { :i18n => { :pluralize => lambda { |n| :other } } },
20
+ :el => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
21
+ :en => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
22
+ :eo => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
23
+ :es => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
24
+ :et => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
25
+ :eu => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
26
+ :fa => { :i18n => { :pluralize => lambda { |n| :other } } },
27
+ :fi => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
28
+ :fil => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
29
+ :fo => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
30
+ :fr => { :i18n => { :pluralize => lambda { |n| n && n != 2 ? :one : :other } } },
31
+ :fur => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
32
+ :fy => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
33
+ :ga => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
34
+ :gl => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
35
+ :gu => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
36
+ :guw => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
37
+ :ha => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
38
+ :he => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
39
+ :hi => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
40
+ :hr => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
41
+ :hu => { :i18n => { :pluralize => lambda { |n| :other } } },
42
+ :id => { :i18n => { :pluralize => lambda { |n| :other } } },
43
+ :is => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
44
+ :it => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
45
+ :iw => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
46
+ :ja => { :i18n => { :pluralize => lambda { |n| :other } } },
47
+ :jv => { :i18n => { :pluralize => lambda { |n| :other } } },
48
+ :ka => { :i18n => { :pluralize => lambda { |n| :other } } },
49
+ :km => { :i18n => { :pluralize => lambda { |n| :other } } },
50
+ :kn => { :i18n => { :pluralize => lambda { |n| :other } } },
51
+ :ko => { :i18n => { :pluralize => lambda { |n| :other } } },
52
+ :ku => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
53
+ :lb => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
54
+ :ln => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
55
+ :lt => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && !(11..19).include?(n % 100) ? :one : (2..9).include?(n % 10) && !(11..19).include?(n % 100) ? :few : :other } } },
56
+ :lv => { :i18n => { :pluralize => lambda { |n| n == 0 ? :zero : n % 10 == 1 && n % 100 != 11 ? :one : :other } } },
57
+ :mg => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
58
+ :mk => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 ? :one : :other } } },
59
+ :ml => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
60
+ :mn => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
61
+ :mo => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } },
62
+ :mr => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
63
+ :ms => { :i18n => { :pluralize => lambda { |n| :other } } },
64
+ :mt => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 0 || (2..10).include?(n % 100) ? :few : (11..19).include?(n % 100) ? :many : :other } } },
65
+ :my => { :i18n => { :pluralize => lambda { |n| :other } } },
66
+ :nah => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
67
+ :nb => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
68
+ :ne => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
69
+ :nl => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
70
+ :nn => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
71
+ :no => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
72
+ :nso => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
73
+ :om => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
74
+ :or => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
75
+ :pa => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
76
+ :pap => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
77
+ :pl => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) && !(22..24).include?(n % 100) ? :few : :other } } },
78
+ :ps => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
79
+ :pt => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
80
+ :"pt-PT" => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
81
+ :ro => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 0 ? :few : :other } } },
82
+ :ru => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
83
+ :se => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
84
+ :sh => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
85
+ :sk => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : (2..4).include?(n) ? :few : :other } } },
86
+ :sl => { :i18n => { :pluralize => lambda { |n| n % 100 == 1 ? :one : n % 100 == 2 ? :two : (3..4).include?(n % 100) ? :few : :other } } },
87
+ :sma => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
88
+ :smi => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
89
+ :smj => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
90
+ :smn => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
91
+ :sms => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : n == 2 ? :two : :other } } },
92
+ :so => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
93
+ :sq => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
94
+ :sr => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
95
+ :sv => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
96
+ :sw => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
97
+ :ta => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
98
+ :te => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
99
+ :th => { :i18n => { :pluralize => lambda { |n| :other } } },
100
+ :ti => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
101
+ :tk => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
102
+ :tl => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
103
+ :to => { :i18n => { :pluralize => lambda { |n| :other } } },
104
+ :tr => { :i18n => { :pluralize => lambda { |n| :other } } },
105
+ :uk => { :i18n => { :pluralize => lambda { |n| n % 10 == 1 && n % 100 != 11 ? :one : (2..4).include?(n % 10) && !(12..14).include?(n % 100) ? :few : n % 10 == 0 || (5..9).include?(n % 10) || (11..14).include?(n % 100) ? :many : :other } } },
106
+ :ur => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } },
107
+ :vi => { :i18n => { :pluralize => lambda { |n| :other } } },
108
+ :wa => { :i18n => { :pluralize => lambda { |n| (0..1).include?(n) ? :one : :other } } },
109
+ :yo => { :i18n => { :pluralize => lambda { |n| :other } } },
110
+ :zh => { :i18n => { :pluralize => lambda { |n| :other } } },
111
+ :zu => { :i18n => { :pluralize => lambda { |n| n == 1 ? :one : :other } } }
112
+ }