rails-i18n 7.0.3 → 7.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +120 -0
  3. data/README.md +41 -14
  4. data/lib/rails_i18n/common_pluralizations/east_slavic.rb +3 -3
  5. data/lib/rails_i18n/common_pluralizations/{serbian.rb → one_few_other.rb} +10 -3
  6. data/lib/rails_i18n/common_pluralizations/one_other.rb +1 -1
  7. data/lib/rails_i18n/common_pluralizations/one_two_other.rb +5 -7
  8. data/lib/rails_i18n/common_pluralizations/one_upto_two_other.rb +4 -2
  9. data/lib/rails_i18n/common_pluralizations/one_with_zero_other.rb +6 -1
  10. data/lib/rails_i18n/common_pluralizations/romanian.rb +5 -2
  11. data/lib/rails_i18n/common_pluralizations/west_slavic.rb +4 -6
  12. data/lib/rails_i18n/railtie.rb +9 -6
  13. data/lib/rails_i18n.rb +10 -0
  14. data/rails/locale/af.yml +20 -20
  15. data/rails/locale/ar.yml +1 -1
  16. data/rails/locale/az.yml +12 -12
  17. data/rails/locale/bg.yml +12 -12
  18. data/rails/locale/bn.yml +22 -19
  19. data/rails/locale/bs.yml +8 -8
  20. data/rails/locale/ca.yml +17 -17
  21. data/rails/locale/cs.yml +31 -31
  22. data/rails/locale/cy.yml +63 -44
  23. data/rails/locale/da.yml +16 -15
  24. data/rails/locale/de-AT.yml +7 -4
  25. data/rails/locale/de-CH.yml +7 -4
  26. data/rails/locale/de-DE.yml +7 -4
  27. data/rails/locale/de.yml +7 -4
  28. data/rails/locale/dz.yml +213 -0
  29. data/rails/locale/el-CY.yml +9 -9
  30. data/rails/locale/el.yml +9 -9
  31. data/rails/locale/en-AU.yml +15 -15
  32. data/rails/locale/en-CA.yml +15 -15
  33. data/rails/locale/en-CY.yml +15 -15
  34. data/rails/locale/en-GB.yml +15 -15
  35. data/rails/locale/en-IE.yml +15 -15
  36. data/rails/locale/en-IN.yml +15 -15
  37. data/rails/locale/en-NZ.yml +15 -15
  38. data/rails/locale/en-TT.yml +15 -15
  39. data/rails/locale/en-US.yml +19 -17
  40. data/rails/locale/en-ZA.yml +18 -18
  41. data/rails/locale/en.yml +17 -15
  42. data/rails/locale/eo.yml +5 -5
  43. data/rails/locale/es-419.yml +20 -18
  44. data/rails/locale/es-AR.yml +20 -18
  45. data/rails/locale/es-CL.yml +20 -18
  46. data/rails/locale/es-CO.yml +20 -18
  47. data/rails/locale/es-CR.yml +20 -18
  48. data/rails/locale/es-EC.yml +20 -18
  49. data/rails/locale/es-ES.yml +20 -18
  50. data/rails/locale/es-MX.yml +20 -18
  51. data/rails/locale/es-NI.yml +20 -18
  52. data/rails/locale/es-PA.yml +20 -18
  53. data/rails/locale/es-PE.yml +20 -18
  54. data/rails/locale/es-US.yml +20 -18
  55. data/rails/locale/es-VE.yml +20 -18
  56. data/rails/locale/es.yml +20 -18
  57. data/rails/locale/eu.yml +4 -4
  58. data/rails/locale/fa.yml +2 -2
  59. data/rails/locale/fi.yml +3 -3
  60. data/rails/locale/fr-CA.yml +10 -8
  61. data/rails/locale/fr-CH.yml +12 -10
  62. data/rails/locale/fr-FR.yml +12 -10
  63. data/rails/locale/fr.yml +26 -24
  64. data/rails/locale/fy.yml +215 -0
  65. data/rails/locale/gd.yml +252 -0
  66. data/rails/locale/gl.yml +12 -12
  67. data/rails/locale/hi-IN.yml +2 -2
  68. data/rails/locale/hi.yml +2 -2
  69. data/rails/locale/hr.yml +46 -46
  70. data/rails/locale/hu.yml +12 -12
  71. data/rails/locale/id.yml +7 -7
  72. data/rails/locale/is.yml +16 -16
  73. data/rails/locale/it-CH.yml +10 -10
  74. data/rails/locale/it.yml +10 -10
  75. data/rails/locale/ja.yml +15 -39
  76. data/rails/locale/ka.yml +16 -16
  77. data/rails/locale/kk.yml +225 -0
  78. data/rails/locale/kn.yml +5 -5
  79. data/rails/locale/ko.yml +34 -58
  80. data/rails/locale/lb.yml +7 -7
  81. data/rails/locale/lo.yml +13 -85
  82. data/rails/locale/lv.yml +11 -1
  83. data/rails/locale/mg.yml +6 -6
  84. data/rails/locale/ml.yml +11 -11
  85. data/rails/locale/mn.yml +15 -15
  86. data/rails/locale/mr-IN.yml +2 -2
  87. data/rails/locale/ms.yml +13 -13
  88. data/rails/locale/nb.yml +20 -20
  89. data/rails/locale/ne.yml +15 -15
  90. data/rails/locale/nl.yml +7 -7
  91. data/rails/locale/nn.yml +12 -12
  92. data/rails/locale/oc.yml +1 -1
  93. data/rails/locale/or.yml +12 -12
  94. data/rails/locale/pa.yml +15 -15
  95. data/rails/locale/pap-AW.yml +16 -16
  96. data/rails/locale/pap-CW.yml +16 -16
  97. data/rails/locale/pl.yml +4 -4
  98. data/rails/locale/pt-BR.yml +21 -19
  99. data/rails/locale/pt.yml +16 -14
  100. data/rails/locale/rm.yml +2 -2
  101. data/rails/locale/ro.yml +8 -8
  102. data/rails/locale/ru.yml +17 -15
  103. data/rails/locale/sc.yml +223 -0
  104. data/rails/locale/sk.yml +1 -0
  105. data/rails/locale/sl.yml +10 -10
  106. data/rails/locale/sq.yml +15 -19
  107. data/rails/locale/sv-FI.yml +207 -0
  108. data/rails/locale/sv-SE.yml +6 -3
  109. data/rails/locale/sv.yml +6 -3
  110. data/rails/locale/sw.yml +9 -9
  111. data/rails/locale/ta.yml +10 -10
  112. data/rails/locale/tr.yml +16 -16
  113. data/rails/locale/uk.yml +1 -1
  114. data/rails/locale/uz.yml +1 -1
  115. data/rails/locale/vi.yml +13 -37
  116. data/rails/locale/wo.yml +15 -15
  117. data/rails/locale/zh-CN.yml +30 -30
  118. data/rails/locale/zh-HK.yml +35 -67
  119. data/rails/locale/zh-TW.yml +37 -69
  120. data/rails/locale/zh-YUE.yml +30 -62
  121. data/rails/ordinals/be.yml +6 -0
  122. data/rails/ordinals/bs.yml +6 -0
  123. data/rails/ordinals/cs.yml +6 -0
  124. data/rails/ordinals/da.yml +6 -0
  125. data/rails/ordinals/de-AT.yml +6 -0
  126. data/rails/ordinals/de-CH.yml +6 -0
  127. data/rails/ordinals/de-DE.yml +6 -0
  128. data/rails/ordinals/de.yml +6 -0
  129. data/rails/ordinals/eo.yml +6 -0
  130. data/rails/ordinals/et.yml +6 -0
  131. data/rails/ordinals/fa.yml +6 -0
  132. data/rails/ordinals/fi.yml +6 -0
  133. data/rails/ordinals/gd.rb +24 -0
  134. data/rails/ordinals/hr.yml +6 -0
  135. data/rails/ordinals/hu.yml +6 -0
  136. data/rails/ordinals/is.yml +6 -0
  137. data/rails/ordinals/ka.yml +6 -0
  138. data/rails/ordinals/lb.yml +6 -0
  139. data/rails/ordinals/lt.yml +6 -0
  140. data/rails/ordinals/lv.yml +6 -0
  141. data/rails/ordinals/mk.yml +6 -0
  142. data/rails/ordinals/nb.yml +6 -0
  143. data/rails/ordinals/ne.yml +6 -0
  144. data/rails/ordinals/nn.yml +6 -0
  145. data/rails/ordinals/pl.yml +6 -0
  146. data/rails/ordinals/sk.yml +6 -0
  147. data/rails/ordinals/sl.yml +6 -0
  148. data/rails/ordinals/sq.yml +6 -0
  149. data/rails/ordinals/sr.yml +6 -0
  150. data/rails/ordinals/sw.yml +6 -0
  151. data/rails/ordinals/tr.yml +6 -0
  152. data/rails/pluralization/ar.rb +3 -2
  153. data/rails/pluralization/bs.rb +2 -2
  154. data/rails/pluralization/el-CY.rb +3 -0
  155. data/rails/pluralization/en-CY.rb +3 -0
  156. data/rails/pluralization/en-IE.rb +3 -0
  157. data/rails/pluralization/en-TT.rb +3 -0
  158. data/rails/pluralization/en-US.rb +3 -0
  159. data/rails/pluralization/en-ZA.rb +3 -0
  160. data/rails/pluralization/fy.rb +3 -0
  161. data/rails/pluralization/gd.rb +8 -4
  162. data/rails/pluralization/hr.rb +2 -2
  163. data/rails/pluralization/hsb.rb +7 -9
  164. data/rails/pluralization/kk.rb +3 -0
  165. data/rails/pluralization/lt.rb +3 -2
  166. data/rails/pluralization/lv.rb +1 -2
  167. data/rails/pluralization/mk.rb +2 -3
  168. data/rails/pluralization/pl.rb +4 -3
  169. data/rails/pluralization/sc.rb +3 -0
  170. data/rails/pluralization/sl.rb +7 -11
  171. data/rails/pluralization/sr.rb +2 -2
  172. data/rails/transliteration/de.yml +1 -0
  173. metadata +50 -51
  174. data/rails/pluralization/ak.rb +0 -3
  175. data/rails/pluralization/am.rb +0 -3
  176. data/rails/pluralization/bh.rb +0 -3
  177. data/rails/pluralization/bm.rb +0 -3
  178. data/rails/pluralization/bo.rb +0 -3
  179. data/rails/pluralization/br.rb +0 -31
  180. data/rails/pluralization/by.rb +0 -3
  181. data/rails/pluralization/cy.rb +0 -24
  182. data/rails/pluralization/dz.rb +0 -3
  183. data/rails/pluralization/ff.rb +0 -3
  184. data/rails/pluralization/ga.rb +0 -27
  185. data/rails/pluralization/guw.rb +0 -3
  186. data/rails/pluralization/gv.rb +0 -22
  187. data/rails/pluralization/ig.rb +0 -3
  188. data/rails/pluralization/ii.rb +0 -3
  189. data/rails/pluralization/iu.rb +0 -3
  190. data/rails/pluralization/jv.rb +0 -3
  191. data/rails/pluralization/kab.rb +0 -3
  192. data/rails/pluralization/kde.rb +0 -3
  193. data/rails/pluralization/kea.rb +0 -3
  194. data/rails/pluralization/ksh.rb +0 -23
  195. data/rails/pluralization/kw.rb +0 -3
  196. data/rails/pluralization/lag.rb +0 -24
  197. data/rails/pluralization/ln.rb +0 -3
  198. data/rails/pluralization/mo.rb +0 -3
  199. data/rails/pluralization/mt.rb +0 -28
  200. data/rails/pluralization/my.rb +0 -3
  201. data/rails/pluralization/naq.rb +0 -3
  202. data/rails/pluralization/nso.rb +0 -3
  203. data/rails/pluralization/root.rb +0 -3
  204. data/rails/pluralization/sah.rb +0 -3
  205. data/rails/pluralization/se.rb +0 -3
  206. data/rails/pluralization/ses.rb +0 -3
  207. data/rails/pluralization/sg.rb +0 -3
  208. data/rails/pluralization/sh.rb +0 -3
  209. data/rails/pluralization/shi.rb +0 -3
  210. data/rails/pluralization/sma.rb +0 -3
  211. data/rails/pluralization/smi.rb +0 -3
  212. data/rails/pluralization/smj.rb +0 -3
  213. data/rails/pluralization/smn.rb +0 -3
  214. data/rails/pluralization/sms.rb +0 -3
  215. data/rails/pluralization/ti.rb +0 -3
  216. data/rails/pluralization/to.rb +0 -3
  217. data/rails/pluralization/tzm.rb +0 -21
  218. data/rails/pluralization/wa.rb +0 -3
  219. data/rails/pluralization/yo.rb +0 -3
  220. data/rails/pluralization/zh.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c6fa09a4b3826f78df6a977ed76cba1c256f56fd1b541d0d466538809fa28ea
4
- data.tar.gz: d60cebc84da40cfa4ca1372e294f4744a9d4056fb1dd1ad3caa0b447db458c0b
3
+ metadata.gz: 0c91f58bb2ee548d21752bc153f3e4ca0d9538af37c8b88177a4ea8236d91697
4
+ data.tar.gz: 1d2a78847cb3f13dd1408a516869c04f62c22524e007cd744b963831e679e2c1
5
5
  SHA512:
6
- metadata.gz: ea7fdb00931000219950b3f1f01ba810e8aa7731806da9cbb2b204e675072703bbe0a800f7ad27eafc761ca48a5847e473685f284cc62ee54515fad50260249f
7
- data.tar.gz: 1bfc65beb552a2cd3303e059fa385bebfb5b851caae52f900550c473a4a8ffaacad4f488d4b7509164c42e8ae4a5618c060c7ec323564878c97fd86eae899eaf
6
+ metadata.gz: 37509516f9cf6398b348c3a9b548825a291fd6a764e581bbb746c74c27cba32e684b1aa11ec5e917f5a8641ff32d366d137d7d664eac3497b632dba21120fda5
7
+ data.tar.gz: ae00ed5d33af32f25b84ef8d5ef856753fbe6e27ebcec3a68c020ac38cec09b6caa8cf2a339710390840977febcc0510ca073c43a8e80255e2bb6ba6123bdbae
data/CHANGELOG.md CHANGED
@@ -1,5 +1,125 @@
1
1
  ## unreleased
2
2
 
3
+ ## 7.0.9 (2024-03-13)
4
+
5
+ - Add following locales:
6
+ - Welsh (cy)
7
+ - Fix empty `am` and `pm` keys to make dates/times in the 12-hour time format distinguishable in every locale #1105
8
+ - Update following locales:
9
+ - Afrikaans (af): Fix translation of May #1110
10
+ - Czech (cs): Capitalise date day and month names for consistency #1113
11
+ - Traditional Chinese (zh-HK, zh-TW, zh-YUE): Use traditional "week" character in `date.abbr_day_names` #1112
12
+ - Italian (it): Fix translation for `second` prompt #1111
13
+ - Bosnian (bs): am/pm
14
+ - Danish (da): am/pm
15
+ - Galician (gl): am/pm
16
+ - Icelandic (is): am/pm
17
+ - Norwegian Bokmål (nb): am/pm
18
+ - Norwegian Nynorsk (nn): am/pm
19
+ - Portuguese (pt-BR): am/pm
20
+ - Romanian (ro): am/pm
21
+ - Swedish (sv sv-FI sv-SE): am/pm
22
+ - Welsh (cy): Move the keys to right place and add missing keys
23
+ - Danish (da): Remove title case for storage and human decimal units #1108
24
+ - Add ordinalization for many locales (be, bs, cs, da, de-AT, de-CH, de-DE, eo, et, fa, fi, hr, hu, is, ka,
25
+ lb, lt, lv, mk, nb, ne, nn, pl, sk, sl, sq, sr, sw, tr) #1109
26
+
27
+ ## 7.0.8 (2023-08-15)
28
+
29
+ - Update following locales:
30
+ - Bengali (bn): Add missing keys (`almost_x_years`) #1094
31
+ - English (en-US): Normalize and add missing keys (`in` and `round_mode`) #1095
32
+ - Korean (ko): Add missing keys (`in` and `round_mode`) #1097
33
+ - Norwegian (nb): Fix extra `%{count}` interpolation in `has_one` key #1082
34
+ - Portuguese (pt pt-BR): Add missing keys (`round_mode`) #1100
35
+ - Spanish (es-419 es-AR es-CL es-CO es-CR es-EC es-MX es-NI es-PA es-PE es-US es-VE): Fix typo in word _carácter_ #1090
36
+ - 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): Normalize and add missing keys (`in`) #1089
37
+ - Ukranian: Use hryvnia symbol as a currency unit #1093
38
+
39
+ ## 7.0.7 (2023-05-12)
40
+
41
+ - Non-numerics counts are considered as `other` in all pluralizations #1067
42
+ - Update following locales:
43
+ - Afrikaan (af): ZAR currency format #1066
44
+ - English (en-ZA): ZAR currency format #1066
45
+ - German (de, de-DE, de-AT, de-CH): Use abbreviated months in the short time format #1062
46
+ - Japanese (ja): Add `in` and `round_mode` keys #1059
47
+ - Korean (ko): Fix typo in `equal_to` keys #1061
48
+ - Portuguese (pt, pt-BR): add translation for `errors.messages.in` #1071
49
+ - Scottish Gaelic (gd): Add locale
50
+ - Russian (ru): fix some errors in 'datetime' section, add `errors.messages.in` and `number.format.round_mode` keys #1077
51
+ - Spanish (es): add translation for `errors.messages.in` #1071
52
+ - French (fr, fr-CA, fr-CH, fr-FR): fix typo on 'almost_x_years: one' #1074
53
+ - Indonesian (id): Remove duplicate spaces in `id.datetime.distance_in_words.less_than_x_minutes.other` #1079
54
+ - Romanian (ro): Correction of Saturday in Romanian #1078
55
+ - Croatian (hr): use lowercase for month and weekday names #1081
56
+ - Add ordinalization for German (de, de-AT, de-CH, de-DE)
57
+ - Remove keys that are present twice from Latvian (lv), Albanian (sq) #1080
58
+
59
+ ## 7.0.6 (2022-11-08)
60
+
61
+ - Add option to choose which modules (locales, pluralization, transliteration,
62
+ ordinals) are enabled #1019
63
+ - Add following locales:
64
+ - Dzongkha (dz) #1052
65
+ - Sardinian (sc) #1030
66
+ - Swedish (sv-FI): Finland’s native Swedish-speakers #1055
67
+ - Update following locales:
68
+ - Bengali (bn): Fix date and spelling issues #1031
69
+ - Chinese (zh-HK, zh-TW, zh-YUE, zh-CN):
70
+ - Simplify pluralization #1032 #1033 #1036
71
+ - Standardize punctuation #997
72
+ - English (en, en-CY, en-IE, en-TT, en-US, en-ZA):
73
+ - Add pluralization #1021
74
+ - Add `in` and `round_mode` keys #1042
75
+ - French (fr, fr-CA, fr-CH, fr-CA):
76
+ - Change an abreviation for March month in abbr_month_names #1002
77
+ - Add `in` and `round_mode` keys #1046
78
+ - Galician (gl): Add missing accent on `incluído` #961
79
+ - German (de-AT, de-CH, de-DE, de):
80
+ - Add transliteration rule for `ẞ` #1025
81
+ - Add `eb` and `pb` storage units #1043
82
+ - Add `round_mode` key #1044
83
+ - Greek (el-CY): Add pluralization #1022
84
+ - Japanese (ja): Simplify pluralization #1038
85
+ - Korean (ko):
86
+ - Language improvements #989
87
+ - Simplify pluralization #1037
88
+ - Latvian (lv): Add multiple missing translations #966
89
+ - Spanish (es, es-419, es-AR, es-CL, es-CO, es-CR, es-ES, es-MX, es-NI, es-PA,
90
+ es-PE, es-US, es-VE): Add `round_mode` key #1045
91
+ - Swedish (sv-SE): Adjust precision and add some missing keys #1047
92
+ - Vietnamese (vi):
93
+ - Update translation for taken #1009
94
+ - Simplify pluralization #1035
95
+ - Removed pluralizations rules that do not have locale files: ak, am, bh, bm,
96
+ bo, br, by, cy, dz, ff, ga, gd, guw, gv, ig, ii, iu, jv, kab, kde, kea, ksh,
97
+ kw, lag, ln, mo, mt, my, naq, nso, root, sah, se, ses, sg, sh, shi, sma, smi,
98
+ smj, smn, sms, ti, to, tzm, wa, yo, zh #1017
99
+ - Change instances of the `one` pluralization key to use `%{count}` interpolation #993
100
+
101
+ ## 7.0.5 (2022-07-03)
102
+
103
+ - No changes.
104
+
105
+ ## 7.0.4 (2022-07-03)
106
+
107
+ - Add following locales:
108
+ - Western Frisian (fy) #985
109
+ - Kazakh (kk) #945
110
+ - Update following locales:
111
+ - Slovak (sk): Fixed missing message #994
112
+ - French (fr): Revert remainder of NBSP characters #996
113
+ - French (fr): Use no-padded date format #991
114
+ - Arabic (ar): fix errors.messages.greater_than typo #998
115
+ - South slavic pluralizers #987
116
+ - Update update.rb to fetch active_model locale #1000
117
+ - Remove eager loading of translations during boot phase (this is now done by Rails). #983
118
+
119
+ ## 7.0.3 (2022-03-01)
120
+
121
+ - Revert long date formats on default "en" locale #980
122
+
3
123
  ## 7.0.2 (2022-02-12)
4
124
 
5
125
  - Fix long date format for many locales #939 #943
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.svg)](http://travis-ci.org/svenfuchs/rails-i18n)
5
+ [![CI](https://github.com/svenfuchs/rails-i18n/actions/workflows/ci.yml/badge.svg)](https://github.com/svenfuchs/rails-i18n/actions/workflows/ci.yml)
6
6
 
7
7
  Centralization of locale data collection for Ruby on Rails.
8
8
 
@@ -35,6 +35,31 @@ Note that your Ruby on Rails version must be 3.0 or higher in order to install t
35
35
 
36
36
  ## Configuration
37
37
 
38
+ ### Enabled modules
39
+
40
+ By default, all `rails-i18n` modules (locales, pluralization, transliteration, ordinals) are enabled.
41
+
42
+ If you would like to only enable specific modules, you can do so in your Rails configuration:
43
+
44
+ ```ruby
45
+ # to enable only pluralization rules, but disable all other features
46
+ config.rails_i18n.enabled_modules = [:pluralization]
47
+
48
+ # to enable pluralization and ordinals
49
+ config.rails_i18n.enabled_modules = [:pluralization, :ordinals]
50
+ ```
51
+
52
+ The possible module names:
53
+
54
+ * `:locale`
55
+ * `:ordinals`
56
+ * `:pluralization`
57
+ * `:transliteration`
58
+
59
+ Setting `enabled_modules` will restrict the gem's loaded features to only the specific types.
60
+
61
+ ### Available locales
62
+
38
63
  `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:
39
64
 
40
65
  ``` ruby
@@ -61,21 +86,24 @@ Locale data whose structure is compatible with Rails 2.3 are available on the se
61
86
 
62
87
  ## Available Locales
63
88
 
64
- Available locales:
89
+ **Available locales:**
90
+
91
+ af, ar, az, be, bg, bn, bs, ca, cs, cy, csb, da, de, de-AT, de-CH, de-DE, dsb, dz, el, el-CY, en, en-AU, en-CA, en-CY, en-GB, en-IE, en-IN, en-NZ, en-TT, en-US, en-ZA, eo, es, 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, et, eu, fa, fi, fr, fr-CA, fr-CH, fr-FR, fur, fy, gd, gl, gsw-CH, he, hi, hi-IN, hr, hsb, hu, id, is, it, it-CH, ja, ka, kk, km, kn, ko, lb, lo, lt, lv, mg, mk, ml, mn, mr-IN, ms, nb, ne, nl, nn, oc, or, pa, pap-AW, pap-CW, pl, pt, pt-BR, rm, ro, ru, sc, scr, sk, sl, sq, sr, st, sv, sv-FI, sv-SE, sw, ta, te, th, tl, tr, tt, ug, uk, ur, uz, vi, wo, zh-CN, zh-HK, zh-TW, zh-YUE
92
+
93
+ **Complete locales:**
94
+
95
+ en, en-US, es, 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, fr, fr-CA, fr-CH, fr-FR, gd, ja, pt, pt-BR, ru, sc
65
96
 
66
- > af, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, de-AT, de-CH, de-DE, el, el-CY,
67
- > en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-US, en-ZA, en-CY, en-TT, eo, es,
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,
69
- > et, eu, fa, fi, fr, fr-CA, fr-CH, fr-FR, gl, he, hi, hi-IN, hr, hu, id, is, it,
70
- > it-CH, ja, ka, km, kn, ko, lb, lo, lt, lv, mk, ml, mn, mr-IN, ms, nb, ne, nl, nn, oc, or,
71
- > pa, pl, pt, pt-BR, rm, ro, ru, sk, sl, sq, sr, st, sw, ta, te, th, tl, tr, tt, ug,
72
- > ur, uz, vi, wo, zh-CN, zh-HK, zh-TW, zh-YUE
97
+ **Locales with missing pluralization rules**
73
98
 
74
- Complete locales:
99
+ af, csb, dsb, dz, fur, gsw-CH, lb, rm, scr, sq, sv-FI, te, tt, ug, uz
100
+
101
+ **Removed pluralizations:**
102
+
103
+ ak, am, bh, bm, bo, br, by, cy, dz, ff, ga, gd, guw, gv, ig, ii, iu, jv, kab, kde, kea, ksh, kw, lag, ln, mo, mt, my, naq, nso, root, sah, se, ses, sg, sh, shi, sma, smi, smj, smn, sms, ti, to, tzm, wa, yo, zh
104
+
105
+ The above pluralization rules were removed because they did not have corresponding locale files.
75
106
 
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,
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
79
107
 
80
108
  Currently, most locales are incomplete. Typically they lack the following keys:
81
109
 
@@ -219,7 +247,6 @@ To run the other commands described above:
219
247
 
220
248
  ```
221
249
  docker run railsi18n bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
222
-
223
250
  ```
224
251
 
225
252
  ## See also
@@ -1,12 +1,11 @@
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, Serbo-Croatian, Ukrainian.
4
+ # Used for Belarusian, Russian, Ukrainian.
5
5
 
6
6
  module RailsI18n
7
7
  module Pluralization
8
8
  module EastSlavic
9
-
10
9
  FROM_2_TO_4 = (2..4).to_a.freeze
11
10
  FROM_5_TO_9 = (5..9).to_a.freeze
12
11
  FROM_11_TO_14 = (11..14).to_a.freeze
@@ -14,7 +13,8 @@ module RailsI18n
14
13
 
15
14
  def self.rule
16
15
  lambda do |n|
17
- n ||= 0
16
+ return :other unless n.is_a?(Numeric)
17
+
18
18
  mod10 = n % 10
19
19
  mod100 = n % 100
20
20
 
@@ -1,12 +1,19 @@
1
1
  module RailsI18n
2
2
  module Pluralization
3
- module Serbian
3
+ module OneFewOther
4
4
  FROM_2_TO_4 = (2..4).to_a.freeze
5
5
  FROM_12_TO_14 = (12..14).to_a.freeze
6
6
 
7
7
  def self.rule
8
8
  lambda do |n|
9
- n ||= 0
9
+ return :other unless n.is_a?(Numeric)
10
+
11
+ frac = (n.to_d % 1)
12
+
13
+ if frac.nonzero?
14
+ n = frac.to_s.split('.').last.to_i
15
+ end
16
+
10
17
  mod10 = n % 10
11
18
  mod100 = n % 100
12
19
 
@@ -29,4 +36,4 @@ module RailsI18n
29
36
  end
30
37
  end
31
38
  end
32
- end
39
+ end
@@ -16,4 +16,4 @@ module RailsI18n
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -6,12 +6,10 @@ module RailsI18n
6
6
  module OneTwoOther
7
7
  def self.rule
8
8
  lambda do |n|
9
- if n == 1
10
- :one
11
- elsif n == 2
12
- :two
13
- else
14
- :other
9
+ case n
10
+ when 1 then :one
11
+ when 2 then :two
12
+ else :other
15
13
  end
16
14
  end
17
15
  end
@@ -25,4 +23,4 @@ module RailsI18n
25
23
  end
26
24
  end
27
25
  end
28
- end
26
+ end
@@ -4,7 +4,9 @@ module RailsI18n
4
4
  module Pluralization
5
5
  module OneUptoTwoOther
6
6
  def self.rule
7
- lambda { |n| n && n >= 0 && n < 2 ? :one : :other }
7
+ lambda do |n|
8
+ n.is_a?(Numeric) && n >= 0 && n < 2 ? :one : :other
9
+ end
8
10
  end
9
11
 
10
12
  def self.with_locale(locale)
@@ -16,4 +18,4 @@ module RailsI18n
16
18
  end
17
19
  end
18
20
  end
19
- end
21
+ end
@@ -5,7 +5,12 @@ module RailsI18n
5
5
  module Pluralization
6
6
  module OneWithZeroOther
7
7
  def self.rule
8
- lambda { |n| n == 0 || n == 1 ? :one : :other }
8
+ lambda do |n|
9
+ case n
10
+ when 0, 1 then :one
11
+ else :other
12
+ end
13
+ end
9
14
  end
10
15
 
11
16
  def self.with_locale(locale)
@@ -3,12 +3,15 @@
3
3
  module RailsI18n
4
4
  module Pluralization
5
5
  module Romanian
6
+ FROM_1_TO_19 = (1..19).to_a.freeze
7
+
6
8
  def self.rule
7
9
  lambda do |n|
8
- n ||= 0
10
+ return :other unless n.is_a?(Numeric)
11
+
9
12
  if n == 1
10
13
  :one
11
- elsif n == 0 || (1..19).to_a.include?(n % 100)
14
+ elsif n == 0 || FROM_1_TO_19.include?(n % 100)
12
15
  :few
13
16
  else
14
17
  :other
@@ -5,12 +5,10 @@ module RailsI18n
5
5
  module WestSlavic
6
6
  def self.rule
7
7
  lambda do |n|
8
- if n == 1
9
- :one
10
- elsif [2, 3, 4].include?(n)
11
- :few
12
- else
13
- :other
8
+ case n
9
+ when 1 then :one
10
+ when 2, 3, 4 then :few
11
+ else :other
14
12
  end
15
13
  end
16
14
  end
@@ -2,16 +2,19 @@ require 'rails'
2
2
 
3
3
  module RailsI18n
4
4
  class Railtie < ::Rails::Railtie #:nodoc:
5
- initializer 'rails-i18n' do |app|
6
- app.config.eager_load_namespaces << ::I18n if ::I18n.respond_to?(:eager_load!)
5
+ config.rails_i18n = RailsI18n
7
6
 
7
+ initializer 'rails-i18n' do |app|
8
8
  RailsI18n::Railtie.instance_eval do
9
9
  pattern = pattern_from app.config.i18n.available_locales
10
10
 
11
- add("rails/locale/#{pattern}.yml")
12
- add("rails/pluralization/#{pattern}.rb")
13
- add("rails/ordinals/#{pattern}.rb")
14
- add("rails/transliteration/#{pattern}.{rb,yml}")
11
+ if app.config.rails_i18n.enabled_modules.empty?
12
+ RailsI18n.enabled_modules = Set.new([:locale, :pluralization, :ordinals, :transliteration])
13
+ end
14
+
15
+ RailsI18n.enabled_modules.each do |feature|
16
+ add("rails/#{feature}/#{pattern}.{rb,yml}")
17
+ end
15
18
 
16
19
  init_pluralization_module
17
20
  end
data/lib/rails_i18n.rb CHANGED
@@ -1 +1,11 @@
1
+ module RailsI18n
2
+ def self.enabled_modules
3
+ @enabled_modules ||= Set.new
4
+ end
5
+
6
+ def self.enabled_modules=(other)
7
+ @enabled_modules = Set.new(other)
8
+ end
9
+ end
10
+
1
11
  require 'rails_i18n/railtie'
data/rails/locale/af.yml CHANGED
@@ -48,7 +48,7 @@ af:
48
48
  - Februarie
49
49
  - Maart
50
50
  - April
51
- - Mai
51
+ - Mei
52
52
  - Junie
53
53
  - Julie
54
54
  - Augustus
@@ -63,41 +63,41 @@ af:
63
63
  datetime:
64
64
  distance_in_words:
65
65
  about_x_hours:
66
- one: ongeveer 1 uur
66
+ one: ongeveer %{count} uur
67
67
  other: ongeveer %{count} ure
68
68
  about_x_months:
69
- one: ongeveer 1 maand
69
+ one: ongeveer %{count} maand
70
70
  other: ongeveer %{count} maande
71
71
  about_x_years:
72
- one: ongeveer 1 jaar
72
+ one: ongeveer %{count} jaar
73
73
  other: ongeveer %{count} jaar
74
74
  almost_x_years:
75
- one: sowat 1 jaar
75
+ one: sowat %{count} jaar
76
76
  other: sowat %{count} jaar
77
77
  half_a_minute: halfminuut
78
78
  less_than_x_seconds:
79
- one: minder as 1 sekonde
79
+ one: minder as %{count} sekonde
80
80
  other: minder as %{count} sekondes
81
81
  less_than_x_minutes:
82
- one: minder as 1 minuut
82
+ one: minder as %{count} minuut
83
83
  other: minder as %{count} minute
84
84
  over_x_years:
85
- one: meer as 1 jaar
85
+ one: meer as %{count} jaar
86
86
  other: meer as %{count} jaar
87
87
  x_seconds:
88
- one: 1 sekonde
88
+ one: "%{count} sekonde"
89
89
  other: "%{count} sekondes"
90
90
  x_minutes:
91
- one: 1 minuut
91
+ one: "%{count} minuut"
92
92
  other: "%{count} minute"
93
93
  x_days:
94
- one: 1 dag
94
+ one: "%{count} dag"
95
95
  other: "%{count} days"
96
96
  x_months:
97
- one: 1 maand
97
+ one: "%{count} maand"
98
98
  other: "%{count} maande"
99
99
  x_years:
100
- one: 1 jaar
100
+ one: "%{count} jaar"
101
101
  other: "%{count} jare"
102
102
  prompts:
103
103
  second: Sekondes
@@ -131,18 +131,18 @@ af:
131
131
  required: moet bestaan
132
132
  taken: is reeds geneem
133
133
  too_long:
134
- one: is te lank (maksimum is 1 karakter)
134
+ one: is te lank (maksimum is %{count} karakter)
135
135
  other: is te lank (maksimum is %{count} karakters)
136
136
  too_short:
137
- one: is te kort (minimum is 1 karakter)
137
+ one: is te kort (minimum is %{count} karakter)
138
138
  other: is te kort (minimum is %{count} karakters)
139
139
  wrong_length:
140
- one: is die verkeerde lengte (moet 1 karakter wees)
140
+ one: is die verkeerde lengte (moet %{count} karakter wees)
141
141
  other: is die verkeerde lengte (moet %{count} karakters wees)
142
142
  template:
143
143
  body: 'There were problems with the following fields:'
144
144
  header:
145
- one: 1 fout het verhoed dat hierdie %{model} gestoor kon word
145
+ one: "%{count} fout het verhoed dat hierdie %{model} gestoor kon word"
146
146
  other: "%{count} foute het verhoed dat hierdie %{model} gestoor kon word"
147
147
  helpers:
148
148
  select:
@@ -154,10 +154,10 @@ af:
154
154
  number:
155
155
  currency:
156
156
  format:
157
- delimiter: ","
158
- format: "%u%n"
157
+ delimiter: " "
158
+ format: "%u %n"
159
159
  precision: 2
160
- separator: "."
160
+ separator: ","
161
161
  significant: false
162
162
  strip_insignificant_zeros: false
163
163
  unit: R
data/rails/locale/ar.yml CHANGED
@@ -157,7 +157,7 @@ ar:
157
157
  equal_to: يجب أن يساوي طول %{attribute} %{count}
158
158
  even: يجب أن يكون عدد %{attribute} زوجياً
159
159
  exclusion: حقل %{attribute} محجوز
160
- greater_than: ميجب أن يكون عدد %{attribute} أكبر من %{count}
160
+ greater_than: يجب أن يكون عدد %{attribute} أكبر من %{count}
161
161
  greater_than_or_equal_to: يجب أن يكون عدد %{attribute} أكبر أو يساوي %{count}
162
162
  inclusion: "%{attribute} غير وارد في القائمة"
163
163
  invalid: محتوى %{attribute} غير صالح
data/rails/locale/az.yml CHANGED
@@ -63,38 +63,38 @@ az:
63
63
  datetime:
64
64
  distance_in_words:
65
65
  about_x_hours:
66
- one: təxminən 1 saat
66
+ one: təxminən %{count} saat
67
67
  other: təxminən %{count} saat
68
68
  about_x_months:
69
- one: təxminən 1 ay
69
+ one: təxminən %{count} ay
70
70
  other: təxminən %{count} ay
71
71
  about_x_years:
72
- one: təxminən 1 il
72
+ one: təxminən %{count} il
73
73
  other: təxminən %{count} il
74
74
  almost_x_years:
75
- one: təqribən 1 il
75
+ one: təqribən %{count} il
76
76
  other: təqribən %{count} il
77
77
  half_a_minute: yarım dəqiqə
78
78
  less_than_x_seconds:
79
- one: 1 saniyədən az
79
+ one: "%{count} saniyədən az"
80
80
  other: "%{count} saniyədən az"
81
81
  less_than_x_minutes:
82
- one: 1 dəqiqədən az
82
+ one: "%{count} dəqiqədən az"
83
83
  other: "%{count} dəqiqədən az"
84
84
  over_x_years:
85
- one: 1 ildən çox
85
+ one: "%{count} ildən çox"
86
86
  other: "%{count} ildən çox"
87
87
  x_seconds:
88
- one: 1 saniyə
88
+ one: "%{count} saniyə"
89
89
  other: "%{count} saniyə"
90
90
  x_minutes:
91
- one: 1 dəqiqə
91
+ one: "%{count} dəqiqə"
92
92
  other: "%{count} dəqiqə"
93
93
  x_days:
94
- one: 1 gün
94
+ one: "%{count} gün"
95
95
  other: "%{count} gün"
96
96
  x_months:
97
- one: 1 ay
97
+ one: "%{count} ay"
98
98
  other: "%{count} ay"
99
99
  prompts:
100
100
  second: Saniyə
@@ -133,7 +133,7 @@ az:
133
133
  template:
134
134
  body: 'Aşağıdaki səhvlər üzə çıxdı:'
135
135
  header:
136
- one: "%{model} saxlanmadı: 1 səhv"
136
+ one: "%{model} saxlanmadı: %{count} səhv"
137
137
  other: "%{model} saxlanmadı: %{count} səhv"
138
138
  helpers:
139
139
  select:
data/rails/locale/bg.yml CHANGED
@@ -60,38 +60,38 @@ bg:
60
60
  datetime:
61
61
  distance_in_words:
62
62
  about_x_hours:
63
- one: около 1 час
63
+ one: около %{count} час
64
64
  other: около %{count} часа
65
65
  about_x_months:
66
- one: около 1 месец
66
+ one: около %{count} месец
67
67
  other: около %{count} месеца
68
68
  about_x_years:
69
- one: около 1 година
69
+ one: около %{count} година
70
70
  other: около %{count} години
71
71
  almost_x_years:
72
- one: почти 1 година
72
+ one: почти %{count} година
73
73
  other: почти %{count} години
74
74
  half_a_minute: половин минута
75
75
  less_than_x_seconds:
76
- one: по-малко от 1 секунда
76
+ one: по-малко от %{count} секунда
77
77
  other: по-малко от %{count} секунди
78
78
  less_than_x_minutes:
79
- one: по-малко от 1 минута
79
+ one: по-малко от %{count} минута
80
80
  other: по-малко от %{count} минути
81
81
  over_x_years:
82
- one: над 1 година
82
+ one: над %{count} година
83
83
  other: над %{count} години
84
84
  x_seconds:
85
- one: 1 секунда
85
+ one: "%{count} секунда"
86
86
  other: "%{count} секунди"
87
87
  x_minutes:
88
- one: 1 минута
88
+ one: "%{count} минута"
89
89
  other: "%{count} минути"
90
90
  x_days:
91
- one: 1 ден
91
+ one: "%{count} ден"
92
92
  other: "%{count} дни"
93
93
  x_months:
94
- one: 1 месец
94
+ one: "%{count} месец"
95
95
  other: "%{count} месеца"
96
96
  prompts:
97
97
  second: Секунда
@@ -126,7 +126,7 @@ bg:
126
126
  template:
127
127
  body: 'Възникнаха проблеми със следните полета:'
128
128
  header:
129
- one: "%{model}: записът е неуспешен заради 1 грешка"
129
+ one: "%{model}: записът е неуспешен заради %{count} грешка"
130
130
  other: "%{model}: записът е неуспешен заради %{count} грешки"
131
131
  helpers:
132
132
  select: