rails-i18n 5.1.0 → 7.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +185 -3
- data/README.md +118 -47
- data/lib/rails_i18n/common_pluralizations/east_slavic.rb +1 -1
- data/lib/rails_i18n/common_pluralizations/serbian.rb +32 -0
- data/lib/rails_i18n/railtie.rb +3 -0
- data/lib/rails_i18n.rb +0 -1
- data/rails/locale/af.yml +21 -21
- data/rails/locale/ar.yml +59 -59
- data/rails/locale/az.yml +21 -14
- data/rails/locale/be.yml +111 -50
- data/rails/locale/bg.yml +14 -14
- data/rails/locale/bn.yml +24 -24
- data/rails/locale/bs.yml +38 -38
- data/rails/locale/ca.yml +46 -22
- data/rails/locale/cs.yml +25 -25
- data/rails/locale/cy.yml +29 -29
- data/rails/locale/da.yml +44 -30
- data/rails/locale/de-AT.yml +17 -17
- data/rails/locale/de-CH.yml +17 -17
- data/rails/locale/de-DE.yml +17 -17
- data/rails/locale/de.yml +17 -17
- data/rails/locale/el-CY.yml +46 -33
- data/rails/locale/el.yml +48 -35
- data/rails/locale/en-AU.yml +25 -15
- data/rails/locale/en-CA.yml +24 -17
- data/rails/locale/en-CY.yml +24 -17
- data/rails/locale/en-GB.yml +24 -17
- data/rails/locale/en-IE.yml +25 -18
- data/rails/locale/en-IN.yml +27 -20
- data/rails/locale/en-NZ.yml +25 -18
- data/rails/locale/en-TT.yml +213 -0
- data/rails/locale/en-US.yml +22 -20
- data/rails/locale/en-ZA.yml +26 -22
- data/rails/locale/en.yml +22 -20
- data/rails/locale/eo.yml +16 -16
- data/rails/locale/es-419.yml +22 -19
- data/rails/locale/es-AR.yml +21 -19
- data/rails/locale/es-CL.yml +21 -19
- data/rails/locale/es-CO.yml +27 -25
- data/rails/locale/es-CR.yml +20 -18
- data/rails/locale/es-EC.yml +22 -19
- data/rails/locale/es-ES.yml +27 -25
- data/rails/locale/es-MX.yml +20 -18
- data/rails/locale/es-NI.yml +23 -21
- data/rails/locale/es-PA.yml +29 -25
- data/rails/locale/es-PE.yml +21 -19
- data/rails/locale/es-US.yml +20 -18
- data/rails/locale/es-VE.yml +20 -18
- data/rails/locale/es.yml +27 -25
- data/rails/locale/et.yml +19 -19
- data/rails/locale/eu.yml +23 -23
- data/rails/locale/fa.yml +22 -21
- data/rails/locale/fi.yml +24 -24
- data/rails/locale/fr-CA.yml +52 -45
- data/rails/locale/fr-CH.yml +43 -36
- data/rails/locale/fr-FR.yml +28 -21
- data/rails/locale/fr.yml +39 -35
- data/rails/locale/gl.yml +16 -16
- data/rails/locale/he.yml +17 -17
- data/rails/locale/hi-IN.yml +17 -17
- data/rails/locale/hi.yml +17 -17
- data/rails/locale/hr.yml +39 -30
- data/rails/locale/hu.yml +14 -14
- data/rails/locale/id.yml +22 -21
- data/rails/locale/is.yml +16 -16
- data/rails/locale/it-CH.yml +28 -15
- data/rails/locale/it.yml +21 -18
- data/rails/locale/ja.yml +26 -24
- data/rails/locale/ka.yml +20 -21
- data/rails/locale/km.yml +19 -19
- data/rails/locale/kn.yml +17 -17
- data/rails/locale/ko.yml +26 -15
- data/rails/locale/lb.yml +45 -42
- data/rails/locale/lo.yml +54 -47
- data/rails/locale/lt.yml +23 -23
- data/rails/locale/lv.yml +28 -28
- data/rails/locale/mg.yml +219 -0
- data/rails/locale/mk.yml +16 -16
- data/rails/locale/ml.yml +28 -28
- data/rails/locale/mn.yml +14 -14
- data/rails/locale/mr-IN.yml +19 -19
- data/rails/locale/ms.yml +14 -14
- data/rails/locale/nb.yml +27 -21
- data/rails/locale/ne.yml +20 -20
- data/rails/locale/nl.yml +17 -17
- data/rails/locale/nn.yml +16 -16
- data/rails/locale/oc.yml +27 -27
- data/rails/locale/or.yml +14 -14
- data/rails/locale/pa.yml +19 -19
- data/rails/locale/pap-AW.yml +215 -0
- data/rails/locale/pap-CW.yml +215 -0
- data/rails/locale/pl.yml +57 -56
- data/rails/locale/pt-BR.yml +57 -55
- data/rails/locale/pt.yml +61 -58
- data/rails/locale/rm.yml +24 -24
- data/rails/locale/ro.yml +69 -69
- data/rails/locale/ru.yml +45 -43
- data/rails/locale/sk.yml +20 -20
- data/rails/locale/sl.yml +39 -39
- data/rails/locale/sq.yml +87 -79
- data/rails/locale/sr.yml +50 -48
- data/rails/locale/st.yml +215 -0
- data/rails/locale/sv-SE.yml +19 -19
- data/rails/locale/sv.yml +23 -23
- data/rails/locale/sw.yml +14 -14
- data/rails/locale/ta.yml +19 -19
- data/rails/locale/te.yml +213 -0
- data/rails/locale/th.yml +8 -8
- data/rails/locale/tl.yml +132 -132
- data/rails/locale/tr.yml +19 -19
- data/rails/locale/tt.yml +16 -16
- data/rails/locale/ug.yml +16 -16
- data/rails/locale/uk.yml +44 -44
- data/rails/locale/ur.yml +26 -25
- data/rails/locale/uz.yml +37 -37
- data/rails/locale/vi.yml +20 -19
- data/rails/locale/wo.yml +21 -21
- data/rails/locale/zh-CN.yml +30 -62
- data/rails/locale/zh-HK.yml +34 -34
- data/rails/locale/zh-TW.yml +21 -21
- data/rails/locale/zh-YUE.yml +34 -34
- data/rails/ordinals/fr-CA.rb +19 -0
- data/rails/ordinals/fr-CH.rb +19 -0
- data/rails/ordinals/fr-FR.rb +19 -0
- data/rails/ordinals/fr.rb +19 -0
- data/rails/pluralization/hu.rb +2 -2
- data/rails/pluralization/ka.rb +2 -2
- data/rails/pluralization/pap-AW.rb +3 -0
- data/rails/pluralization/pap-CW.rb +3 -0
- data/rails/pluralization/pt-BR.rb +3 -0
- data/rails/pluralization/sr.rb +2 -2
- data/rails/pluralization/st.rb +3 -0
- data/rails/pluralization/ta.rb +3 -0
- data/rails/pluralization/tr.rb +2 -2
- data/rails/pluralization/zh-CN.rb +2 -2
- data/rails/pluralization/zh-HK.rb +2 -2
- data/rails/pluralization/zh-TW.rb +2 -2
- data/rails/pluralization/zh-YUE.rb +2 -2
- data/rails/pluralization/zh.rb +2 -2
- data/rails/transliteration/az.yml +24 -0
- data/rails/transliteration/da.yml +10 -0
- data/rails/transliteration/fa.yml +47 -0
- data/rails/transliteration/ka.yml +37 -0
- data/rails/transliteration/uk.rb +5 -21
- metadata +31 -14
- data/lib/rails_i18n/unicode.rb +0 -1
- data/rails/pluralization/fil.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2c6fa09a4b3826f78df6a977ed76cba1c256f56fd1b541d0d466538809fa28ea
|
4
|
+
data.tar.gz: d60cebc84da40cfa4ca1372e294f4744a9d4056fb1dd1ad3caa0b447db458c0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea7fdb00931000219950b3f1f01ba810e8aa7731806da9cbb2b204e675072703bbe0a800f7ad27eafc761ca48a5847e473685f284cc62ee54515fad50260249f
|
7
|
+
data.tar.gz: 1bfc65beb552a2cd3303e059fa385bebfb5b851caae52f900550c473a4a8ffaacad4f488d4b7509164c42e8ae4a5618c060c7ec323564878c97fd86eae899eaf
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,187 @@
|
|
1
|
+
## unreleased
|
2
|
+
|
3
|
+
## 7.0.2 (2022-02-12)
|
4
|
+
|
5
|
+
- Fix long date format for many locales #939 #943
|
6
|
+
- Update following locales:
|
7
|
+
- Chinese (zh-TW) #941
|
8
|
+
- Croatian (hr) #940
|
9
|
+
- Danish (da) #802 #946 #947 #948
|
10
|
+
- Finnish (fi) #949
|
11
|
+
- French (fr) #968
|
12
|
+
- Galician (gl) #961
|
13
|
+
- Papiamento (pap-AW, pap-CW) #974 #975
|
14
|
+
- Serbian (sr) #972
|
15
|
+
- Spanish (es, es-CL, es-ES) #936
|
16
|
+
- Swedish (sv) #935
|
17
|
+
- Tamil (ta) #953
|
18
|
+
- Fix require statement in `rails/pluralization/tr` #964
|
19
|
+
- Add rails/ordinals to s.files in Gemspec #969
|
20
|
+
- Update i18n-tasks to be ActiveSupport 7+ ready #970
|
21
|
+
|
22
|
+
## 7.0.1 (2021-12-24)
|
23
|
+
|
24
|
+
- Fix ordinals loading.
|
25
|
+
|
26
|
+
## 7.0.0 (2021-12-23)
|
27
|
+
|
28
|
+
- Support Rails 7
|
29
|
+
- Drop support for Ruby 1.8
|
30
|
+
- Eager load translations during boot phase if possible.
|
31
|
+
- Translate ordinals (fr, fr-FR, fr-CA, fr-BE)
|
32
|
+
- Update following locales:
|
33
|
+
- Albanian (sq)
|
34
|
+
- Catalan (ca)
|
35
|
+
- Chinese (zh-CN, zh-TW)
|
36
|
+
- Croatian (hr)
|
37
|
+
- Danish (da)
|
38
|
+
- Finnish (fi)
|
39
|
+
- French (fr, fr-FR, fr-CA, fr-BE)
|
40
|
+
- Georgian (ka)
|
41
|
+
- German (de)
|
42
|
+
- Greek (el, el-CY)
|
43
|
+
- Italian (it, it-CH)
|
44
|
+
- Latvian (lv)
|
45
|
+
- Lithuanian (lt)
|
46
|
+
- Norwegian (nb)
|
47
|
+
- Polish (pl)
|
48
|
+
- Portuguese (pt-BR)
|
49
|
+
- Romanian (ro)
|
50
|
+
- Serbian (sr)
|
51
|
+
- Spanish (es-CO, es-AR)
|
52
|
+
- Swedish (sv)
|
53
|
+
- Turkish (tr)
|
54
|
+
- Ukrainian (uk)
|
55
|
+
- Vietnamese (vi)
|
56
|
+
- Add following locales:
|
57
|
+
- English Trinidad & Tobago (en-TT)
|
58
|
+
- Papiamento (pap-AW, pap-CW)
|
59
|
+
- Sesotho (st)
|
60
|
+
|
61
|
+
## 6.0.0 (2019-08-17)
|
62
|
+
|
63
|
+
- Update rails-i18n.gemspec to use Railties 6.0.0
|
64
|
+
- Add Malagasy (mg) locale
|
65
|
+
- Update following locales:
|
66
|
+
- Afrikaans (af)
|
67
|
+
- Arabic (ar)
|
68
|
+
- Azerbaijani (az)
|
69
|
+
- Belarusian (be)
|
70
|
+
- Bulgarian (bg)
|
71
|
+
- Bengali (bn)
|
72
|
+
- Bosnian (bs)
|
73
|
+
- Catalan (ca)
|
74
|
+
- Czech (cs)
|
75
|
+
- Welsh (cy)
|
76
|
+
- Danish (da)
|
77
|
+
- German (de-AT, de-CH, de-DE, de)
|
78
|
+
- Greek (el-CY, el)
|
79
|
+
- English (en-AU, en-CA, en-CY, en-GB, en-IE, en-IN, en-NZ, en-US, en-Za, en)
|
80
|
+
- Esperanto (eo)
|
81
|
+
- 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)
|
82
|
+
- Estonian (et)
|
83
|
+
- Basque (eu)
|
84
|
+
- Farsi/Persian (fa)
|
85
|
+
- Finnish (fi)
|
86
|
+
- French (fr-CA, fr-CH, fr-FR, fr)
|
87
|
+
- Galician (gl)
|
88
|
+
- Hebrew (he)
|
89
|
+
- Hindi (hi-IN, hi)
|
90
|
+
- Croatian (hr)
|
91
|
+
- Hungarian (hu)
|
92
|
+
- Indonesian (id)
|
93
|
+
- Icelandic (is)
|
94
|
+
- Italian (it, it-CH)
|
95
|
+
- Japanese (ja)
|
96
|
+
- Georgian (ka)
|
97
|
+
- Khmer (km)
|
98
|
+
- Kannada (kn)
|
99
|
+
- Korean (ko)
|
100
|
+
- Luxembourgish (lb)
|
101
|
+
- Lao (lo)
|
102
|
+
- Lithuanian (lt)
|
103
|
+
- Latvian (lv)
|
104
|
+
- Malagasy (mg)
|
105
|
+
- Macedonian (mk)
|
106
|
+
- Malayalam (ml)
|
107
|
+
- Mongolian (mn)
|
108
|
+
- Marathi (mr-IN)
|
109
|
+
- Malay (ms)
|
110
|
+
- Norwegian Bokmål (nb)
|
111
|
+
- Nepali (ne)
|
112
|
+
- Dutch (nl)
|
113
|
+
- Norwegian (nn)
|
114
|
+
- Occitan (oc)
|
115
|
+
- Oriya/Odiya (or)
|
116
|
+
- Panjabi (pa)
|
117
|
+
- Polish (pl)
|
118
|
+
- Portuguese (pt-BR, pt)
|
119
|
+
- Raeto-Romance (rm)
|
120
|
+
- Romanian (ro)
|
121
|
+
- Russian (ru)
|
122
|
+
- Slovak (sk)
|
123
|
+
- Slovenian (sl)
|
124
|
+
- Albanian (sq)
|
125
|
+
- Cyrillic Serbian (sr)
|
126
|
+
- Swedish (sv-SE, sv)
|
127
|
+
- Swahili (sw)
|
128
|
+
- Tamil (ta)
|
129
|
+
- Telugu (te)
|
130
|
+
- Thai (th)
|
131
|
+
- Tagalog (tl)
|
132
|
+
- Turkish (tr)
|
133
|
+
- Tatar (tt)
|
134
|
+
- Uyghur (ug)
|
135
|
+
- Ukrainian (uk)
|
136
|
+
- Urdu (ur)
|
137
|
+
- Uzbek (uz)
|
138
|
+
- Vietnamese (vi)
|
139
|
+
- Wolof (wo)
|
140
|
+
- Chinese (zh-CN, zh-HK, zh-TW, zh-YUE)
|
141
|
+
|
142
|
+
## 6.0.0.beta1 (2019-01-28)
|
143
|
+
|
144
|
+
- Update rails-i18n.gemspec to use Railties 6.0.0.beta1
|
145
|
+
- Update Gemfile
|
146
|
+
- Update .travis.yml
|
147
|
+
|
148
|
+
## 5.1.3 (2019-01-28)
|
149
|
+
|
150
|
+
- Update following locales:
|
151
|
+
- Spanish (es-*)
|
152
|
+
- English (en-*)
|
153
|
+
- Hungarian (hu)
|
154
|
+
- Hebrew (he)
|
155
|
+
- Cyrillic Serbian (sr)
|
156
|
+
- Farsi/Persian (fa)
|
157
|
+
|
158
|
+
## 5.1.2 (2018-10-29)
|
159
|
+
- Add Telugu (te) locale
|
160
|
+
- Update following locales:
|
161
|
+
- Azerbaijani (az)
|
162
|
+
- Belarusian (be)
|
163
|
+
- Czech (cs)
|
164
|
+
- Danish (da)
|
165
|
+
- English (en)
|
166
|
+
- Spanish (es)
|
167
|
+
- French (fr-*)
|
168
|
+
- Japanese (ja)
|
169
|
+
- Georgian (ka)
|
170
|
+
- Korean (ko)
|
171
|
+
- Lao (lo)
|
172
|
+
- Occitan (oc)
|
173
|
+
- Polish (pl)
|
174
|
+
- Portuguese (pt-*)
|
175
|
+
- Russian (ru)
|
176
|
+
- Slovak (sk)
|
177
|
+
- Ukrainian (uk)
|
178
|
+
- Vietnamese (vi)
|
179
|
+
- Chinese (zh-CN)
|
180
|
+
- Remove :fil inflector (#771)
|
181
|
+
|
182
|
+
## 5.1.1 (2018-02-26)
|
183
|
+
- Fix #767 (New Chinese pluralization rules break stuff)
|
184
|
+
|
1
185
|
## 5.1.0 (2018-02-14)
|
2
186
|
- Add following locales:
|
3
187
|
- Spanish (Nicaragua) (es-NI)
|
@@ -74,7 +258,6 @@
|
|
74
258
|
- Update Spanish locales (ES-\*)
|
75
259
|
- Update Brazilian Portuguese (pt-BR)
|
76
260
|
- Update Dutch (nl)
|
77
|
-
- Update Indonesian (id)
|
78
261
|
- Update Arabic (ar)
|
79
262
|
- Add German (de-DE)
|
80
263
|
- Add French (fr-FR)
|
@@ -157,7 +340,6 @@
|
|
157
340
|
- Update Urdu (ur)
|
158
341
|
- Update Chinese (zh-CN, zh-HK, zh-TW, zh-YUE)
|
159
342
|
- Update Khmer (km)
|
160
|
-
- Update Lithuanian (lt)
|
161
343
|
- Update Italian (it)
|
162
344
|
- Add Belarusian (be)
|
163
345
|
- Add Tatar (tt)
|
@@ -253,7 +435,7 @@
|
|
253
435
|
- Fix the currency unit for French/Switzerland (fr-CH)
|
254
436
|
|
255
437
|
## 0.7.4 (2013-07-04)
|
256
|
-
- Add Odiya language (or)
|
438
|
+
- Add Oriya/Odiya language (or)
|
257
439
|
- Revert several translations for Spanish/Colombia (es-CO)
|
258
440
|
- Add Swiss-German (iso-639-2/gsw-CH)
|
259
441
|
- Add Chinese/Hong Kong (zh-HK)
|
data/README.md
CHANGED
@@ -2,45 +2,54 @@ 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.
|
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
|
|
9
|
-
## Gem
|
9
|
+
## Gem Installation
|
10
10
|
|
11
|
-
|
11
|
+
Include the gem to your Gemfile:
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
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
|
-
Note that your
|
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
|
|
28
36
|
## Configuration
|
29
37
|
|
30
|
-
|
31
|
-
transliteration rules available in the gem. This behaviour can be changed, if you
|
32
|
-
specify in `config/environments/*` the locales which have to be loaded via
|
33
|
-
`I18n.available_locales` option:
|
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:
|
34
39
|
|
35
|
-
|
40
|
+
``` ruby
|
41
|
+
config.i18n.available_locales = ['es-CO', :de]
|
42
|
+
```
|
36
43
|
|
37
44
|
or
|
38
45
|
|
39
|
-
|
46
|
+
``` ruby
|
47
|
+
config.i18n.available_locales = :nl
|
48
|
+
```
|
40
49
|
|
41
|
-
## Manual
|
50
|
+
## Manual Installation
|
42
51
|
|
43
|
-
Download
|
52
|
+
Download desired locale files found in [rails/locale](http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/) directory and move them into the `config/locales` directory of your Rails application.
|
44
53
|
|
45
54
|
If any translation doesn't suit well to the requirements of your application, edit them or add your own locale files.
|
46
55
|
|
@@ -52,33 +61,36 @@ Locale data whose structure is compatible with Rails 2.3 are available on the se
|
|
52
61
|
|
53
62
|
## Available Locales
|
54
63
|
|
55
|
-
Available locales
|
64
|
+
Available locales:
|
56
65
|
|
57
66
|
> af, ar, az, be, bg, bn, bs, ca, cs, cy, da, de, de-AT, de-CH, de-DE, el, el-CY,
|
58
|
-
> 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,
|
59
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,
|
60
69
|
> et, eu, fa, fi, fr, fr-CA, fr-CH, fr-FR, gl, he, hi, hi-IN, hr, hu, id, is, it,
|
61
|
-
> it-CH, ja, ka, km, kn, ko, lb, lo, lt, lv, mk, ml, mn, mr-IN, ms, nb, ne, nl, nn, or,
|
62
|
-
> pa, pl, pt, pt-BR, rm, ro, ru, sk, sl, sq, sr, sw, ta, th, tl, tr, tt, ug,
|
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,
|
63
72
|
> ur, uz, vi, wo, zh-CN, zh-HK, zh-TW, zh-YUE
|
64
73
|
|
65
|
-
Complete locales
|
74
|
+
Complete locales:
|
66
75
|
|
67
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,
|
68
|
-
> 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,
|
69
|
-
> 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
|
70
79
|
|
71
80
|
Currently, most locales are incomplete. Typically they lack the following keys:
|
72
81
|
|
73
82
|
- `activerecord.errors.messages.record_invalid`
|
74
83
|
- `activerecord.errors.messages.restrict_dependent_destroy.has_one`
|
75
84
|
- `activerecord.errors.messages.restrict_dependent_destroy.has_many`
|
85
|
+
|
86
|
+
The following keys should NOT be included:
|
87
|
+
|
76
88
|
- `errors.messages.model_invalid`
|
77
89
|
- `errors.messages.required`
|
78
90
|
|
79
91
|
We always welcome your contributions!
|
80
92
|
|
81
|
-
## Currency
|
93
|
+
## Currency Symbols
|
82
94
|
|
83
95
|
Some locales have the symbol of the currency (e.g. `€`) under the key `number.currency.format.unit`,
|
84
96
|
while others have the code (e.g. `CHF`). The value of the key depends on the widespread adoption of
|
@@ -87,10 +99,10 @@ the unicode currency symbols by fonts.
|
|
87
99
|
For example the Turkish Lira sign (`₺`) was recently added in Unicode 6.2 and while most popular
|
88
100
|
fonts have a glyph, there are still many fonts that will not render the character correctly.
|
89
101
|
|
90
|
-
If you want to provide a different value,
|
102
|
+
If you want to provide a different value, you can create a custom locale file under
|
91
103
|
`config/locales/tr.yml` and override the respective key:
|
92
104
|
|
93
|
-
```
|
105
|
+
``` yaml
|
94
106
|
tr:
|
95
107
|
number:
|
96
108
|
currency:
|
@@ -98,50 +110,67 @@ tr:
|
|
98
110
|
unit: TL
|
99
111
|
```
|
100
112
|
|
101
|
-
## How to
|
113
|
+
## How to Contribute
|
102
114
|
|
103
|
-
### Quick
|
115
|
+
### Quick Contribution
|
104
116
|
|
105
|
-
If you are familiar with GitHub operations, follow the procedures described in the subsequent sections.
|
117
|
+
If you are familiar with GitHub operations, then follow the procedures described in the subsequent sections.
|
106
118
|
|
107
|
-
If
|
119
|
+
If not,
|
108
120
|
|
109
|
-
* Save your locale data
|
121
|
+
* Save your locale data in a [Gist](http://gist.github.com).
|
110
122
|
* Open an issue with reference to the Gist you created.
|
111
123
|
|
112
|
-
###
|
124
|
+
### Fetching the `rails-i18n` Repository
|
113
125
|
|
114
126
|
* Get a github account and Git program if you haven't. See [Help.Github](http://help.github.com/) for instructions.
|
115
127
|
* Fork `svenfuchs/rails-i18n` repository and clone it into your PC.
|
116
128
|
|
117
|
-
###
|
129
|
+
### Creating or Editing your Locale File
|
118
130
|
|
119
131
|
* Have a look in `rails/locale/en.yml`, which should be used as the base of your translation.
|
120
132
|
* Create or edit your locale file.
|
121
133
|
Please pay attention to save your files as UTF-8.
|
122
134
|
|
123
|
-
###
|
135
|
+
### Testing your Locale File
|
124
136
|
|
125
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)
|
126
139
|
|
127
|
-
|
140
|
+
``` shell
|
141
|
+
bundle exec rake spec
|
142
|
+
```
|
128
143
|
|
129
144
|
Make sure you have included all translations with:
|
130
145
|
|
131
|
-
|
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
|
+
```
|
132
155
|
|
133
156
|
You can list all complete and incomplete locales:
|
134
157
|
|
135
|
-
|
136
|
-
|
158
|
+
``` shell
|
159
|
+
thor locales:complete
|
160
|
+
thor locales:incomplete
|
161
|
+
```
|
137
162
|
|
138
163
|
Also, you can list all available locales:
|
139
164
|
|
140
|
-
|
165
|
+
``` shell
|
166
|
+
thor locales:list
|
167
|
+
```
|
141
168
|
|
142
169
|
You can list all missing keys:
|
143
170
|
|
144
|
-
|
171
|
+
``` shell
|
172
|
+
i18n-tasks missing es
|
173
|
+
```
|
145
174
|
|
146
175
|
### Edit README.md
|
147
176
|
|
@@ -153,11 +182,53 @@ If you are ready, push the repository into the Github and send us a pull request
|
|
153
182
|
|
154
183
|
We will do the formality check and publish it as quick as we can.
|
155
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
|
+
|
156
225
|
## See also
|
157
226
|
|
158
227
|
* [devise-i18n](https://github.com/tigrish/devise-i18n)
|
159
228
|
* [will-paginate-i18n](https://github.com/tigrish/will-paginate-i18n)
|
229
|
+
* [kaminari-i18n](https://github.com/tigrish/kaminari-i18n)
|
160
230
|
* [i18n-country-translation](https://github.com/onomojo/i18n-country-translations) for translations of country names
|
231
|
+
* [i18n-timezones](https://github.com/onomojo/i18n-timezones) for translations of Rails time zones
|
161
232
|
* [i18n-spec](https://github.com/tigrish/i18n-spec) for RSpec matchers to test your locale files
|
162
233
|
* [iso](https://github.com/tigrish/iso) for the list of valid language/region codes and their translations
|
163
234
|
* [i18n-tasks](https://github.com/glebm/i18n-tasks)
|
@@ -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,
|
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
|
data/lib/rails_i18n/railtie.rb
CHANGED
@@ -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
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:
|
9
|
-
has_many:
|
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: "%
|
44
|
-
short: "%
|
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
|
-
|
88
|
-
one: 1
|
89
|
-
other: "%{count}
|
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
|
-
|
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: "%
|
211
|
+
long: "%d %B %Y %H:%M"
|
212
212
|
short: "%d %b %H:%M"
|
213
213
|
pm: nm
|