rails-i18n 6.0.0 → 7.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +159 -1
  3. data/README.md +97 -16
  4. data/lib/rails_i18n/common_pluralizations/east_slavic.rb +3 -3
  5. data/lib/rails_i18n/common_pluralizations/one_few_other.rb +39 -0
  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 -3
  13. data/lib/rails_i18n.rb +10 -1
  14. data/rails/locale/af.yml +22 -22
  15. data/rails/locale/ar.yml +3 -3
  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 +6 -6
  20. data/rails/locale/ca.yml +44 -20
  21. data/rails/locale/cy.yml +83 -78
  22. data/rails/locale/da.yml +20 -12
  23. data/rails/locale/de-AT.yml +7 -4
  24. data/rails/locale/de-CH.yml +7 -4
  25. data/rails/locale/de-DE.yml +7 -4
  26. data/rails/locale/de.yml +8 -5
  27. data/rails/locale/dz.yml +213 -0
  28. data/rails/locale/el-CY.yml +23 -10
  29. data/rails/locale/el.yml +21 -8
  30. data/rails/locale/en-AU.yml +15 -15
  31. data/rails/locale/en-CA.yml +16 -16
  32. data/rails/locale/en-CY.yml +15 -15
  33. data/rails/locale/en-GB.yml +15 -15
  34. data/rails/locale/en-IE.yml +15 -15
  35. data/rails/locale/en-IN.yml +18 -18
  36. data/rails/locale/en-NZ.yml +15 -15
  37. data/rails/locale/en-TT.yml +213 -0
  38. data/rails/locale/en-US.yml +19 -17
  39. data/rails/locale/en-ZA.yml +21 -21
  40. data/rails/locale/en.yml +17 -15
  41. data/rails/locale/eo.yml +5 -5
  42. data/rails/locale/es-419.yml +20 -18
  43. data/rails/locale/es-AR.yml +21 -19
  44. data/rails/locale/es-CL.yml +21 -19
  45. data/rails/locale/es-CO.yml +27 -25
  46. data/rails/locale/es-CR.yml +20 -18
  47. data/rails/locale/es-EC.yml +20 -18
  48. data/rails/locale/es-ES.yml +21 -19
  49. data/rails/locale/es-MX.yml +20 -18
  50. data/rails/locale/es-NI.yml +20 -18
  51. data/rails/locale/es-PA.yml +20 -18
  52. data/rails/locale/es-PE.yml +20 -18
  53. data/rails/locale/es-US.yml +20 -18
  54. data/rails/locale/es-VE.yml +20 -18
  55. data/rails/locale/es.yml +21 -19
  56. data/rails/locale/eu.yml +4 -4
  57. data/rails/locale/fa.yml +2 -2
  58. data/rails/locale/fi.yml +16 -16
  59. data/rails/locale/fr-CA.yml +12 -10
  60. data/rails/locale/fr-CH.yml +12 -10
  61. data/rails/locale/fr-FR.yml +12 -10
  62. data/rails/locale/fr.yml +16 -14
  63. data/rails/locale/fy.yml +215 -0
  64. data/rails/locale/gd.yml +252 -0
  65. data/rails/locale/gl.yml +13 -13
  66. data/rails/locale/hi-IN.yml +5 -5
  67. data/rails/locale/hi.yml +5 -5
  68. data/rails/locale/hr.yml +59 -50
  69. data/rails/locale/hu.yml +12 -12
  70. data/rails/locale/id.yml +7 -7
  71. data/rails/locale/is.yml +14 -14
  72. data/rails/locale/it-CH.yml +23 -10
  73. data/rails/locale/it.yml +16 -15
  74. data/rails/locale/ja.yml +15 -39
  75. data/rails/locale/ka.yml +16 -16
  76. data/rails/locale/kk.yml +225 -0
  77. data/rails/locale/kn.yml +8 -8
  78. data/rails/locale/ko.yml +34 -58
  79. data/rails/locale/lb.yml +7 -7
  80. data/rails/locale/lo.yml +13 -85
  81. data/rails/locale/lt.yml +8 -8
  82. data/rails/locale/lv.yml +12 -2
  83. data/rails/locale/mg.yml +6 -6
  84. data/rails/locale/mk.yml +2 -2
  85. data/rails/locale/ml.yml +13 -13
  86. data/rails/locale/mn.yml +15 -15
  87. data/rails/locale/mr-IN.yml +5 -5
  88. data/rails/locale/ms.yml +13 -13
  89. data/rails/locale/nb.yml +26 -20
  90. data/rails/locale/ne.yml +18 -18
  91. data/rails/locale/nl.yml +7 -7
  92. data/rails/locale/nn.yml +10 -10
  93. data/rails/locale/oc.yml +1 -1
  94. data/rails/locale/or.yml +12 -12
  95. data/rails/locale/pa.yml +18 -18
  96. data/rails/locale/pap-AW.yml +215 -0
  97. data/rails/locale/pap-CW.yml +215 -0
  98. data/rails/locale/pl.yml +27 -27
  99. data/rails/locale/pt-BR.yml +19 -17
  100. data/rails/locale/pt.yml +16 -14
  101. data/rails/locale/rm.yml +2 -2
  102. data/rails/locale/ro.yml +60 -60
  103. data/rails/locale/ru.yml +17 -15
  104. data/rails/locale/sc.yml +223 -0
  105. data/rails/locale/sk.yml +1 -0
  106. data/rails/locale/sl.yml +10 -10
  107. data/rails/locale/sq.yml +21 -25
  108. data/rails/locale/sr.yml +2 -2
  109. data/rails/locale/st.yml +215 -0
  110. data/rails/locale/sv-FI.yml +207 -0
  111. data/rails/locale/sv-SE.yml +4 -1
  112. data/rails/locale/sv.yml +8 -5
  113. data/rails/locale/sw.yml +9 -9
  114. data/rails/locale/ta.yml +13 -13
  115. data/rails/locale/te.yml +3 -3
  116. data/rails/locale/tr.yml +16 -16
  117. data/rails/locale/uk.yml +5 -5
  118. data/rails/locale/ur.yml +2 -2
  119. data/rails/locale/uz.yml +1 -1
  120. data/rails/locale/vi.yml +14 -37
  121. data/rails/locale/wo.yml +18 -18
  122. data/rails/locale/zh-CN.yml +29 -29
  123. data/rails/locale/zh-HK.yml +28 -60
  124. data/rails/locale/zh-TW.yml +32 -64
  125. data/rails/locale/zh-YUE.yml +23 -55
  126. data/rails/ordinals/de-AT.rb +15 -0
  127. data/rails/ordinals/de-CH.rb +15 -0
  128. data/rails/ordinals/de-DE.rb +15 -0
  129. data/rails/ordinals/de.rb +15 -0
  130. data/rails/ordinals/fr-CA.rb +19 -0
  131. data/rails/ordinals/fr-CH.rb +19 -0
  132. data/rails/ordinals/fr-FR.rb +19 -0
  133. data/rails/ordinals/fr.rb +19 -0
  134. data/rails/ordinals/gd.rb +24 -0
  135. data/rails/pluralization/ar.rb +3 -2
  136. data/rails/pluralization/bs.rb +2 -2
  137. data/rails/pluralization/el-CY.rb +3 -0
  138. data/rails/pluralization/en-CY.rb +3 -0
  139. data/rails/pluralization/en-IE.rb +3 -0
  140. data/rails/pluralization/en-TT.rb +3 -0
  141. data/rails/pluralization/en-US.rb +3 -0
  142. data/rails/pluralization/en-ZA.rb +3 -0
  143. data/rails/pluralization/fy.rb +3 -0
  144. data/rails/pluralization/gd.rb +8 -4
  145. data/rails/pluralization/hr.rb +2 -2
  146. data/rails/pluralization/hsb.rb +7 -9
  147. data/rails/pluralization/ka.rb +2 -2
  148. data/rails/pluralization/kk.rb +3 -0
  149. data/rails/pluralization/lt.rb +3 -2
  150. data/rails/pluralization/lv.rb +1 -2
  151. data/rails/pluralization/mk.rb +2 -3
  152. data/rails/pluralization/pap-AW.rb +3 -0
  153. data/rails/pluralization/pap-CW.rb +3 -0
  154. data/rails/pluralization/pl.rb +4 -3
  155. data/rails/pluralization/pt-BR.rb +3 -0
  156. data/rails/pluralization/sc.rb +3 -0
  157. data/rails/pluralization/sl.rb +7 -11
  158. data/rails/pluralization/sr.rb +2 -2
  159. data/rails/pluralization/st.rb +3 -0
  160. data/rails/pluralization/ta.rb +3 -0
  161. data/rails/pluralization/tr.rb +2 -2
  162. data/rails/transliteration/da.yml +10 -0
  163. data/rails/transliteration/de.yml +1 -0
  164. data/rails/transliteration/ka.yml +37 -0
  165. data/rails/transliteration/uk.rb +5 -21
  166. metadata +44 -57
  167. data/lib/rails_i18n/unicode.rb +0 -1
  168. data/rails/pluralization/ak.rb +0 -3
  169. data/rails/pluralization/am.rb +0 -3
  170. data/rails/pluralization/bh.rb +0 -3
  171. data/rails/pluralization/bm.rb +0 -3
  172. data/rails/pluralization/bo.rb +0 -3
  173. data/rails/pluralization/br.rb +0 -31
  174. data/rails/pluralization/by.rb +0 -3
  175. data/rails/pluralization/cy.rb +0 -24
  176. data/rails/pluralization/dz.rb +0 -3
  177. data/rails/pluralization/ff.rb +0 -3
  178. data/rails/pluralization/ga.rb +0 -27
  179. data/rails/pluralization/guw.rb +0 -3
  180. data/rails/pluralization/gv.rb +0 -22
  181. data/rails/pluralization/ig.rb +0 -3
  182. data/rails/pluralization/ii.rb +0 -3
  183. data/rails/pluralization/iu.rb +0 -3
  184. data/rails/pluralization/jv.rb +0 -3
  185. data/rails/pluralization/kab.rb +0 -3
  186. data/rails/pluralization/kde.rb +0 -3
  187. data/rails/pluralization/kea.rb +0 -3
  188. data/rails/pluralization/ksh.rb +0 -23
  189. data/rails/pluralization/kw.rb +0 -3
  190. data/rails/pluralization/lag.rb +0 -24
  191. data/rails/pluralization/ln.rb +0 -3
  192. data/rails/pluralization/mo.rb +0 -3
  193. data/rails/pluralization/mt.rb +0 -28
  194. data/rails/pluralization/my.rb +0 -3
  195. data/rails/pluralization/naq.rb +0 -3
  196. data/rails/pluralization/nso.rb +0 -3
  197. data/rails/pluralization/root.rb +0 -3
  198. data/rails/pluralization/sah.rb +0 -3
  199. data/rails/pluralization/se.rb +0 -3
  200. data/rails/pluralization/ses.rb +0 -3
  201. data/rails/pluralization/sg.rb +0 -3
  202. data/rails/pluralization/sh.rb +0 -3
  203. data/rails/pluralization/shi.rb +0 -3
  204. data/rails/pluralization/sma.rb +0 -3
  205. data/rails/pluralization/smi.rb +0 -3
  206. data/rails/pluralization/smj.rb +0 -3
  207. data/rails/pluralization/smn.rb +0 -3
  208. data/rails/pluralization/sms.rb +0 -3
  209. data/rails/pluralization/ti.rb +0 -3
  210. data/rails/pluralization/to.rb +0 -3
  211. data/rails/pluralization/tzm.rb +0 -21
  212. data/rails/pluralization/wa.rb +0 -3
  213. data/rails/pluralization/yo.rb +0 -3
  214. data/rails/pluralization/zh.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee19c3e12af2df667aee302cd2ceb258b0fac9f63d81595ebc6b9fdc0faaebc3
4
- data.tar.gz: 8eb2bc8d881c9d03d42872498d4c84e84417dedab91e638e76519ef88a013ab7
3
+ metadata.gz: 4f2372c8dc0085d63c3ad30eb3750006e7c0abb57c4055723ab538d9c18904ba
4
+ data.tar.gz: 4f423f6f72839024985293a1575d057bee2b1ece64ba19b86d6662645e04ca69
5
5
  SHA512:
6
- metadata.gz: bece6a3c544315a02a4466bfc68d8e1466e3f1810c99ecdfc60cf542f460b43878f4560d4bcb99d136c31b843e4063b25801497bc5c42e410f5ed710ab538509
7
- data.tar.gz: a429e15a78bbe0490319f5bb63576a2471affbda7e978231db67b5cce9147c6b456d192cf79dff46bf91861ac22ab9993d1d42eacdfe003bfd311ce0edb08373
6
+ metadata.gz: b4e22bfeb4e222a7d95daa19c8a0f8d8fbb844a9a0c2ef425cf1fa8e0b06a84ca7aea71b07df74363fccfeb87dbaff80c473c3625264e0709918474b8a736616
7
+ data.tar.gz: 2f19acdb1b35a82e8c225dcf58c7ae113b6617791a91ce357c01f5e3c742611e8b5ca074e905dfd82f1a2e97d7a088d6733e97df3c68c8f6c991db9f58c3e0d1
data/CHANGELOG.md CHANGED
@@ -1,4 +1,162 @@
1
- ## 6.0.0
1
+ ## unreleased
2
+
3
+
4
+ ## 7.0.8 (2022-08-15)
5
+
6
+ - Update following locales:
7
+ - Bengali (bn): Add missing keys (`almost_x_years`) #1094
8
+ - English (en-US): Normalize and add missing keys (`in` and `round_mode`) #1095
9
+ - Korean (ko): Add missing keys (`in` and `round_mode`) #1097
10
+ - Norwegian (nb): Fix extra `%{count}` interpolation in `has_one` key #1082
11
+ - Portuguese (pt pt-BR): Add missing keys (`round_mode) #1100
12
+ - 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
13
+ - 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
14
+ - Ukranian: Use hryvnia symbol as a currency unit #1093
15
+
16
+ ## 7.0.7 (2022-05-12)
17
+
18
+ - Non-numerics counts are considered as `other` in all pluralizations #1067
19
+ - Update following locales:
20
+ - Afrikaan (af): ZAR currency format #1066
21
+ - English (en-ZA): ZAR currency format #1066
22
+ - German (de, de-DE, de-AT, de-CH): Use abbreviated months in the short time format #1062
23
+ - Japanese (ja): Add `in` and `round_mode` keys #1059
24
+ - Korean (ko): Fix typo in `equal_to` keys #1061
25
+ - Portuguese (pt, pt-BR): add translation for `errors.messages.in` #1071
26
+ - Scottish Gaelic (gd): Add locale
27
+ - Russian (ru): fix some errors in 'datetime' section, add `errors.messages.in` and `number.format.round_mode` keys #1077
28
+ - Spanish (es): add translation for `errors.messages.in` #1071
29
+ - French (fr, fr-CA, fr-CH, fr-FR): fix typo on 'almost_x_years: one' #1074
30
+ - Indonesian (id): Remove duplicate spaces in `id.datetime.distance_in_words.less_than_x_minutes.other` #1079
31
+ - Romanian (ro): Correction of Saturday in Romanian #1078
32
+ - Croatian (hr): use lowercase for month and weekday names #1081
33
+ - Add ordinalization for German (de, de-AT, de-CH, de-DE)
34
+ - Remove keys that are present twice from Latvian (lv), Albanian (sq) #1080
35
+
36
+ ## 7.0.6 (2022-11-08)
37
+
38
+ - Add option to choose which modules (locales, pluralization, transliteration,
39
+ ordinals) are enabled #1019
40
+ - Add following locales:
41
+ - Dzongkha (dz) #1052
42
+ - Sardinian (sc) #1030
43
+ - Swedish (sv-FI): Finland’s native Swedish-speakers #1055
44
+ - Update following locales:
45
+ - Bengali (bn): Fix date and spelling issues #1031
46
+ - Chinese (zh-HK, zh-TW, zh-YUE, zh-CN):
47
+ - Simplify pluralization #1032 #1033 #1036
48
+ - Standardize punctuation #997
49
+ - English (en, en-CY, en-IE, en-TT, en-US, en-ZA):
50
+ - Add pluralization #1021
51
+ - Add `in` and `round_mode` keys #1042
52
+ - French (fr, fr-CA, fr-CH, fr-CA):
53
+ - Change an abreviation for March month in abbr_month_names #1002
54
+ - Add `in` and `round_mode` keys #1046
55
+ - Galician (gl): Add missing accent on `incluído` #961
56
+ - German (de-AT, de-CH, de-DE, de):
57
+ - Add transliteration rule for `ẞ` #1025
58
+ - Add `eb` and `pb` storage units #1043
59
+ - Add `round_mode` key #1044
60
+ - Greek (el-CY): Add pluralization #1022
61
+ - Japanese (ja): Simplify pluralization #1038
62
+ - Korean (ko):
63
+ - Language improvements #989
64
+ - Simplify pluralization #1037
65
+ - Latvian (lv): Add multiple missing translations #966
66
+ - Spanish (es, es-419, es-AR, es-CL, es-CO, es-CR, es-ES, es-MX, es-NI, es-PA,
67
+ es-PE, es-US, es-VE): Add `round_mode` key #1045
68
+ - Swedish (sv-SE): Adjust precision and add some missing keys #1047
69
+ - Vietnamese (vi):
70
+ - Update translation for taken #1009
71
+ - Simplify pluralization #1035
72
+ - Removed pluralizations rules that do not have locale files: ak, am, bh, bm,
73
+ bo, br, by, cy, dz, ff, ga, gd, guw, gv, ig, ii, iu, jv, kab, kde, kea, ksh,
74
+ kw, lag, ln, mo, mt, my, naq, nso, root, sah, se, ses, sg, sh, shi, sma, smi,
75
+ smj, smn, sms, ti, to, tzm, wa, yo, zh #1017
76
+ - Change instances of the `one` pluralization key to use `%{count}` interpolation #993
77
+
78
+ ## 7.0.5 (2022-07-03)
79
+
80
+ - No changes.
81
+
82
+ ## 7.0.4 (2022-07-03)
83
+
84
+ - Add following locales:
85
+ - Western Frisian (fy) #985
86
+ - Kazakh (kk) #945
87
+ - Update following locales:
88
+ - Slovak (sk): Fixed missing message #994
89
+ - French (fr): Revert remainder of NBSP characters #996
90
+ - French (fr): Use no-padded date format #991
91
+ - Arabic (ar): fix errors.messages.greater_than typo #998
92
+ - South slavic pluralizers #987
93
+ - Update update.rb to fetch active_model locale #1000
94
+ - Remove eager loading of translations during boot phase (this is now done by Rails). #983
95
+
96
+ ## 7.0.3 (2022-03-01)
97
+
98
+ - Revert long date formats on default "en" locale #980
99
+
100
+ ## 7.0.2 (2022-02-12)
101
+
102
+ - Fix long date format for many locales #939 #943
103
+ - Update following locales:
104
+ - Chinese (zh-TW) #941
105
+ - Croatian (hr) #940
106
+ - Danish (da) #802 #946 #947 #948
107
+ - Finnish (fi) #949
108
+ - French (fr) #968
109
+ - Galician (gl) #961
110
+ - Papiamento (pap-AW, pap-CW) #974 #975
111
+ - Serbian (sr) #972
112
+ - Spanish (es, es-CL, es-ES) #936
113
+ - Swedish (sv) #935
114
+ - Tamil (ta) #953
115
+ - Fix require statement in `rails/pluralization/tr` #964
116
+ - Add rails/ordinals to s.files in Gemspec #969
117
+ - Update i18n-tasks to be ActiveSupport 7+ ready #970
118
+
119
+ ## 7.0.1 (2021-12-24)
120
+
121
+ - Fix ordinals loading.
122
+
123
+ ## 7.0.0 (2021-12-23)
124
+
125
+ - Support Rails 7
126
+ - Drop support for Ruby 1.8
127
+ - Eager load translations during boot phase if possible.
128
+ - Translate ordinals (fr, fr-FR, fr-CA, fr-BE)
129
+ - Update following locales:
130
+ - Albanian (sq)
131
+ - Catalan (ca)
132
+ - Chinese (zh-CN, zh-TW)
133
+ - Croatian (hr)
134
+ - Danish (da)
135
+ - Finnish (fi)
136
+ - French (fr, fr-FR, fr-CA, fr-BE)
137
+ - Georgian (ka)
138
+ - German (de)
139
+ - Greek (el, el-CY)
140
+ - Italian (it, it-CH)
141
+ - Latvian (lv)
142
+ - Lithuanian (lt)
143
+ - Norwegian (nb)
144
+ - Polish (pl)
145
+ - Portuguese (pt-BR)
146
+ - Romanian (ro)
147
+ - Serbian (sr)
148
+ - Spanish (es-CO, es-AR)
149
+ - Swedish (sv)
150
+ - Turkish (tr)
151
+ - Ukrainian (uk)
152
+ - Vietnamese (vi)
153
+ - Add following locales:
154
+ - English Trinidad & Tobago (en-TT)
155
+ - Papiamento (pap-AW, pap-CW)
156
+ - Sesotho (st)
157
+
158
+ ## 6.0.0 (2019-08-17)
159
+
2
160
  - Update rails-i18n.gemspec to use Railties 6.0.0
3
161
  - Add Malagasy (mg) locale
4
162
  - Update following locales:
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
 
@@ -11,7 +11,8 @@ Centralization of locale data collection for Ruby on Rails.
11
11
  Include the gem to your Gemfile:
12
12
 
13
13
  ``` ruby
14
- gem 'rails-i18n', '~> 6.0.0.beta1' # For 6.0.0.beta1 or higher
14
+ gem 'rails-i18n', '~> 7.0.0' # For 7.0.0
15
+ gem 'rails-i18n', '~> 6.0' # For 6.x
15
16
  gem 'rails-i18n', '~> 5.1' # For 5.0.x, 5.1.x and 5.2.x
16
17
  gem 'rails-i18n', '~> 4.0' # For 4.0.x
17
18
  gem 'rails-i18n', '~> 3.0' # For 3.x
@@ -23,7 +24,8 @@ gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-3-x' # For 3.x
23
24
  Alternatively, execute the following command:
24
25
 
25
26
  ``` shell
26
- gem install rails-i18n -v '~> 6.0.0.beta1' # For 6.0.0.beta1 or higher
27
+ gem install rails-i18n -v '~> 7.0.0' # For 7.0.0
28
+ gem install rails-i18n -v '~> 6.0' # For 6.x
27
29
  gem install rails-i18n -v '~> 5.1' # For For 5.0.x, 5.1.x and 5.2.x
28
30
  gem install rails-i18n -v '~> 4.0' # For 4.0.x
29
31
  gem install rails-i18n -v '~> 3.0' # For 3.x
@@ -33,6 +35,31 @@ Note that your Ruby on Rails version must be 3.0 or higher in order to install t
33
35
 
34
36
  ## Configuration
35
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
+
36
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:
37
64
 
38
65
  ``` ruby
@@ -59,27 +86,41 @@ Locale data whose structure is compatible with Rails 2.3 are available on the se
59
86
 
60
87
  ## Available Locales
61
88
 
62
- Available locales:
89
+ **Available locales:**
90
+
91
+ af, ar, az, be, bg, bn, bs, ca, cs, 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, 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
63
92
 
64
- > af, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, de-AT, de-CH, de-DE, el, el-CY,
65
- > en, en-AU, en-CA, en-GB, en-IE, en-IN, en-NZ, en-US, en-ZA, en-CY,eo, es,
66
- > 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,
67
- > et, eu, fa, fi, fr, fr-CA, fr-CH, fr-FR, gl, he, hi, hi-IN, hr, hu, id, is, it,
68
- > it-CH, ja, ka, km, kn, ko, lb, lo, lt, lv, mk, ml, mn, mr-IN, ms, nb, ne, nl, nn, oc, or,
69
- > pa, pl, pt, pt-BR, rm, ro, ru, sk, sl, sq, sr, sw, ta, te, th, tl, tr, tt, ug,
70
- > ur, uz, vi, wo, zh-CN, zh-HK, zh-TW, zh-YUE
93
+ **Complete locales:**
71
94
 
72
- Complete locales:
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
96
+
97
+ **Locales with missing pluralization rules**
98
+
99
+ af, csb, dsb, fur, gsw-CH, lb, rm, scr, sq, te, tt, ug, uz
100
+
101
+ **Removed locales:**
102
+
103
+ cy
104
+
105
+ The cy locale was removed in commit 84f6c6b9b7a3e50df2b1fb1ccf7add329f7eab4f since unfortunately we could not find a Welsh speaker to support it.
106
+ We would welcome contributions to add it back to the project.
107
+ The locale is mostly complete for the missing translations please refer to [#1006](https://github.com/svenfuchs/rails-i18n/issues/1006)
108
+
109
+ **Removed pluralizations:**
110
+
111
+ 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
112
+
113
+ The above pluralization rules were removed because they did not have corresponding locale files.
73
114
 
74
- > af, da, de, de-AT, de-CH, de-DE, en-US, es, es-419, es-AR, es-CL, es-CO, es-CR, es-EC,
75
- > 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,
76
- > nl, nn, pt, pt-BR, sv, sv-SE, tr, zh-CN, zh-HK, zh-TW, zh-YUE, uk
77
115
 
78
116
  Currently, most locales are incomplete. Typically they lack the following keys:
79
117
 
80
118
  - `activerecord.errors.messages.record_invalid`
81
119
  - `activerecord.errors.messages.restrict_dependent_destroy.has_one`
82
120
  - `activerecord.errors.messages.restrict_dependent_destroy.has_many`
121
+
122
+ The following keys should NOT be included:
123
+
83
124
  - `errors.messages.model_invalid`
84
125
  - `errors.messages.required`
85
126
 
@@ -113,7 +154,7 @@ If you are familiar with GitHub operations, then follow the procedures described
113
154
 
114
155
  If not,
115
156
 
116
- * Save your locale data on the [Gist](http://gist.github.com).
157
+ * Save your locale data in a [Gist](http://gist.github.com).
117
158
  * Open an issue with reference to the Gist you created.
118
159
 
119
160
  ### Fetching the `rails-i18n` Repository
@@ -130,6 +171,7 @@ If not,
130
171
  ### Testing your Locale File
131
172
 
132
173
  Before committing and pushing your changes, test the integrity of your locale file.
174
+ (You can also run the tests using Docker, see below)
133
175
 
134
176
  ``` shell
135
177
  bundle exec rake spec
@@ -176,6 +218,45 @@ If you are ready, push the repository into the Github and send us a pull request
176
218
 
177
219
  We will do the formality check and publish it as quick as we can.
178
220
 
221
+ ### Add an informative title to your pull request or issue
222
+
223
+ If your pull request or issue concerns a specific locale - please indicate the relevant locale
224
+ in the issue or pull request title in order to facilitate triage.
225
+
226
+ **Best:**
227
+
228
+ *Danish: change da.errors.messages.required to "skal udfyldes"*
229
+
230
+ **Good:**
231
+
232
+ *Human precision in Swedish locale file is set to 1*
233
+
234
+ *Update es-PE.yml, the currency unit is incorrect*
235
+
236
+ **Bad:**
237
+
238
+ *Changing some string about validation*
239
+
240
+ ### Docker
241
+
242
+ Build the image:
243
+
244
+ ```
245
+ docker build --tag=railsi18n .
246
+ ```
247
+
248
+ Run the tests:
249
+
250
+ ```
251
+ docker run railsi18n
252
+ ```
253
+
254
+ To run the other commands described above:
255
+
256
+ ```
257
+ docker run railsi18n bundle exec rake i18n-spec:completeness rails/locale/en.yml rails/locale/YOUR_NEW_LOCALE.yml
258
+ ```
259
+
179
260
  ## See also
180
261
 
181
262
  * [devise-i18n](https://github.com/tigrish/devise-i18n)
@@ -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, Serbian, 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
 
@@ -0,0 +1,39 @@
1
+ module RailsI18n
2
+ module Pluralization
3
+ module OneFewOther
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
+ 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
+
17
+ mod10 = n % 10
18
+ mod100 = n % 100
19
+
20
+ if mod10 == 1 && mod100 != 11
21
+ :one
22
+ elsif FROM_2_TO_4.include?(mod10) && !FROM_12_TO_14.include?(mod100)
23
+ :few
24
+ else
25
+ :other
26
+ end
27
+ end
28
+ end
29
+
30
+ def self.with_locale(locale)
31
+ { locale => {
32
+ :i18n => {
33
+ :plural => {
34
+ :keys => [:one, :few, :other],
35
+ :rule => rule }}}}
36
+ end
37
+ end
38
+ 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,13 +2,19 @@ require 'rails'
2
2
 
3
3
  module RailsI18n
4
4
  class Railtie < ::Rails::Railtie #:nodoc:
5
+ config.rails_i18n = RailsI18n
6
+
5
7
  initializer 'rails-i18n' do |app|
6
8
  RailsI18n::Railtie.instance_eval do
7
9
  pattern = pattern_from app.config.i18n.available_locales
8
10
 
9
- add("rails/locale/#{pattern}.yml")
10
- add("rails/pluralization/#{pattern}.rb")
11
- 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
12
18
 
13
19
  init_pluralization_module
14
20
  end
data/lib/rails_i18n.rb CHANGED
@@ -1,2 +1,11 @@
1
- require 'rails_i18n/unicode'
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
+
2
11
  require 'rails_i18n/railtie'
data/rails/locale/af.yml CHANGED
@@ -40,8 +40,8 @@ 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
@@ -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
@@ -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
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} غير صالح
@@ -272,7 +272,7 @@ ar:
272
272
  time:
273
273
  am: صباحًا
274
274
  formats:
275
- default: "%a %b %d %H:%M:%S %Z %Y"
276
- long: "%d %B, %Y %H:%M"
275
+ default: "%a %d %b %Y %H:%M:%S %Z"
276
+ long: "%d %B %Y %H:%M"
277
277
  short: "%d %b %H:%M"
278
278
  pm: مساءً