rails-i18n 5.1.3 → 7.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +129 -3
  3. data/README.md +96 -24
  4. data/lib/rails_i18n/common_pluralizations/east_slavic.rb +1 -1
  5. data/lib/rails_i18n/common_pluralizations/serbian.rb +32 -0
  6. data/lib/rails_i18n/railtie.rb +3 -0
  7. data/lib/rails_i18n.rb +0 -1
  8. data/rails/locale/af.yml +21 -21
  9. data/rails/locale/ar.yml +59 -59
  10. data/rails/locale/az.yml +19 -19
  11. data/rails/locale/be.yml +43 -43
  12. data/rails/locale/bg.yml +14 -14
  13. data/rails/locale/bn.yml +24 -24
  14. data/rails/locale/bs.yml +38 -38
  15. data/rails/locale/ca.yml +46 -22
  16. data/rails/locale/cs.yml +19 -19
  17. data/rails/locale/cy.yml +29 -29
  18. data/rails/locale/da.yml +43 -29
  19. data/rails/locale/de-AT.yml +17 -17
  20. data/rails/locale/de-CH.yml +17 -17
  21. data/rails/locale/de-DE.yml +17 -17
  22. data/rails/locale/de.yml +17 -17
  23. data/rails/locale/el-CY.yml +46 -33
  24. data/rails/locale/el.yml +48 -35
  25. data/rails/locale/en-AU.yml +22 -22
  26. data/rails/locale/en-CA.yml +23 -23
  27. data/rails/locale/en-CY.yml +22 -22
  28. data/rails/locale/en-GB.yml +22 -22
  29. data/rails/locale/en-IE.yml +22 -22
  30. data/rails/locale/en-IN.yml +25 -25
  31. data/rails/locale/en-NZ.yml +22 -22
  32. data/rails/locale/en-TT.yml +213 -0
  33. data/rails/locale/en-US.yml +22 -22
  34. data/rails/locale/en-ZA.yml +25 -25
  35. data/rails/locale/en.yml +25 -25
  36. data/rails/locale/eo.yml +16 -16
  37. data/rails/locale/es-419.yml +22 -21
  38. data/rails/locale/es-AR.yml +21 -21
  39. data/rails/locale/es-CL.yml +21 -21
  40. data/rails/locale/es-CO.yml +27 -27
  41. data/rails/locale/es-CR.yml +20 -20
  42. data/rails/locale/es-EC.yml +22 -21
  43. data/rails/locale/es-ES.yml +27 -27
  44. data/rails/locale/es-MX.yml +20 -20
  45. data/rails/locale/es-NI.yml +23 -23
  46. data/rails/locale/es-PA.yml +29 -27
  47. data/rails/locale/es-PE.yml +21 -21
  48. data/rails/locale/es-US.yml +20 -20
  49. data/rails/locale/es-VE.yml +20 -20
  50. data/rails/locale/es.yml +27 -27
  51. data/rails/locale/et.yml +19 -19
  52. data/rails/locale/eu.yml +23 -23
  53. data/rails/locale/fa.yml +22 -21
  54. data/rails/locale/fi.yml +24 -24
  55. data/rails/locale/fr-CA.yml +27 -25
  56. data/rails/locale/fr-CH.yml +25 -23
  57. data/rails/locale/fr-FR.yml +25 -23
  58. data/rails/locale/fr.yml +38 -36
  59. data/rails/locale/gl.yml +16 -16
  60. data/rails/locale/he.yml +16 -16
  61. data/rails/locale/hi-IN.yml +17 -17
  62. data/rails/locale/hi.yml +17 -17
  63. data/rails/locale/hr.yml +39 -30
  64. data/rails/locale/hu.yml +14 -14
  65. data/rails/locale/id.yml +22 -21
  66. data/rails/locale/is.yml +16 -16
  67. data/rails/locale/it-CH.yml +28 -15
  68. data/rails/locale/it.yml +21 -18
  69. data/rails/locale/ja.yml +23 -23
  70. data/rails/locale/ka.yml +19 -20
  71. data/rails/locale/km.yml +16 -16
  72. data/rails/locale/kn.yml +17 -17
  73. data/rails/locale/ko.yml +17 -17
  74. data/rails/locale/lb.yml +45 -42
  75. data/rails/locale/lo.yml +28 -28
  76. data/rails/locale/lt.yml +23 -23
  77. data/rails/locale/lv.yml +28 -28
  78. data/rails/locale/mg.yml +219 -0
  79. data/rails/locale/mk.yml +16 -16
  80. data/rails/locale/ml.yml +28 -28
  81. data/rails/locale/mn.yml +14 -14
  82. data/rails/locale/mr-IN.yml +19 -19
  83. data/rails/locale/ms.yml +14 -14
  84. data/rails/locale/nb.yml +27 -21
  85. data/rails/locale/ne.yml +20 -20
  86. data/rails/locale/nl.yml +17 -17
  87. data/rails/locale/nn.yml +16 -16
  88. data/rails/locale/oc.yml +24 -24
  89. data/rails/locale/or.yml +14 -14
  90. data/rails/locale/pa.yml +19 -19
  91. data/rails/locale/pap-AW.yml +215 -0
  92. data/rails/locale/pap-CW.yml +215 -0
  93. data/rails/locale/pl.yml +56 -56
  94. data/rails/locale/pt-BR.yml +57 -57
  95. data/rails/locale/pt.yml +58 -57
  96. data/rails/locale/rm.yml +24 -24
  97. data/rails/locale/ro.yml +69 -69
  98. data/rails/locale/ru.yml +45 -45
  99. data/rails/locale/sk.yml +17 -17
  100. data/rails/locale/sl.yml +39 -39
  101. data/rails/locale/sq.yml +87 -79
  102. data/rails/locale/sr.yml +48 -48
  103. data/rails/locale/st.yml +215 -0
  104. data/rails/locale/sv-SE.yml +19 -19
  105. data/rails/locale/sv.yml +23 -23
  106. data/rails/locale/sw.yml +14 -14
  107. data/rails/locale/ta.yml +19 -19
  108. data/rails/locale/te.yml +23 -25
  109. data/rails/locale/th.yml +8 -8
  110. data/rails/locale/tl.yml +132 -132
  111. data/rails/locale/tr.yml +19 -19
  112. data/rails/locale/tt.yml +16 -16
  113. data/rails/locale/ug.yml +16 -16
  114. data/rails/locale/uk.yml +42 -42
  115. data/rails/locale/ur.yml +26 -25
  116. data/rails/locale/uz.yml +37 -37
  117. data/rails/locale/vi.yml +18 -17
  118. data/rails/locale/wo.yml +21 -21
  119. data/rails/locale/zh-CN.yml +16 -16
  120. data/rails/locale/zh-HK.yml +34 -34
  121. data/rails/locale/zh-TW.yml +21 -21
  122. data/rails/locale/zh-YUE.yml +34 -34
  123. data/rails/ordinals/fr-CA.rb +19 -0
  124. data/rails/ordinals/fr-CH.rb +19 -0
  125. data/rails/ordinals/fr-FR.rb +19 -0
  126. data/rails/ordinals/fr.rb +19 -0
  127. data/rails/pluralization/ka.rb +2 -2
  128. data/rails/pluralization/pap-AW.rb +3 -0
  129. data/rails/pluralization/pap-CW.rb +3 -0
  130. data/rails/pluralization/pt-BR.rb +3 -0
  131. data/rails/pluralization/sr.rb +2 -2
  132. data/rails/pluralization/st.rb +3 -0
  133. data/rails/pluralization/ta.rb +3 -0
  134. data/rails/pluralization/tr.rb +2 -2
  135. data/rails/transliteration/da.yml +10 -0
  136. data/rails/transliteration/ka.yml +37 -0
  137. data/rails/transliteration/uk.rb +5 -21
  138. metadata +30 -15
  139. data/lib/rails_i18n/unicode.rb +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3b27cc2fbe3eb1192768fb88f710a25692fd4bfc
4
- data.tar.gz: 97773d24cb73497882574a939dc77e9850d5d0c3
2
+ SHA256:
3
+ metadata.gz: 734f31dff6b40961b95b90d211ce9184d9628586030eaa74c10281799751428b
4
+ data.tar.gz: 28f3184814163a9bcc057b7a312aeb425bda0534cef5ad85b968e43760d41af4
5
5
  SHA512:
6
- metadata.gz: f4dd3799373bb597c969580b696fc8f77739f59284e6a4942b4a42433fa4928966a3ed87fa280b44ba994eafe5db8490471344e2b1f8286833b3ef899e666706
7
- data.tar.gz: bb9ebc09793e14d715b4dff68f87ea3a674f782af1d5a46fd4c4a54b4a761e5e707c2cf6a35de4b13e200588752fb7cc8117cf730956b7fe8e690ed52567b5cd
6
+ metadata.gz: c90ef6bd2aec15bca7967cbd7b79dd149e43690321febaf549e1eb7107fb8843ee8cfe25655418e251fc45f5b372898ef1cb4691eb6cfdd250f2f5e0ad61c1c9
7
+ data.tar.gz: f3d949f10171bdc2ee55d2d82a5185f65698a6396193d858f75e8b94e139dc6c74f989ffb4fac8d25f9346ad7495867f546b98699cb300dbf6ce51ae5edeb625
data/CHANGELOG.md CHANGED
@@ -1,3 +1,131 @@
1
+ ## unreleased
2
+
3
+ ## 7.0.1 (2021-12-24)
4
+
5
+ - Fix ordinals loading.
6
+
7
+ ## 7.0.0 (2021-12-23)
8
+
9
+ - Support Rails 7
10
+ - Drop support for Ruby 1.8
11
+ - Eager load translations during boot phase if possible.
12
+ - Translate ordinals (fr, fr-FR, fr-CA, fr-BE)
13
+ - Update following locales:
14
+ - Albanian (sq)
15
+ - Catalan (ca)
16
+ - Chinese (zh-CN, zh-TW)
17
+ - Croatian (hr)
18
+ - Danish (da)
19
+ - Finnish (fi)
20
+ - French (fr, fr-FR, fr-CA, fr-BE)
21
+ - Georgian (ka)
22
+ - German (de)
23
+ - Greek (el, el-CY)
24
+ - Italian (it, it-CH)
25
+ - Latvian (lv)
26
+ - Lithuanian (lt)
27
+ - Norwegian (nb)
28
+ - Polish (pl)
29
+ - Portuguese (pt-BR)
30
+ - Romanian (ro)
31
+ - Serbian (sr)
32
+ - Spanish (es-CO, es-AR)
33
+ - Swedish (sv)
34
+ - Turkish (tr)
35
+ - Ukrainian (uk)
36
+ - Vietnamese (vi)
37
+ - Add following locales:
38
+ - English Trinidad & Tobago (en-TT)
39
+ - Papiamento (pap-AW, pap-CW)
40
+ - Sesotho (st)
41
+
42
+ ## 6.0.0 (2019-08-17)
43
+
44
+ - Update rails-i18n.gemspec to use Railties 6.0.0
45
+ - Add Malagasy (mg) locale
46
+ - Update following locales:
47
+ - Afrikaans (af)
48
+ - Arabic (ar)
49
+ - Azerbaijani (az)
50
+ - Belarusian (be)
51
+ - Bulgarian (bg)
52
+ - Bengali (bn)
53
+ - Bosnian (bs)
54
+ - Catalan (ca)
55
+ - Czech (cs)
56
+ - Welsh (cy)
57
+ - Danish (da)
58
+ - German (de-AT, de-CH, de-DE, de)
59
+ - Greek (el-CY, el)
60
+ - English (en-AU, en-CA, en-CY, en-GB, en-IE, en-IN, en-NZ, en-US, en-Za, en)
61
+ - Esperanto (eo)
62
+ - Spanish (es-419, es-AR, es-CL, es-CO, es-CR, es-EC, es-ES, es-MX, es-NI, es-PA, es-PE, es-US, es-VE, es)
63
+ - Estonian (et)
64
+ - Basque (eu)
65
+ - Farsi/Persian (fa)
66
+ - Finnish (fi)
67
+ - French (fr-CA, fr-CH, fr-FR, fr)
68
+ - Galician (gl)
69
+ - Hebrew (he)
70
+ - Hindi (hi-IN, hi)
71
+ - Croatian (hr)
72
+ - Hungarian (hu)
73
+ - Indonesian (id)
74
+ - Icelandic (is)
75
+ - Italian (it, it-CH)
76
+ - Japanese (ja)
77
+ - Georgian (ka)
78
+ - Khmer (km)
79
+ - Kannada (kn)
80
+ - Korean (ko)
81
+ - Luxembourgish (lb)
82
+ - Lao (lo)
83
+ - Lithuanian (lt)
84
+ - Latvian (lv)
85
+ - Malagasy (mg)
86
+ - Macedonian (mk)
87
+ - Malayalam (ml)
88
+ - Mongolian (mn)
89
+ - Marathi (mr-IN)
90
+ - Malay (ms)
91
+ - Norwegian Bokmål (nb)
92
+ - Nepali (ne)
93
+ - Dutch (nl)
94
+ - Norwegian (nn)
95
+ - Occitan (oc)
96
+ - Oriya/Odiya (or)
97
+ - Panjabi (pa)
98
+ - Polish (pl)
99
+ - Portuguese (pt-BR, pt)
100
+ - Raeto-Romance (rm)
101
+ - Romanian (ro)
102
+ - Russian (ru)
103
+ - Slovak (sk)
104
+ - Slovenian (sl)
105
+ - Albanian (sq)
106
+ - Cyrillic Serbian (sr)
107
+ - Swedish (sv-SE, sv)
108
+ - Swahili (sw)
109
+ - Tamil (ta)
110
+ - Telugu (te)
111
+ - Thai (th)
112
+ - Tagalog (tl)
113
+ - Turkish (tr)
114
+ - Tatar (tt)
115
+ - Uyghur (ug)
116
+ - Ukrainian (uk)
117
+ - Urdu (ur)
118
+ - Uzbek (uz)
119
+ - Vietnamese (vi)
120
+ - Wolof (wo)
121
+ - Chinese (zh-CN, zh-HK, zh-TW, zh-YUE)
122
+
123
+ ## 6.0.0.beta1 (2019-01-28)
124
+
125
+ - Update rails-i18n.gemspec to use Railties 6.0.0.beta1
126
+ - Update Gemfile
127
+ - Update .travis.yml
128
+
1
129
  ## 5.1.3 (2019-01-28)
2
130
 
3
131
  - Update following locales:
@@ -111,7 +239,6 @@
111
239
  - Update Spanish locales (ES-\*)
112
240
  - Update Brazilian Portuguese (pt-BR)
113
241
  - Update Dutch (nl)
114
- - Update Indonesian (id)
115
242
  - Update Arabic (ar)
116
243
  - Add German (de-DE)
117
244
  - Add French (fr-FR)
@@ -194,7 +321,6 @@
194
321
  - Update Urdu (ur)
195
322
  - Update Chinese (zh-CN, zh-HK, zh-TW, zh-YUE)
196
323
  - Update Khmer (km)
197
- - Update Lithuanian (lt)
198
324
  - Update Italian (it)
199
325
  - Add Belarusian (be)
200
326
  - Add Tatar (tt)
@@ -290,7 +416,7 @@
290
416
  - Fix the currency unit for French/Switzerland (fr-CH)
291
417
 
292
418
  ## 0.7.4 (2013-07-04)
293
- - Add Odiya language (or)
419
+ - Add Oriya/Odiya language (or)
294
420
  - Revert several translations for Spanish/Colombia (es-CO)
295
421
  - Add Swiss-German (iso-639-2/gsw-CH)
296
422
  - Add Chinese/Hong Kong (zh-HK)
data/README.md CHANGED
@@ -2,7 +2,7 @@ Rails Locale Data Repository
2
2
  ============================
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/rails-i18n.svg)](http://badge.fury.io/rb/rails-i18n)
5
- [![Build Status](https://secure.travis-ci.org/svenfuchs/rails-i18n.png)](http://travis-ci.org/svenfuchs/rails-i18n)
5
+ [![Build Status](https://secure.travis-ci.org/svenfuchs/rails-i18n.svg)](http://travis-ci.org/svenfuchs/rails-i18n)
6
6
 
7
7
  Centralization of locale data collection for Ruby on Rails.
8
8
 
@@ -10,18 +10,26 @@ Centralization of locale data collection for Ruby on Rails.
10
10
 
11
11
  Include the gem to your Gemfile:
12
12
 
13
- gem 'rails-i18n', '~> 5.1' # For 5.0.x, 5.1.x and 5.2.x
14
- gem 'rails-i18n', '~> 4.0' # For 4.0.x
15
- gem 'rails-i18n', '~> 3.0' # For 3.x
16
- gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'master' # For 5.x
17
- gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x' # For 4.x
18
- gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-3-x' # For 3.x
13
+ ``` ruby
14
+ gem 'rails-i18n', '~> 7.0.0' # For 7.0.0
15
+ gem 'rails-i18n', '~> 6.0' # For 6.x
16
+ gem 'rails-i18n', '~> 5.1' # For 5.0.x, 5.1.x and 5.2.x
17
+ gem 'rails-i18n', '~> 4.0' # For 4.0.x
18
+ gem 'rails-i18n', '~> 3.0' # For 3.x
19
+ gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'master' # For 5.x
20
+ gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x' # For 4.x
21
+ gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-3-x' # For 3.x
22
+ ```
19
23
 
20
24
  Alternatively, execute the following command:
21
25
 
22
- gem install rails-i18n -v '~> 5.1' # For For 5.0.x, 5.1.x and 5.2.x
23
- gem install rails-i18n -v '~> 4.0' # For 4.0.x
24
- gem install rails-i18n -v '~> 3.0' # For 3.x
26
+ ``` shell
27
+ gem install rails-i18n -v '~> 7.0.0' # For 7.0.0
28
+ gem install rails-i18n -v '~> 6.0' # For 6.x
29
+ gem install rails-i18n -v '~> 5.1' # For For 5.0.x, 5.1.x and 5.2.x
30
+ gem install rails-i18n -v '~> 4.0' # For 4.0.x
31
+ gem install rails-i18n -v '~> 3.0' # For 3.x
32
+ ```
25
33
 
26
34
  Note that your Ruby on Rails version must be 3.0 or higher in order to install the `rails-i18n` gem. For rails 2.x, install it manually as described in the Manual Installation section below.
27
35
 
@@ -29,11 +37,15 @@ Note that your Ruby on Rails version must be 3.0 or higher in order to install t
29
37
 
30
38
  `rails-i18n` gem initially loads all available locale files, pluralization and transliteration rules. This default behaviour can be changed. If you specify in `config/environments/*` the locales which have to be loaded via `I18n.available_locales` option:
31
39
 
32
- config.i18n.available_locales = ['es-CO', :de]
40
+ ``` ruby
41
+ config.i18n.available_locales = ['es-CO', :de]
42
+ ```
33
43
 
34
44
  or
35
45
 
36
- config.i18n.available_locales = :nl
46
+ ``` ruby
47
+ config.i18n.available_locales = :nl
48
+ ```
37
49
 
38
50
  ## Manual Installation
39
51
 
@@ -52,24 +64,27 @@ Locale data whose structure is compatible with Rails 2.3 are available on the se
52
64
  Available locales:
53
65
 
54
66
  > af, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, de-AT, de-CH, de-DE, el, el-CY,
55
- > en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-US, en-ZA, en-CY,eo, es,
67
+ > en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-US, en-ZA, en-CY, en-TT, eo, es,
56
68
  > es-419, es-AR, es-CL, es-CO, es-CR, es-EC, es-ES, es-MX, es-NI, es-PA, es-PE, es-US, es-VE,
57
69
  > et, eu, fa, fi, fr, fr-CA, fr-CH, fr-FR, gl, he, hi, hi-IN, hr, hu, id, is, it,
58
70
  > it-CH, ja, ka, km, kn, ko, lb, lo, lt, lv, mk, ml, mn, mr-IN, ms, nb, ne, nl, nn, oc, or,
59
- > pa, pl, pt, pt-BR, rm, ro, ru, sk, sl, sq, sr, sw, ta, te, th, tl, tr, tt, ug,
71
+ > pa, pl, pt, pt-BR, rm, ro, ru, sk, sl, sq, sr, st, sw, ta, te, th, tl, tr, tt, ug,
60
72
  > ur, uz, vi, wo, zh-CN, zh-HK, zh-TW, zh-YUE
61
73
 
62
74
  Complete locales:
63
75
 
64
76
  > af, da, de, de-AT, de-CH, de-DE, en-US, es, es-419, es-AR, es-CL, es-CO, es-CR, es-EC,
65
- > es-ES, es-MX, es-NI, es-PA, es-PE, es-US, es-VE, et, fa, fr, fr-CA, fr-CH, fr-FR, id, ja, ka, ml, nb,
66
- > nl, nn, pt-BR, sv, sv-SE, tr, zh-CN, zh-HK, zh-TW, zh-YUE, uk
77
+ > es-ES, es-MX, es-NI, es-PA, es-PE, es-US, es-VE, et, fa, fr, fr-CA, fr-CH, fr-FR, id, it, ja, ka, ml, nb,
78
+ > nl, nn, pt, pt-BR, sv, sv-SE, tr, zh-CN, zh-HK, zh-TW, zh-YUE, uk
67
79
 
68
80
  Currently, most locales are incomplete. Typically they lack the following keys:
69
81
 
70
82
  - `activerecord.errors.messages.record_invalid`
71
83
  - `activerecord.errors.messages.restrict_dependent_destroy.has_one`
72
84
  - `activerecord.errors.messages.restrict_dependent_destroy.has_many`
85
+
86
+ The following keys should NOT be included:
87
+
73
88
  - `errors.messages.model_invalid`
74
89
  - `errors.messages.required`
75
90
 
@@ -87,7 +102,7 @@ fonts have a glyph, there are still many fonts that will not render the characte
87
102
  If you want to provide a different value, you can create a custom locale file under
88
103
  `config/locales/tr.yml` and override the respective key:
89
104
 
90
- ```YAML
105
+ ``` yaml
91
106
  tr:
92
107
  number:
93
108
  currency:
@@ -103,7 +118,7 @@ If you are familiar with GitHub operations, then follow the procedures described
103
118
 
104
119
  If not,
105
120
 
106
- * Save your locale data on the [Gist](http://gist.github.com).
121
+ * Save your locale data in a [Gist](http://gist.github.com).
107
122
  * Open an issue with reference to the Gist you created.
108
123
 
109
124
  ### Fetching the `rails-i18n` Repository
@@ -120,25 +135,42 @@ If not,
120
135
  ### Testing your Locale File
121
136
 
122
137
  Before committing and pushing your changes, test the integrity of your locale file.
138
+ (You can also run the tests using Docker, see below)
123
139
 
124
- bundle exec rake spec
140
+ ``` shell
141
+ bundle exec rake spec
142
+ ```
125
143
 
126
144
  Make sure you have included all translations with:
127
145
 
128
- bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
146
+ ``` shell
147
+ bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
148
+ ```
149
+
150
+ Make sure it is normalized with:
151
+
152
+ ``` shell
153
+ thor locales:normalize LOCALE # or "thor locales:normalize_all"
154
+ ```
129
155
 
130
156
  You can list all complete and incomplete locales:
131
157
 
132
- thor locales:complete
133
- thor locales:incomplete
158
+ ``` shell
159
+ thor locales:complete
160
+ thor locales:incomplete
161
+ ```
134
162
 
135
163
  Also, you can list all available locales:
136
164
 
137
- thor locales:list
165
+ ``` shell
166
+ thor locales:list
167
+ ```
138
168
 
139
169
  You can list all missing keys:
140
170
 
141
- i18n-tasks missing es
171
+ ``` shell
172
+ i18n-tasks missing es
173
+ ```
142
174
 
143
175
  ### Edit README.md
144
176
 
@@ -150,6 +182,46 @@ If you are ready, push the repository into the Github and send us a pull request
150
182
 
151
183
  We will do the formality check and publish it as quick as we can.
152
184
 
185
+ ### Add an informative title to your pull request or issue
186
+
187
+ If your pull request or issue concerns a specific locale - please indicate the relevant locale
188
+ in the issue or pull request title in order to facilitate triage.
189
+
190
+ **Best:**
191
+
192
+ *Danish: change da.errors.messages.required to "skal udfyldes"*
193
+
194
+ **Good:**
195
+
196
+ *Human precision in Swedish locale file is set to 1*
197
+
198
+ *Update es-PE.yml, the currency unit is incorrect*
199
+
200
+ **Bad:**
201
+
202
+ *Changing some string about validation*
203
+
204
+ ### Docker
205
+
206
+ Build the image:
207
+
208
+ ```
209
+ docker build --tag=railsi18n .
210
+ ```
211
+
212
+ Run the tests:
213
+
214
+ ```
215
+ docker run railsi18n
216
+ ```
217
+
218
+ To run the other commands described above:
219
+
220
+ ```
221
+ docker run railsi18n bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
222
+
223
+ ```
224
+
153
225
  ## See also
154
226
 
155
227
  * [devise-i18n](https://github.com/tigrish/devise-i18n)
@@ -1,7 +1,7 @@
1
1
  # Originally was implemented by Yaroslav Markin in "russian" gem
2
2
  # (http://github.com/yaroslav/russian)
3
3
  #
4
- # Used for Belarusian, Bosnian, Croatian, Russian, Serbian, Serbo-Croatian, Ukrainian.
4
+ # Used for Belarusian, Bosnian, Croatian, Russian, Serbo-Croatian, Ukrainian.
5
5
 
6
6
  module RailsI18n
7
7
  module Pluralization
@@ -0,0 +1,32 @@
1
+ module RailsI18n
2
+ module Pluralization
3
+ module Serbian
4
+ FROM_2_TO_4 = (2..4).to_a.freeze
5
+ FROM_12_TO_14 = (12..14).to_a.freeze
6
+
7
+ def self.rule
8
+ lambda do |n|
9
+ n ||= 0
10
+ mod10 = n % 10
11
+ mod100 = n % 100
12
+
13
+ if mod10 == 1 && mod100 != 11
14
+ :one
15
+ elsif FROM_2_TO_4.include?(mod10) && !FROM_12_TO_14.include?(mod100)
16
+ :few
17
+ else
18
+ :other
19
+ end
20
+ end
21
+ end
22
+
23
+ def self.with_locale(locale)
24
+ { locale => {
25
+ :i18n => {
26
+ :plural => {
27
+ :keys => [:one, :few, :other],
28
+ :rule => rule }}}}
29
+ end
30
+ end
31
+ end
32
+ end
@@ -3,11 +3,14 @@ require 'rails'
3
3
  module RailsI18n
4
4
  class Railtie < ::Rails::Railtie #:nodoc:
5
5
  initializer 'rails-i18n' do |app|
6
+ app.config.eager_load_namespaces << ::I18n if ::I18n.respond_to?(:eager_load!)
7
+
6
8
  RailsI18n::Railtie.instance_eval do
7
9
  pattern = pattern_from app.config.i18n.available_locales
8
10
 
9
11
  add("rails/locale/#{pattern}.yml")
10
12
  add("rails/pluralization/#{pattern}.rb")
13
+ add("rails/ordinals/#{pattern}.rb")
11
14
  add("rails/transliteration/#{pattern}.{rb,yml}")
12
15
 
13
16
  init_pluralization_module
data/lib/rails_i18n.rb CHANGED
@@ -1,2 +1 @@
1
- require 'rails_i18n/unicode'
2
1
  require 'rails_i18n/railtie'
data/rails/locale/af.yml CHANGED
@@ -5,8 +5,8 @@ af:
5
5
  messages:
6
6
  record_invalid: 'Validering het misluk: %{errors}'
7
7
  restrict_dependent_destroy:
8
- has_one: "Kan rekord nie skrap nie omdat 'n afhanklike %{record} bestaan"
9
- has_many: 'Kan rekord nie skrap nie omdat afhanklike %{record} bestaan'
8
+ has_one: Kan rekord nie skrap nie omdat 'n afhanklike %{record} bestaan
9
+ has_many: Kan rekord nie skrap nie omdat afhanklike %{record} bestaan
10
10
  date:
11
11
  abbr_day_names:
12
12
  - Son
@@ -17,7 +17,7 @@ af:
17
17
  - Vry
18
18
  - Sat
19
19
  abbr_month_names:
20
- -
20
+ -
21
21
  - Jan
22
22
  - Feb
23
23
  - Mar
@@ -40,10 +40,10 @@ af:
40
40
  - Saterdag
41
41
  formats:
42
42
  default: "%Y-%m-%d"
43
- long: "%B %d, %Y"
44
- short: "%b %d"
43
+ long: "%d %B %Y"
44
+ short: "%d %b"
45
45
  month_names:
46
- -
46
+ -
47
47
  - Januarie
48
48
  - Februarie
49
49
  - Maart
@@ -75,43 +75,42 @@ af:
75
75
  one: sowat 1 jaar
76
76
  other: sowat %{count} jaar
77
77
  half_a_minute: halfminuut
78
- less_than_x_minutes:
79
- one: minder as 1 minuut
80
- other: minder as %{count} minute
81
78
  less_than_x_seconds:
82
79
  one: minder as 1 sekonde
83
80
  other: minder as %{count} sekondes
81
+ less_than_x_minutes:
82
+ one: minder as 1 minuut
83
+ other: minder as %{count} minute
84
84
  over_x_years:
85
85
  one: meer as 1 jaar
86
86
  other: meer as %{count} jaar
87
- x_days:
88
- one: 1 dag
89
- other: "%{count} days"
87
+ x_seconds:
88
+ one: 1 sekonde
89
+ other: "%{count} sekondes"
90
90
  x_minutes:
91
91
  one: 1 minuut
92
92
  other: "%{count} minute"
93
+ x_days:
94
+ one: 1 dag
95
+ other: "%{count} days"
93
96
  x_months:
94
97
  one: 1 maand
95
98
  other: "%{count} maande"
96
99
  x_years:
97
100
  one: 1 jaar
98
101
  other: "%{count} jare"
99
- x_seconds:
100
- one: 1 sekonde
101
- other: "%{count} sekondes"
102
102
  prompts:
103
- day: Dag
104
- hour: Uur
103
+ second: Sekondes
105
104
  minute: Minuut
105
+ hour: Uur
106
+ day: Dag
106
107
  month: Maand
107
- second: Sekondes
108
108
  year: Jaar
109
109
  errors:
110
110
  format: "%{attribute} %{message}"
111
111
  messages:
112
112
  accepted: moet aanvaar word
113
113
  blank: mag nie leeg wees nie
114
- present: moet leeg wees
115
114
  confirmation: pas nie by bevestiging nie
116
115
  empty: mag nie leeg wees nie
117
116
  equal_to: moet gelyk wees aan %{count}
@@ -127,6 +126,8 @@ af:
127
126
  not_a_number: is nie 'n getal nie
128
127
  not_an_integer: moet 'n heelgetal wees
129
128
  odd: moet onewe wees
129
+ other_than: moet anders wees as %{count}
130
+ present: moet leeg wees
130
131
  required: moet bestaan
131
132
  taken: is reeds geneem
132
133
  too_long:
@@ -138,7 +139,6 @@ af:
138
139
  wrong_length:
139
140
  one: is die verkeerde lengte (moet 1 karakter wees)
140
141
  other: is die verkeerde lengte (moet %{count} karakters wees)
141
- other_than: moet anders wees as %{count}
142
142
  template:
143
143
  body: 'There were problems with the following fields:'
144
144
  header:
@@ -208,6 +208,6 @@ af:
208
208
  am: vm
209
209
  formats:
210
210
  default: "%a, %d %b %Y %H:%M:%S %z"
211
- long: "%B %d, %Y %H:%M"
211
+ long: "%d %B %Y %H:%M"
212
212
  short: "%d %b %H:%M"
213
213
  pm: nm