twitter_cldr 1.8.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -2
- data/History.txt +7 -1
- data/README.md +55 -0
- data/lib/twitter_cldr/core_ext.rb +1 -1
- data/lib/twitter_cldr/formatters/list_formatter.rb +64 -0
- data/lib/twitter_cldr/formatters.rb +4 -2
- data/lib/twitter_cldr/localized/localized_array.rb +19 -1
- data/lib/twitter_cldr/localized/localized_hash.rb +20 -0
- data/lib/twitter_cldr/localized/localized_string.rb +46 -1
- data/lib/twitter_cldr/localized/localized_symbol.rb +4 -0
- data/lib/twitter_cldr/localized.rb +1 -0
- data/lib/twitter_cldr/resources/bidi_test_importer.rb +118 -0
- data/lib/twitter_cldr/resources/locales_resources_importer.rb +1 -1
- data/lib/twitter_cldr/resources.rb +1 -0
- data/lib/twitter_cldr/shared/bidi.rb +526 -0
- data/lib/twitter_cldr/shared/languages.rb +5 -0
- data/lib/twitter_cldr/shared.rb +1 -0
- data/lib/twitter_cldr/utils/code_points.rb +1 -1
- data/lib/twitter_cldr/utils/yaml.rb +390 -0
- data/lib/twitter_cldr/utils.rb +1 -0
- data/lib/twitter_cldr/version.rb +1 -1
- data/lib/twitter_cldr.rb +2 -0
- data/resources/custom/locales/en/units.yml +19 -18
- data/resources/locales/af/calendars.yml +67 -66
- data/resources/locales/af/languages.yml +22 -22
- data/resources/locales/af/layout.yml +5 -0
- data/resources/locales/af/lists.yml +7 -0
- data/resources/locales/af/numbers.yml +36 -36
- data/resources/locales/af/plurals.yml +2 -3
- data/resources/locales/af/units.yml +75 -75
- data/resources/locales/ar/calendars.yml +149 -148
- data/resources/locales/ar/languages.yml +501 -501
- data/resources/locales/ar/layout.yml +5 -0
- data/resources/locales/ar/lists.yml +7 -0
- data/resources/locales/ar/numbers.yml +31 -31
- data/resources/locales/ar/plurals.yml +2 -9
- data/resources/locales/ar/units.yml +220 -220
- data/resources/locales/ca/calendars.yml +78 -77
- data/resources/locales/ca/languages.yml +199 -199
- data/resources/locales/ca/layout.yml +5 -0
- data/resources/locales/ca/lists.yml +7 -0
- data/resources/locales/ca/numbers.yml +36 -36
- data/resources/locales/ca/plurals.yml +2 -3
- data/resources/locales/ca/units.yml +108 -108
- data/resources/locales/cs/calendars.yml +141 -140
- data/resources/locales/cs/languages.yml +399 -399
- data/resources/locales/cs/layout.yml +5 -0
- data/resources/locales/cs/lists.yml +7 -0
- data/resources/locales/cs/numbers.yml +41 -41
- data/resources/locales/cs/plurals.yml +2 -3
- data/resources/locales/cs/units.yml +142 -142
- data/resources/locales/da/calendars.yml +73 -73
- data/resources/locales/da/languages.yml +36 -36
- data/resources/locales/da/layout.yml +5 -0
- data/resources/locales/da/lists.yml +7 -0
- data/resources/locales/da/numbers.yml +37 -37
- data/resources/locales/da/plurals.yml +2 -3
- data/resources/locales/da/units.yml +97 -97
- data/resources/locales/de/calendars.yml +71 -71
- data/resources/locales/de/languages.yml +51 -51
- data/resources/locales/de/layout.yml +5 -0
- data/resources/locales/de/lists.yml +7 -0
- data/resources/locales/de/numbers.yml +36 -36
- data/resources/locales/de/plurals.yml +2 -3
- data/resources/locales/de/units.yml +108 -108
- data/resources/locales/el/calendars.yml +213 -212
- data/resources/locales/el/languages.yml +520 -520
- data/resources/locales/el/layout.yml +5 -0
- data/resources/locales/el/lists.yml +7 -0
- data/resources/locales/el/numbers.yml +39 -39
- data/resources/locales/el/plurals.yml +2 -3
- data/resources/locales/el/units.yml +143 -143
- data/resources/locales/en/calendars.yml +66 -65
- data/resources/locales/en/languages.yml +24 -24
- data/resources/locales/en/layout.yml +5 -0
- data/resources/locales/en/lists.yml +7 -0
- data/resources/locales/en/numbers.yml +27 -27
- data/resources/locales/en/plurals.yml +2 -3
- data/resources/locales/en/units.yml +94 -94
- data/resources/locales/es/calendars.yml +80 -79
- data/resources/locales/es/languages.yml +139 -139
- data/resources/locales/es/layout.yml +5 -0
- data/resources/locales/es/lists.yml +7 -0
- data/resources/locales/es/numbers.yml +36 -36
- data/resources/locales/es/plurals.yml +2 -3
- data/resources/locales/es/units.yml +96 -96
- data/resources/locales/eu/calendars.yml +68 -67
- data/resources/locales/eu/languages.yml +11 -11
- data/resources/locales/eu/layout.yml +5 -0
- data/resources/locales/eu/lists.yml +7 -0
- data/resources/locales/eu/numbers.yml +36 -36
- data/resources/locales/eu/plurals.yml +2 -3
- data/resources/locales/eu/units.yml +80 -80
- data/resources/locales/fa/calendars.yml +223 -222
- data/resources/locales/fa/languages.yml +489 -489
- data/resources/locales/fa/layout.yml +5 -0
- data/resources/locales/fa/lists.yml +7 -0
- data/resources/locales/fa/numbers.yml +26 -26
- data/resources/locales/fa/plurals.yml +2 -3
- data/resources/locales/fa/units.yml +122 -122
- data/resources/locales/fi/calendars.yml +87 -87
- data/resources/locales/fi/languages.yml +86 -86
- data/resources/locales/fi/layout.yml +5 -0
- data/resources/locales/fi/lists.yml +7 -0
- data/resources/locales/fi/numbers.yml +41 -41
- data/resources/locales/fi/plurals.yml +2 -3
- data/resources/locales/fi/units.yml +124 -124
- data/resources/locales/fil/calendars.yml +68 -67
- data/resources/locales/fil/languages.yml +19 -19
- data/resources/locales/fil/layout.yml +5 -0
- data/resources/locales/fil/lists.yml +7 -0
- data/resources/locales/fil/numbers.yml +27 -27
- data/resources/locales/fil/plurals.yml +2 -3
- data/resources/locales/fil/units.yml +80 -80
- data/resources/locales/fr/calendars.yml +83 -83
- data/resources/locales/fr/languages.yml +117 -117
- data/resources/locales/fr/layout.yml +5 -0
- data/resources/locales/fr/lists.yml +7 -0
- data/resources/locales/fr/numbers.yml +37 -37
- data/resources/locales/fr/plurals.yml +2 -3
- data/resources/locales/fr/units.yml +80 -80
- data/resources/locales/he/calendars.yml +155 -154
- data/resources/locales/he/languages.yml +282 -282
- data/resources/locales/he/layout.yml +5 -0
- data/resources/locales/he/lists.yml +7 -0
- data/resources/locales/he/numbers.yml +27 -27
- data/resources/locales/he/plurals.yml +2 -3
- data/resources/locales/he/units.yml +122 -122
- data/resources/locales/hi/calendars.yml +132 -131
- data/resources/locales/hi/languages.yml +511 -511
- data/resources/locales/hi/layout.yml +5 -0
- data/resources/locales/hi/lists.yml +7 -0
- data/resources/locales/hi/numbers.yml +27 -27
- data/resources/locales/hi/plurals.yml +2 -3
- data/resources/locales/hi/units.yml +122 -122
- data/resources/locales/hu/calendars.yml +121 -120
- data/resources/locales/hu/languages.yml +214 -214
- data/resources/locales/hu/layout.yml +5 -0
- data/resources/locales/hu/lists.yml +7 -0
- data/resources/locales/hu/numbers.yml +39 -39
- data/resources/locales/hu/plurals.yml +2 -3
- data/resources/locales/hu/units.yml +102 -102
- data/resources/locales/id/calendars.yml +68 -67
- data/resources/locales/id/languages.yml +21 -21
- data/resources/locales/id/layout.yml +5 -0
- data/resources/locales/id/lists.yml +7 -0
- data/resources/locales/id/numbers.yml +37 -37
- data/resources/locales/id/plurals.yml +2 -3
- data/resources/locales/id/units.yml +73 -73
- data/resources/locales/it/calendars.yml +81 -80
- data/resources/locales/it/languages.yml +20 -20
- data/resources/locales/it/layout.yml +5 -0
- data/resources/locales/it/lists.yml +7 -0
- data/resources/locales/it/numbers.yml +36 -36
- data/resources/locales/it/plurals.yml +2 -3
- data/resources/locales/it/units.yml +94 -94
- data/resources/locales/ja/calendars.yml +123 -122
- data/resources/locales/ja/languages.yml +516 -516
- data/resources/locales/ja/layout.yml +5 -0
- data/resources/locales/ja/lists.yml +7 -0
- data/resources/locales/ja/numbers.yml +38 -38
- data/resources/locales/ja/plurals.yml +2 -3
- data/resources/locales/ja/units.yml +108 -108
- data/resources/locales/ko/calendars.yml +141 -140
- data/resources/locales/ko/languages.yml +509 -509
- data/resources/locales/ko/layout.yml +5 -0
- data/resources/locales/ko/lists.yml +7 -0
- data/resources/locales/ko/numbers.yml +37 -37
- data/resources/locales/ko/plurals.yml +2 -3
- data/resources/locales/ko/units.yml +108 -108
- data/resources/locales/ms/calendars.yml +68 -67
- data/resources/locales/ms/languages.yml +19 -19
- data/resources/locales/ms/layout.yml +5 -0
- data/resources/locales/ms/lists.yml +7 -0
- data/resources/locales/ms/numbers.yml +26 -26
- data/resources/locales/ms/plurals.yml +2 -3
- data/resources/locales/ms/units.yml +73 -73
- data/resources/locales/nb/calendars.yml +78 -78
- data/resources/locales/nb/languages.yml +93 -93
- data/resources/locales/nb/layout.yml +5 -0
- data/resources/locales/nb/lists.yml +7 -0
- data/resources/locales/nb/numbers.yml +37 -37
- data/resources/locales/nb/plurals.yml +2 -3
- data/resources/locales/nb/units.yml +99 -99
- data/resources/locales/nl/calendars.yml +67 -67
- data/resources/locales/nl/languages.yml +30 -30
- data/resources/locales/nl/layout.yml +5 -0
- data/resources/locales/nl/lists.yml +7 -0
- data/resources/locales/nl/numbers.yml +36 -36
- data/resources/locales/nl/plurals.yml +2 -3
- data/resources/locales/nl/units.yml +87 -87
- data/resources/locales/pl/calendars.yml +102 -101
- data/resources/locales/pl/languages.yml +139 -139
- data/resources/locales/pl/layout.yml +5 -0
- data/resources/locales/pl/lists.yml +7 -0
- data/resources/locales/pl/numbers.yml +41 -41
- data/resources/locales/pl/plurals.yml +2 -5
- data/resources/locales/pl/units.yml +149 -149
- data/resources/locales/pt/calendars.yml +83 -83
- data/resources/locales/pt/languages.yml +161 -161
- data/resources/locales/pt/layout.yml +5 -0
- data/resources/locales/pt/lists.yml +7 -0
- data/resources/locales/pt/numbers.yml +39 -39
- data/resources/locales/pt/plurals.yml +2 -3
- data/resources/locales/pt/units.yml +110 -110
- data/resources/locales/ru/calendars.yml +213 -212
- data/resources/locales/ru/languages.yml +511 -511
- data/resources/locales/ru/layout.yml +5 -0
- data/resources/locales/ru/lists.yml +7 -0
- data/resources/locales/ru/numbers.yml +40 -40
- data/resources/locales/ru/plurals.yml +2 -5
- data/resources/locales/ru/units.yml +192 -192
- data/resources/locales/sv/calendars.yml +85 -85
- data/resources/locales/sv/languages.yml +108 -108
- data/resources/locales/sv/layout.yml +5 -0
- data/resources/locales/sv/lists.yml +7 -0
- data/resources/locales/sv/numbers.yml +39 -39
- data/resources/locales/sv/plurals.yml +2 -3
- data/resources/locales/sv/units.yml +116 -116
- data/resources/locales/th/calendars.yml +172 -171
- data/resources/locales/th/languages.yml +510 -510
- data/resources/locales/th/layout.yml +5 -0
- data/resources/locales/th/lists.yml +7 -0
- data/resources/locales/th/numbers.yml +38 -38
- data/resources/locales/th/plurals.yml +2 -3
- data/resources/locales/th/units.yml +107 -107
- data/resources/locales/tr/calendars.yml +117 -116
- data/resources/locales/tr/languages.yml +143 -143
- data/resources/locales/tr/layout.yml +5 -0
- data/resources/locales/tr/lists.yml +7 -0
- data/resources/locales/tr/numbers.yml +37 -37
- data/resources/locales/tr/plurals.yml +2 -3
- data/resources/locales/tr/units.yml +98 -98
- data/resources/locales/uk/calendars.yml +187 -186
- data/resources/locales/uk/languages.yml +520 -520
- data/resources/locales/uk/layout.yml +5 -0
- data/resources/locales/uk/lists.yml +7 -0
- data/resources/locales/uk/numbers.yml +44 -44
- data/resources/locales/uk/plurals.yml +2 -5
- data/resources/locales/uk/units.yml +192 -192
- data/resources/locales/ur/calendars.yml +112 -111
- data/resources/locales/ur/languages.yml +164 -164
- data/resources/locales/ur/layout.yml +5 -0
- data/resources/locales/ur/lists.yml +7 -0
- data/resources/locales/ur/numbers.yml +27 -27
- data/resources/locales/ur/plurals.yml +2 -3
- data/resources/locales/ur/units.yml +136 -136
- data/resources/locales/zh/calendars.yml +212 -211
- data/resources/locales/zh/languages.yml +506 -506
- data/resources/locales/zh/layout.yml +5 -0
- data/resources/locales/zh/lists.yml +7 -0
- data/resources/locales/zh/numbers.yml +37 -37
- data/resources/locales/zh/plurals.yml +2 -3
- data/resources/locales/zh/units.yml +108 -108
- data/resources/locales/zh-Hant/calendars.yml +159 -158
- data/resources/locales/zh-Hant/languages.yml +510 -510
- data/resources/locales/zh-Hant/layout.yml +5 -0
- data/resources/locales/zh-Hant/lists.yml +7 -0
- data/resources/locales/zh-Hant/numbers.yml +38 -38
- data/resources/locales/zh-Hant/plurals.yml +2 -3
- data/resources/locales/zh-Hant/units.yml +108 -108
- data/spec/bidi/bidi_spec.rb +72 -0
- data/spec/bidi/classpath_bidi_test.txt +217202 -0
- data/spec/collation/tailoring_tests/da.txt +1 -1
- data/spec/collation/tailoring_tests/fi.txt +1 -7
- data/spec/collation/tailoring_tests/zh-Hant.txt +1 -1
- data/spec/formatters/list_formatter_spec.rb +119 -0
- data/spec/localized/localized_array_spec.rb +28 -0
- data/spec/localized/localized_hash_spec.rb +22 -0
- data/spec/localized/localized_number_spec.rb +3 -3
- data/spec/localized/localized_string_spec.rb +52 -1
- data/spec/localized/localized_symbol_spec.rb +7 -0
- data/spec/normalization/base_spec.rb +2 -4
- data/spec/shared/languages_spec.rb +21 -0
- data/spec/shared/numbers_spec.rb +4 -4
- data/spec/spec_helper.rb +3 -1
- data/spec/utils/yaml/t.gif +0 -0
- data/spec/utils/yaml/t.yaml +5 -0
- data/spec/utils/yaml/yaml_spec.rb +426 -0
- metadata +82 -2
@@ -1,43 +1,43 @@
|
|
1
|
-
---
|
2
|
-
:zh-Hant:
|
3
|
-
:numbers:
|
4
|
-
:formats:
|
5
|
-
:currency:
|
6
|
-
:patterns:
|
7
|
-
:default:
|
8
|
-
:unit:
|
9
|
-
:other:
|
10
|
-
:decimal:
|
11
|
-
:patterns:
|
12
|
-
:default:
|
13
|
-
:short:
|
1
|
+
---
|
2
|
+
:"zh-Hant":
|
3
|
+
:numbers:
|
4
|
+
:formats:
|
5
|
+
:currency:
|
6
|
+
:patterns:
|
7
|
+
:default: "\xC2\xA4#,##0.00"
|
8
|
+
:unit:
|
9
|
+
:other: "{0} {1}"
|
10
|
+
:decimal:
|
11
|
+
:patterns:
|
12
|
+
:default: "#,##0.###"
|
13
|
+
:short:
|
14
14
|
1000: 0
|
15
|
-
10000: 0.0
|
16
|
-
100000: 00
|
17
|
-
1000000: 000
|
18
|
-
10000000: 0000
|
19
|
-
100000000: 0.0
|
20
|
-
1000000000: 00
|
21
|
-
10000000000: 000
|
22
|
-
100000000000: 0000
|
23
|
-
1000000000000: 0.0
|
24
|
-
10000000000000: 00
|
25
|
-
100000000000000: 000
|
26
|
-
:percent:
|
27
|
-
:patterns:
|
28
|
-
:default:
|
29
|
-
:scientific:
|
30
|
-
:patterns:
|
31
|
-
:default:
|
32
|
-
:symbols:
|
33
|
-
:alias:
|
15
|
+
10000: "0.0\xE8\x90\xAC"
|
16
|
+
100000: "00\xE8\x90\xAC"
|
17
|
+
1000000: "000\xE8\x90\xAC"
|
18
|
+
10000000: "0000\xE8\x90\xAC"
|
19
|
+
100000000: "0.0\xE5\x84\x84"
|
20
|
+
1000000000: "00\xE5\x84\x84"
|
21
|
+
10000000000: "000\xE5\x84\x84"
|
22
|
+
100000000000: "0000\xE5\x84\x84"
|
23
|
+
1000000000000: "0.0\xE5\x85\x86"
|
24
|
+
10000000000000: "00\xE5\x85\x86"
|
25
|
+
100000000000000: "000\xE5\x85\x86"
|
26
|
+
:percent:
|
27
|
+
:patterns:
|
28
|
+
:default: "#,##0%"
|
29
|
+
:scientific:
|
30
|
+
:patterns:
|
31
|
+
:default: "#E0"
|
32
|
+
:symbols:
|
33
|
+
:alias: ""
|
34
34
|
:decimal: .
|
35
35
|
:exponential: E
|
36
|
-
:group:
|
37
|
-
:infinity:
|
36
|
+
:group: ","
|
37
|
+
:infinity: "\xE2\x88\x9E"
|
38
38
|
:list: ;
|
39
|
-
:minus_sign:
|
40
|
-
:nan:
|
41
|
-
:per_mille:
|
42
|
-
:percent_sign:
|
39
|
+
:minus_sign: "-"
|
40
|
+
:nan: "\xE9\x9D\x9E\xE6\x95\xB8\xE5\x80\xBC"
|
41
|
+
:per_mille: "\xE2\x80\xB0"
|
42
|
+
:percent_sign: "%"
|
43
43
|
:plus_sign: +
|
@@ -1,3 +1,2 @@
|
|
1
|
-
---
|
2
|
-
:zh-Hant:
|
3
|
-
lambda { |n| :other } } } } }'
|
1
|
+
---
|
2
|
+
:"zh-Hant": "{ :'zh-Hant' => { :i18n => {:plural => { :keys => [:other], :rule => lambda { |n| :other } } } } }"
|
@@ -1,108 +1,108 @@
|
|
1
|
-
---
|
2
|
-
:zh-Hant:
|
3
|
-
:units:
|
4
|
-
:day:
|
5
|
-
:default:
|
6
|
-
:other:
|
7
|
-
:short:
|
8
|
-
:other:
|
9
|
-
:day-future:
|
10
|
-
:default:
|
11
|
-
0: 0
|
12
|
-
1: 1
|
13
|
-
:other:
|
14
|
-
:day-past:
|
15
|
-
:default:
|
16
|
-
0: 0
|
17
|
-
1: 1
|
18
|
-
:other:
|
19
|
-
:hour:
|
20
|
-
:default:
|
21
|
-
:other:
|
22
|
-
:short:
|
23
|
-
:other:
|
24
|
-
:hour-future:
|
25
|
-
:default:
|
26
|
-
0: 0
|
27
|
-
1: 1
|
28
|
-
:other:
|
29
|
-
:hour-past:
|
30
|
-
:default:
|
31
|
-
0: 0
|
32
|
-
1: 1
|
33
|
-
:other:
|
34
|
-
:minute:
|
35
|
-
:default:
|
36
|
-
:other:
|
37
|
-
:short:
|
38
|
-
:other:
|
39
|
-
:minute-future:
|
40
|
-
:default:
|
41
|
-
0: 0
|
42
|
-
1: 1
|
43
|
-
:other:
|
44
|
-
:minute-past:
|
45
|
-
:default:
|
46
|
-
0: 0
|
47
|
-
1: 1
|
48
|
-
:other:
|
49
|
-
:month:
|
50
|
-
:default:
|
51
|
-
:other:
|
52
|
-
:short:
|
53
|
-
:other:
|
54
|
-
:month-future:
|
55
|
-
:default:
|
56
|
-
0: 0
|
57
|
-
1: 1
|
58
|
-
:other:
|
59
|
-
:month-past:
|
60
|
-
:default:
|
61
|
-
0: 0
|
62
|
-
1: 1
|
63
|
-
:other:
|
64
|
-
:second:
|
65
|
-
:default:
|
66
|
-
:other:
|
67
|
-
:short:
|
68
|
-
:other:
|
69
|
-
:second-future:
|
70
|
-
:default:
|
71
|
-
0: 0
|
72
|
-
1: 1
|
73
|
-
:other:
|
74
|
-
:second-past:
|
75
|
-
:default:
|
76
|
-
0: 0
|
77
|
-
1: 1
|
78
|
-
:other:
|
79
|
-
:week:
|
80
|
-
:default:
|
81
|
-
:other:
|
82
|
-
:short:
|
83
|
-
:other:
|
84
|
-
:week-future:
|
85
|
-
:default:
|
86
|
-
0: 0
|
87
|
-
1: 1
|
88
|
-
:other:
|
89
|
-
:week-past:
|
90
|
-
:default:
|
91
|
-
0: 0
|
92
|
-
1: 1
|
93
|
-
:other:
|
94
|
-
:year:
|
95
|
-
:default:
|
96
|
-
:other:
|
97
|
-
:short:
|
98
|
-
:other:
|
99
|
-
:year-future:
|
100
|
-
:default:
|
101
|
-
0: 0
|
102
|
-
1: 1
|
103
|
-
:other:
|
104
|
-
:year-past:
|
105
|
-
:default:
|
106
|
-
0: 0
|
107
|
-
1: 1
|
108
|
-
:other:
|
1
|
+
---
|
2
|
+
:"zh-Hant":
|
3
|
+
:units:
|
4
|
+
:day:
|
5
|
+
:default:
|
6
|
+
:other: "{0}\xE6\x97\xA5"
|
7
|
+
:short:
|
8
|
+
:other: "{0}\xE6\x97\xA5"
|
9
|
+
:"day-future":
|
10
|
+
:default:
|
11
|
+
0: "0 \xE5\xA4\xA9\xE5\xBE\x8C"
|
12
|
+
1: "1 \xE5\xA4\xA9\xE5\xBE\x8C"
|
13
|
+
:other: "{0} \xE5\xA4\xA9\xE5\xBE\x8C"
|
14
|
+
:"day-past":
|
15
|
+
:default:
|
16
|
+
0: "0 \xE5\xA4\xA9\xE5\x89\x8D"
|
17
|
+
1: "1 \xE5\xA4\xA9\xE5\x89\x8D"
|
18
|
+
:other: "{0} \xE5\xA4\xA9\xE5\x89\x8D"
|
19
|
+
:hour:
|
20
|
+
:default:
|
21
|
+
:other: "{0}\xE5\xB0\x8F\xE6\x99\x82"
|
22
|
+
:short:
|
23
|
+
:other: "{0}\xE5\xB0\x8F\xE6\x99\x82"
|
24
|
+
:"hour-future":
|
25
|
+
:default:
|
26
|
+
0: "0 \xE5\xB0\x8F\xE6\x99\x82\xE5\xBE\x8C"
|
27
|
+
1: "1 \xE5\xB0\x8F\xE6\x99\x82\xE5\xBE\x8C"
|
28
|
+
:other: "{0} \xE5\xB0\x8F\xE6\x99\x82\xE5\xBE\x8C"
|
29
|
+
:"hour-past":
|
30
|
+
:default:
|
31
|
+
0: "0 \xE5\xB0\x8F\xE6\x99\x82\xE5\x89\x8D"
|
32
|
+
1: "1 \xE5\xB0\x8F\xE6\x99\x82\xE5\x89\x8D"
|
33
|
+
:other: "{0} \xE5\xB0\x8F\xE6\x99\x82\xE5\x89\x8D"
|
34
|
+
:minute:
|
35
|
+
:default:
|
36
|
+
:other: "{0}\xE5\x88\x86"
|
37
|
+
:short:
|
38
|
+
:other: "{0}\xE5\x88\x86"
|
39
|
+
:"minute-future":
|
40
|
+
:default:
|
41
|
+
0: "0 \xE5\x88\x86\xE9\x90\x98\xE5\xBE\x8C"
|
42
|
+
1: "1 \xE5\x88\x86\xE9\x90\x98\xE5\xBE\x8C"
|
43
|
+
:other: "{0} \xE5\x88\x86\xE9\x90\x98\xE5\xBE\x8C"
|
44
|
+
:"minute-past":
|
45
|
+
:default:
|
46
|
+
0: "0 \xE5\x88\x86\xE9\x90\x98\xE5\x89\x8D"
|
47
|
+
1: "1 \xE5\x88\x86\xE9\x90\x98\xE5\x89\x8D"
|
48
|
+
:other: "{0} \xE5\x88\x86\xE9\x90\x98\xE5\x89\x8D"
|
49
|
+
:month:
|
50
|
+
:default:
|
51
|
+
:other: "{0}\xE6\x9C\x88"
|
52
|
+
:short:
|
53
|
+
:other: "{0}\xE6\x9C\x88"
|
54
|
+
:"month-future":
|
55
|
+
:default:
|
56
|
+
0: "0 \xE5\x80\x8B\xE6\x9C\x88\xE5\xBE\x8C"
|
57
|
+
1: "1 \xE5\x80\x8B\xE6\x9C\x88\xE5\xBE\x8C"
|
58
|
+
:other: "{0} \xE5\x80\x8B\xE6\x9C\x88\xE5\xBE\x8C"
|
59
|
+
:"month-past":
|
60
|
+
:default:
|
61
|
+
0: "0 \xE5\x80\x8B\xE6\x9C\x88\xE5\x89\x8D"
|
62
|
+
1: "1 \xE5\x80\x8B\xE6\x9C\x88\xE5\x89\x8D"
|
63
|
+
:other: "{0} \xE5\x80\x8B\xE6\x9C\x88\xE5\x89\x8D"
|
64
|
+
:second:
|
65
|
+
:default:
|
66
|
+
:other: "{0}\xE7\xA7\x92"
|
67
|
+
:short:
|
68
|
+
:other: "{0}\xE7\xA7\x92"
|
69
|
+
:"second-future":
|
70
|
+
:default:
|
71
|
+
0: "0 \xE7\xA7\x92\xE5\xBE\x8C"
|
72
|
+
1: "1 \xE7\xA7\x92\xE5\xBE\x8C"
|
73
|
+
:other: "{0} \xE7\xA7\x92\xE5\xBE\x8C"
|
74
|
+
:"second-past":
|
75
|
+
:default:
|
76
|
+
0: "0 \xE7\xA7\x92\xE5\x89\x8D"
|
77
|
+
1: "1 \xE7\xA7\x92\xE5\x89\x8D"
|
78
|
+
:other: "{0} \xE7\xA7\x92\xE5\x89\x8D"
|
79
|
+
:week:
|
80
|
+
:default:
|
81
|
+
:other: "{0}\xE9\x80\xB1"
|
82
|
+
:short:
|
83
|
+
:other: "{0}\xE9\x80\xB1"
|
84
|
+
:"week-future":
|
85
|
+
:default:
|
86
|
+
0: "0 \xE9\x80\xB1\xE5\xBE\x8C"
|
87
|
+
1: "1 \xE9\x80\xB1\xE5\xBE\x8C"
|
88
|
+
:other: "{0} \xE9\x80\xB1\xE5\xBE\x8C"
|
89
|
+
:"week-past":
|
90
|
+
:default:
|
91
|
+
0: "0 \xE9\x80\xB1\xE5\x89\x8D"
|
92
|
+
1: "1 \xE9\x80\xB1\xE5\x89\x8D"
|
93
|
+
:other: "{0} \xE9\x80\xB1\xE5\x89\x8D"
|
94
|
+
:year:
|
95
|
+
:default:
|
96
|
+
:other: "{0}\xE5\xB9\xB4"
|
97
|
+
:short:
|
98
|
+
:other: "{0}\xE5\xB9\xB4"
|
99
|
+
:"year-future":
|
100
|
+
:default:
|
101
|
+
0: "0 \xE5\xB9\xB4\xE5\xBE\x8C"
|
102
|
+
1: "1 \xE5\xB9\xB4\xE5\xBE\x8C"
|
103
|
+
:other: "{0} \xE5\xB9\xB4\xE5\xBE\x8C"
|
104
|
+
:"year-past":
|
105
|
+
:default:
|
106
|
+
0: "0 \xE5\xB9\xB4\xE5\x89\x8D"
|
107
|
+
1: "1 \xE5\xB9\xB4\xE5\x89\x8D"
|
108
|
+
:other: "{0} \xE5\xB9\xB4\xE5\x89\x8D"
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
# Copyright 2012 Twitter, Inc
|
4
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
|
6
|
+
# What's going on here?
|
7
|
+
# It's a bit too complicated to pass all the original Unicode Bidi tests, so we build our own suite against
|
8
|
+
# the GNU classpath verison of the Bidi algorithm. See lib/resources/bidi_test_importer.rb for the
|
9
|
+
# implementation of the test file generator.
|
10
|
+
|
11
|
+
require 'spec_helper'
|
12
|
+
|
13
|
+
include TwitterCldr::Shared
|
14
|
+
|
15
|
+
BIDI_TEST_PATH = File.join(File.dirname(__FILE__), 'classpath_bidi_test.txt')
|
16
|
+
DIRECTIONS = [nil, :LTR, :RTL]
|
17
|
+
|
18
|
+
def expand_bitset_str(bitset)
|
19
|
+
bitset.to_i.to_s(2).rjust(3, "0").chars.to_a.map { |i| i == "1" }.reverse
|
20
|
+
end
|
21
|
+
|
22
|
+
describe Bidi do
|
23
|
+
it "should pass the derived tests in classpath_bidi_test.txt" do
|
24
|
+
expected_level_data = []
|
25
|
+
expected_reorder_data = []
|
26
|
+
num_failed = 0
|
27
|
+
|
28
|
+
File.open(BIDI_TEST_PATH, 'r').each_line do |s|
|
29
|
+
cur_line = s.strip
|
30
|
+
first_char = cur_line[0]
|
31
|
+
first_char = first_char.chr if first_char.is_a?(Fixnum) # conversion for ruby 1.8
|
32
|
+
|
33
|
+
case first_char
|
34
|
+
when "#"
|
35
|
+
next
|
36
|
+
when "@"
|
37
|
+
if cur_line.include?("@Levels:")
|
38
|
+
expected_level_data = cur_line.gsub("@Levels:", "").strip.split(" ").map(&:to_i)
|
39
|
+
end
|
40
|
+
|
41
|
+
if cur_line.include?("@Reorder:")
|
42
|
+
expected_reorder_data = cur_line.gsub("@Reorder:", "").strip.split(" ").map(&:to_i)
|
43
|
+
end
|
44
|
+
else
|
45
|
+
input, bitset = cur_line.split("; ")
|
46
|
+
result_list = []
|
47
|
+
|
48
|
+
expand_bitset_str(bitset).each_with_index do |check, index|
|
49
|
+
if check
|
50
|
+
types = input.split(" ").map(&:to_sym)
|
51
|
+
bidi = TwitterCldr::Shared::Bidi.from_type_array(types, :direction => DIRECTIONS[index], :default_direction => :LTR)
|
52
|
+
|
53
|
+
passed = bidi.levels.each_with_index.all? do |level, idx|
|
54
|
+
level == expected_level_data[idx]
|
55
|
+
end
|
56
|
+
|
57
|
+
bidi.instance_variable_set(:'@string_arr', (0..5).to_a[0...types.size])
|
58
|
+
bidi.reorder_visually!
|
59
|
+
|
60
|
+
passed &&= bidi.string_arr.each_with_index.all? do |position, idx|
|
61
|
+
position == expected_reorder_data[idx]
|
62
|
+
end
|
63
|
+
|
64
|
+
num_failed += 1 unless passed
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
num_failed.should == 0
|
71
|
+
end
|
72
|
+
end
|