twitter_cldr 3.5.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -6
- data/History.txt +3 -0
- data/README.md +15 -15
- data/lib/twitter_cldr/data_readers/data_reader.rb +2 -2
- data/lib/twitter_cldr/data_readers/timespan_data_reader.rb +23 -78
- data/lib/twitter_cldr/formatters/numbers/rbnf.rb +1 -1
- data/lib/twitter_cldr/resources/locales_resources_importer.rb +3 -3
- data/lib/twitter_cldr/tokenizers/numbers/rbnf_tokenizer.rb +1 -4
- data/lib/twitter_cldr/version.rb +1 -1
- data/resources/custom/shared/postal_codes.yml +8 -0
- data/resources/locales/af/fields.yml +325 -98
- data/resources/locales/ar/fields.yml +532 -210
- data/resources/locales/ar/plurals.yml +4 -3
- data/resources/locales/be/fields.yml +21 -112
- data/resources/locales/be/plurals.yml +6 -4
- data/resources/locales/bg/fields.yml +342 -98
- data/resources/locales/bn/fields.yml +342 -98
- data/resources/locales/bn/plurals.yml +2 -2
- data/resources/locales/ca/fields.yml +342 -98
- data/resources/locales/ca/plurals.yml +2 -2
- data/resources/locales/cs/fields.yml +438 -126
- data/resources/locales/cs/plurals.yml +3 -3
- data/resources/locales/cy/fields.yml +202 -98
- data/resources/locales/da/fields.yml +342 -98
- data/resources/locales/da/plurals.yml +2 -2
- data/resources/locales/de-CH/fields.yml +342 -98
- data/resources/locales/de-CH/plurals.yml +2 -2
- data/resources/locales/de/fields.yml +342 -98
- data/resources/locales/de/plurals.yml +2 -2
- data/resources/locales/el/fields.yml +342 -98
- data/resources/locales/en-150/fields.yml +283 -98
- data/resources/locales/en-150/plurals.yml +5 -5
- data/resources/locales/en-AU/fields.yml +283 -98
- data/resources/locales/en-AU/plurals.yml +5 -5
- data/resources/locales/en-CA/fields.yml +283 -98
- data/resources/locales/en-CA/plurals.yml +5 -5
- data/resources/locales/en-GB/fields.yml +357 -98
- data/resources/locales/en-GB/plurals.yml +5 -5
- data/resources/locales/en-IE/fields.yml +283 -98
- data/resources/locales/en-IE/plurals.yml +5 -5
- data/resources/locales/en-SG/fields.yml +283 -98
- data/resources/locales/en-SG/plurals.yml +5 -5
- data/resources/locales/en-ZA/fields.yml +283 -98
- data/resources/locales/en-ZA/plurals.yml +5 -5
- data/resources/locales/en/fields.yml +283 -98
- data/resources/locales/en/plurals.yml +5 -5
- data/resources/locales/es-419/fields.yml +342 -98
- data/resources/locales/es-CO/fields.yml +342 -98
- data/resources/locales/es-MX/fields.yml +342 -98
- data/resources/locales/es-US/fields.yml +342 -98
- data/resources/locales/es/fields.yml +342 -98
- data/resources/locales/eu/fields.yml +342 -98
- data/resources/locales/fa/fields.yml +342 -98
- data/resources/locales/fa/plurals.yml +2 -2
- data/resources/locales/fi/fields.yml +342 -98
- data/resources/locales/fi/plurals.yml +2 -2
- data/resources/locales/fil/fields.yml +342 -98
- data/resources/locales/fil/plurals.yml +4 -4
- data/resources/locales/fr-BE/fields.yml +342 -98
- data/resources/locales/fr-CA/fields.yml +342 -98
- data/resources/locales/fr-CH/fields.yml +342 -98
- data/resources/locales/fr/fields.yml +342 -98
- data/resources/locales/ga/fields.yml +484 -98
- data/resources/locales/ga/plurals.yml +3 -3
- data/resources/locales/gl/fields.yml +313 -98
- data/resources/locales/gl/plurals.yml +2 -2
- data/resources/locales/gu/fields.yml +342 -98
- data/resources/locales/gu/plurals.yml +7 -7
- data/resources/locales/he/fields.yml +438 -154
- data/resources/locales/he/plurals.yml +4 -3
- data/resources/locales/hi/fields.yml +342 -98
- data/resources/locales/hi/plurals.yml +2 -2
- data/resources/locales/hr/fields.yml +390 -154
- data/resources/locales/hr/plurals.yml +7 -4
- data/resources/locales/hu/fields.yml +342 -98
- data/resources/locales/id/fields.yml +294 -98
- data/resources/locales/is/fields.yml +342 -98
- data/resources/locales/is/plurals.yml +2 -2
- data/resources/locales/it-CH/fields.yml +342 -98
- data/resources/locales/it-CH/plurals.yml +2 -2
- data/resources/locales/it/fields.yml +342 -98
- data/resources/locales/it/plurals.yml +2 -2
- data/resources/locales/ja/fields.yml +294 -98
- data/resources/locales/kn/fields.yml +342 -98
- data/resources/locales/kn/plurals.yml +3 -3
- data/resources/locales/ko/fields.yml +294 -98
- data/resources/locales/lv/fields.yml +390 -126
- data/resources/locales/lv/plurals.yml +6 -4
- data/resources/locales/mr/fields.yml +340 -98
- data/resources/locales/mr/plurals.yml +6 -7
- data/resources/locales/ms/fields.yml +294 -98
- data/resources/locales/nb/fields.yml +342 -98
- data/resources/locales/nl/fields.yml +342 -98
- data/resources/locales/nl/plurals.yml +2 -2
- data/resources/locales/pl/fields.yml +438 -154
- data/resources/locales/pl/plurals.yml +8 -4
- data/resources/locales/pt/fields.yml +342 -98
- data/resources/locales/pt/plurals.yml +2 -2
- data/resources/locales/ro/fields.yml +390 -126
- data/resources/locales/ro/plurals.yml +4 -3
- data/resources/locales/ru/fields.yml +438 -154
- data/resources/locales/ru/plurals.yml +8 -4
- data/resources/locales/sk/fields.yml +438 -126
- data/resources/locales/sk/plurals.yml +3 -3
- data/resources/locales/sq/fields.yml +340 -98
- data/resources/locales/sq/plurals.yml +2 -2
- data/resources/locales/sr/fields.yml +390 -154
- data/resources/locales/sr/plurals.yml +7 -4
- data/resources/locales/sv/fields.yml +342 -98
- data/resources/locales/sv/plurals.yml +4 -4
- data/resources/locales/ta/fields.yml +342 -98
- data/resources/locales/th/fields.yml +294 -98
- data/resources/locales/tr/fields.yml +342 -98
- data/resources/locales/uk/fields.yml +438 -154
- data/resources/locales/uk/plurals.yml +10 -6
- data/resources/locales/ur/fields.yml +342 -98
- data/resources/locales/ur/plurals.yml +2 -2
- data/resources/locales/vi/fields.yml +294 -98
- data/resources/locales/zh-Hant/fields.yml +294 -98
- data/resources/locales/zh/fields.yml +294 -98
- data/spec/data_readers/timespan_data_reader_spec.rb +68 -3
- data/spec/localized/localized_date_spec.rb +13 -13
- data/spec/localized/localized_timespan_spec.rb +43 -84
- data/twitter_cldr.gemspec +1 -1
- metadata +6 -5
@@ -2,107 +2,303 @@
|
|
2
2
|
:zh:
|
3
3
|
:fields:
|
4
4
|
:day:
|
5
|
-
:
|
6
|
-
|
7
|
-
:
|
8
|
-
|
9
|
-
:
|
10
|
-
:
|
11
|
-
|
12
|
-
:
|
13
|
-
:
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
5
|
+
:display_name: 日
|
6
|
+
:relative:
|
7
|
+
-1: 昨天
|
8
|
+
-2: 前天
|
9
|
+
0: 今天
|
10
|
+
1: 明天
|
11
|
+
2: 后天
|
12
|
+
:relative_time:
|
13
|
+
:future:
|
14
|
+
:other: "{0}天后"
|
15
|
+
:past:
|
16
|
+
:other: "{0}天前"
|
17
|
+
:day-narrow:
|
18
|
+
:display_name: 日
|
19
|
+
:relative_time:
|
20
|
+
:future:
|
21
|
+
:other: "{0}天后"
|
22
|
+
:past:
|
23
|
+
:other: "{0}天前"
|
24
|
+
:day-short:
|
25
|
+
:display_name: 日
|
26
|
+
:relative_time:
|
27
|
+
:future:
|
28
|
+
:other: "{0}天后"
|
29
|
+
:past:
|
30
|
+
:other: "{0}天前"
|
31
|
+
:dayperiod:
|
32
|
+
:display_name: 上午/下午
|
33
|
+
:era:
|
34
|
+
:display_name: 纪元
|
35
|
+
:fri:
|
36
|
+
:relative:
|
37
|
+
-1: 上周五
|
38
|
+
0: 本周五
|
39
|
+
1: 下周五
|
40
|
+
:fri-narrow:
|
41
|
+
:relative:
|
42
|
+
-1: 上周五
|
43
|
+
0: 本周五
|
44
|
+
1: 下周五
|
45
|
+
:fri-short:
|
46
|
+
:relative:
|
47
|
+
-1: 上周五
|
48
|
+
0: 本周五
|
49
|
+
1: 下周五
|
19
50
|
:hour:
|
20
|
-
:
|
21
|
-
|
22
|
-
:
|
23
|
-
|
24
|
-
:
|
25
|
-
|
26
|
-
:hour-
|
27
|
-
:
|
28
|
-
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
51
|
+
:display_name: 小时
|
52
|
+
:relative_time:
|
53
|
+
:future:
|
54
|
+
:other: "{0}小时后"
|
55
|
+
:past:
|
56
|
+
:other: "{0}小时前"
|
57
|
+
:hour-narrow:
|
58
|
+
:display_name: 小时
|
59
|
+
:relative_time:
|
60
|
+
:future:
|
61
|
+
:other: "{0}小时后"
|
62
|
+
:past:
|
63
|
+
:other: "{0}小时前"
|
64
|
+
:hour-short:
|
65
|
+
:display_name: 小时
|
66
|
+
:relative_time:
|
67
|
+
:future:
|
68
|
+
:other: "{0}小时后"
|
69
|
+
:past:
|
70
|
+
:other: "{0}小时前"
|
34
71
|
:minute:
|
35
|
-
:
|
36
|
-
|
37
|
-
:
|
38
|
-
|
39
|
-
:
|
40
|
-
|
41
|
-
:minute-
|
42
|
-
:
|
43
|
-
|
44
|
-
:
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
72
|
+
:display_name: 分钟
|
73
|
+
:relative_time:
|
74
|
+
:future:
|
75
|
+
:other: "{0}分钟后"
|
76
|
+
:past:
|
77
|
+
:other: "{0}分钟前"
|
78
|
+
:minute-narrow:
|
79
|
+
:display_name: 分钟
|
80
|
+
:relative_time:
|
81
|
+
:future:
|
82
|
+
:other: "{0}分钟后"
|
83
|
+
:past:
|
84
|
+
:other: "{0}分钟前"
|
85
|
+
:minute-short:
|
86
|
+
:display_name: 分钟
|
87
|
+
:relative_time:
|
88
|
+
:future:
|
89
|
+
:other: "{0}分钟后"
|
90
|
+
:past:
|
91
|
+
:other: "{0}分钟前"
|
92
|
+
:mon:
|
93
|
+
:relative:
|
94
|
+
-1: 上周一
|
95
|
+
0: 本周一
|
96
|
+
1: 下周一
|
97
|
+
:mon-narrow:
|
98
|
+
:relative:
|
99
|
+
-1: 上周一
|
100
|
+
0: 本周一
|
101
|
+
1: 下周一
|
102
|
+
:mon-short:
|
103
|
+
:relative:
|
104
|
+
-1: 上周一
|
105
|
+
0: 本周一
|
106
|
+
1: 下周一
|
49
107
|
:month:
|
50
|
-
:
|
51
|
-
|
52
|
-
:
|
53
|
-
|
54
|
-
:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
:
|
59
|
-
|
60
|
-
:month-
|
61
|
-
:
|
62
|
-
|
63
|
-
:
|
108
|
+
:display_name: 月
|
109
|
+
:relative:
|
110
|
+
-1: 上个月
|
111
|
+
0: 本月
|
112
|
+
1: 下个月
|
113
|
+
:relative_time:
|
114
|
+
:future:
|
115
|
+
:other: "{0}个月后"
|
116
|
+
:past:
|
117
|
+
:other: "{0}个月前"
|
118
|
+
:month-narrow:
|
119
|
+
:display_name: 月
|
120
|
+
:relative_time:
|
121
|
+
:future:
|
122
|
+
:other: "{0}个月后"
|
123
|
+
:past:
|
124
|
+
:other: "{0}个月前"
|
125
|
+
:month-short:
|
126
|
+
:display_name: 月
|
127
|
+
:relative_time:
|
128
|
+
:future:
|
129
|
+
:other: "{0}个月后"
|
130
|
+
:past:
|
131
|
+
:other: "{0}个月前"
|
132
|
+
:quarter:
|
133
|
+
:display_name: 季
|
134
|
+
:relative_time:
|
135
|
+
:future:
|
136
|
+
:other: "{0}季度后"
|
137
|
+
:past:
|
138
|
+
:other: "{0}季度前"
|
139
|
+
:quarter-narrow:
|
140
|
+
:display_name: 季
|
141
|
+
:relative_time:
|
142
|
+
:future:
|
143
|
+
:other: "{0}季度后"
|
144
|
+
:past:
|
145
|
+
:other: "{0}季度前"
|
146
|
+
:quarter-short:
|
147
|
+
:display_name: 季
|
148
|
+
:relative_time:
|
149
|
+
:future:
|
150
|
+
:other: "{0}季度后"
|
151
|
+
:past:
|
152
|
+
:other: "{0}季度前"
|
153
|
+
:sat:
|
154
|
+
:relative:
|
155
|
+
-1: 上周六
|
156
|
+
0: 本周六
|
157
|
+
1: 下周六
|
158
|
+
:sat-narrow:
|
159
|
+
:relative:
|
160
|
+
-1: 上周六
|
161
|
+
0: 本周六
|
162
|
+
1: 下周六
|
163
|
+
:sat-short:
|
164
|
+
:relative:
|
165
|
+
-1: 上周六
|
166
|
+
0: 本周六
|
167
|
+
1: 下周六
|
64
168
|
:second:
|
65
|
-
:
|
66
|
-
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
:
|
169
|
+
:display_name: 秒钟
|
170
|
+
:relative:
|
171
|
+
0: 现在
|
172
|
+
:relative_time:
|
173
|
+
:future:
|
174
|
+
:other: "{0}秒钟后"
|
175
|
+
:past:
|
176
|
+
:other: "{0}秒钟前"
|
177
|
+
:second-narrow:
|
178
|
+
:display_name: 秒钟
|
179
|
+
:relative_time:
|
180
|
+
:future:
|
181
|
+
:other: "{0}秒后"
|
182
|
+
:past:
|
183
|
+
:other: "{0}秒前"
|
184
|
+
:second-short:
|
185
|
+
:display_name: 秒钟
|
186
|
+
:relative_time:
|
187
|
+
:future:
|
188
|
+
:other: "{0}秒后"
|
189
|
+
:past:
|
190
|
+
:other: "{0}秒前"
|
191
|
+
:sun:
|
192
|
+
:relative:
|
193
|
+
-1: 上周日
|
194
|
+
0: 本周日
|
195
|
+
1: 下周日
|
196
|
+
:sun-narrow:
|
197
|
+
:relative:
|
198
|
+
-1: 上周日
|
199
|
+
0: 本周日
|
200
|
+
1: 下周日
|
201
|
+
:sun-short:
|
202
|
+
:relative:
|
203
|
+
-1: 上周日
|
204
|
+
0: 本周日
|
205
|
+
1: 下周日
|
206
|
+
:thu:
|
207
|
+
:relative:
|
208
|
+
-1: 上周四
|
209
|
+
0: 本周四
|
210
|
+
1: 下周四
|
211
|
+
:thu-narrow:
|
212
|
+
:relative:
|
213
|
+
-1: 上周四
|
214
|
+
0: 本周四
|
215
|
+
1: 下周四
|
216
|
+
:thu-short:
|
217
|
+
:relative:
|
218
|
+
-1: 上周四
|
219
|
+
0: 本周四
|
220
|
+
1: 下周四
|
221
|
+
:tue:
|
222
|
+
:relative:
|
223
|
+
-1: 上周二
|
224
|
+
0: 本周二
|
225
|
+
1: 下周二
|
226
|
+
:tue-narrow:
|
227
|
+
:relative:
|
228
|
+
-1: 上周二
|
229
|
+
0: 本周二
|
230
|
+
1: 下周二
|
231
|
+
:tue-short:
|
232
|
+
:relative:
|
233
|
+
-1: 上周二
|
234
|
+
0: 本周二
|
235
|
+
1: 下周二
|
236
|
+
:wed:
|
237
|
+
:relative:
|
238
|
+
-1: 上周三
|
239
|
+
0: 本周三
|
240
|
+
1: 下周三
|
241
|
+
:wed-narrow:
|
242
|
+
:relative:
|
243
|
+
-1: 上周三
|
244
|
+
0: 本周三
|
245
|
+
1: 下周三
|
246
|
+
:wed-short:
|
247
|
+
:relative:
|
248
|
+
-1: 上周三
|
249
|
+
0: 本周三
|
250
|
+
1: 下周三
|
79
251
|
:week:
|
80
|
-
:
|
81
|
-
|
82
|
-
:
|
83
|
-
|
84
|
-
:
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
:
|
89
|
-
|
90
|
-
:week-
|
91
|
-
:
|
92
|
-
|
93
|
-
:
|
252
|
+
:display_name: 周
|
253
|
+
:relative:
|
254
|
+
-1: 上周
|
255
|
+
0: 本周
|
256
|
+
1: 下周
|
257
|
+
:relative_time:
|
258
|
+
:future:
|
259
|
+
:other: "{0}周后"
|
260
|
+
:past:
|
261
|
+
:other: "{0}周前"
|
262
|
+
:week-narrow:
|
263
|
+
:display_name: 周
|
264
|
+
:relative_time:
|
265
|
+
:future:
|
266
|
+
:other: "{0}周后"
|
267
|
+
:past:
|
268
|
+
:other: "{0}周前"
|
269
|
+
:week-short:
|
270
|
+
:display_name: 周
|
271
|
+
:relative_time:
|
272
|
+
:future:
|
273
|
+
:other: "{0}周后"
|
274
|
+
:past:
|
275
|
+
:other: "{0}周前"
|
276
|
+
:weekday:
|
277
|
+
:display_name: 工作日
|
94
278
|
:year:
|
95
|
-
:
|
96
|
-
|
97
|
-
:
|
98
|
-
|
99
|
-
:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
:
|
104
|
-
|
105
|
-
:year-
|
106
|
-
:
|
107
|
-
|
108
|
-
:
|
279
|
+
:display_name: 年
|
280
|
+
:relative:
|
281
|
+
-1: 去年
|
282
|
+
0: 今年
|
283
|
+
1: 明年
|
284
|
+
:relative_time:
|
285
|
+
:future:
|
286
|
+
:other: "{0}年后"
|
287
|
+
:past:
|
288
|
+
:other: "{0}年前"
|
289
|
+
:year-narrow:
|
290
|
+
:display_name: 年
|
291
|
+
:relative_time:
|
292
|
+
:future:
|
293
|
+
:other: "{0}年后"
|
294
|
+
:past:
|
295
|
+
:other: "{0}年前"
|
296
|
+
:year-short:
|
297
|
+
:display_name: 年
|
298
|
+
:relative_time:
|
299
|
+
:future:
|
300
|
+
:other: "{0}年后"
|
301
|
+
:past:
|
302
|
+
:other: "{0}年前"
|
303
|
+
:zone:
|
304
|
+
:display_name: 时区
|
@@ -8,9 +8,74 @@ require 'spec_helper'
|
|
8
8
|
include TwitterCldr::DataReaders
|
9
9
|
|
10
10
|
describe TimespanDataReader do
|
11
|
-
|
11
|
+
it 'sets default options and identifies plural rule' do
|
12
|
+
data_reader = TimespanDataReader.new(:sv, 2)
|
13
|
+
expect(data_reader.locale).to eq(:sv)
|
14
|
+
expect(data_reader.type).to eq(:default)
|
15
|
+
expect(data_reader.direction).to eq(:ago)
|
16
|
+
expect(data_reader.unit).to eq(nil)
|
17
|
+
expect(data_reader.plural_rule).to eq(:other)
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#pattern' do
|
21
|
+
test_cases = {
|
22
|
+
ago: {
|
23
|
+
default: {
|
24
|
+
second: 'för {0} sekunder sedan',
|
25
|
+
minute: 'för {0} minuter sedan',
|
26
|
+
hour: 'för {0} timmar sedan',
|
27
|
+
day: 'för {0} dagar sedan',
|
28
|
+
week: 'för {0} veckor sedan',
|
29
|
+
month: 'för {0} månader sedan',
|
30
|
+
year: 'för {0} år sedan'
|
31
|
+
},
|
32
|
+
|
33
|
+
narrow: {
|
34
|
+
second: '−{0} s',
|
35
|
+
minute: '−{0} min',
|
36
|
+
hour: '−{0} h',
|
37
|
+
day: '−{0} d',
|
38
|
+
week: '-{0} v.',
|
39
|
+
month: '-{0} mån.',
|
40
|
+
year: '-{0} år'
|
41
|
+
}
|
42
|
+
},
|
43
|
+
|
44
|
+
until: {
|
45
|
+
default: {
|
46
|
+
second: 'om {0} sekunder',
|
47
|
+
minute: 'om {0} minuter',
|
48
|
+
hour: 'om {0} timmar',
|
49
|
+
day: 'om {0} dagar',
|
50
|
+
week: 'om {0} veckor',
|
51
|
+
month: 'om {0} månader',
|
52
|
+
year: 'om {0} år'
|
53
|
+
},
|
54
|
+
|
55
|
+
narrow: {
|
56
|
+
second: '+{0} s',
|
57
|
+
minute: '+{0} m',
|
58
|
+
hour: '+{0} h',
|
59
|
+
day: '+{0} d',
|
60
|
+
week: '+{0} v.',
|
61
|
+
month: '+{0} mån.',
|
62
|
+
year: '+{0} år'
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
test_cases.each_pair do |direction, dir_hash|
|
68
|
+
dir_hash.each_pair do |type, type_hash|
|
69
|
+
type_hash.each_pair do |unit, expected_value|
|
70
|
+
it "finds the correct pattern with direction '#{direction}', type '#{type}', and unit '#{unit}'" do
|
71
|
+
data_reader = TimespanDataReader.new(:sv, 2, {
|
72
|
+
direction: direction, type: type, unit: unit
|
73
|
+
})
|
12
74
|
|
13
|
-
|
14
|
-
|
75
|
+
expect(data_reader.pattern).to match_normalized(expected_value)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
15
80
|
end
|
16
81
|
end
|