twitter_cldr 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/Gemfile +3 -7
- data/History.txt +6 -0
- data/README.md +1 -1
- data/Rakefile +26 -16
- data/lib/twitter_cldr/data_readers/number_data_reader.rb +9 -2
- data/lib/twitter_cldr/data_readers/timespan_data_reader.rb +11 -12
- data/lib/twitter_cldr/formatters/numbers/abbreviated/abbreviated_number_formatter.rb +10 -8
- data/lib/twitter_cldr/formatters/numbers/number_formatter.rb +2 -2
- data/lib/twitter_cldr/localized/localized_datetime.rb +1 -1
- data/lib/twitter_cldr/localized/localized_number.rb +13 -3
- data/lib/twitter_cldr/resources/collation_tries_dumper.rb +1 -2
- data/lib/twitter_cldr/resources/language_codes_importer.rb +1 -1
- data/lib/twitter_cldr/resources/locales_resources_importer.rb +13 -2
- data/lib/twitter_cldr/resources/tailoring_importer.rb +3 -2
- data/lib/twitter_cldr/shared/calendar.rb +4 -4
- data/lib/twitter_cldr/shared/postal_codes.rb +5 -7
- data/lib/twitter_cldr/version.rb +1 -1
- data/resources/collation/tailoring/de-CH.yml +4 -0
- data/resources/collation/tailoring/en-AU.yml +4 -0
- data/resources/collation/tailoring/en-CA.yml +4 -0
- data/resources/collation/tailoring/en-IE.yml +4 -0
- data/resources/collation/tailoring/en-SG.yml +4 -0
- data/resources/collation/tailoring/en-ZA.yml +4 -0
- data/resources/collation/tailoring/es-CO.yml +4 -0
- data/resources/collation/tailoring/es-MX.yml +4 -0
- data/resources/collation/tailoring/es-US.yml +4 -0
- data/resources/collation/tailoring/fr-BE.yml +4 -0
- data/resources/collation/tailoring/fr-CA.yml +4 -0
- data/resources/collation/tailoring/fr-CH.yml +4 -0
- data/resources/collation/tailoring/it-CH.yml +4 -0
- data/resources/collation/tries/af.dump +0 -0
- data/resources/collation/tries/ar.dump +0 -0
- data/resources/collation/tries/be.dump +0 -0
- data/resources/collation/tries/bg.dump +0 -0
- data/resources/collation/tries/bn.dump +0 -0
- data/resources/collation/tries/ca.dump +0 -0
- data/resources/collation/tries/cs.dump +0 -0
- data/resources/collation/tries/cy.dump +0 -0
- data/resources/collation/tries/da.dump +0 -0
- data/resources/collation/tries/de-CH.dump +0 -0
- data/resources/collation/tries/de.dump +0 -0
- data/resources/collation/tries/default.dump +0 -0
- data/resources/collation/tries/el.dump +0 -0
- data/resources/collation/tries/en-AU.dump +0 -0
- data/resources/collation/tries/en-CA.dump +0 -0
- data/resources/collation/tries/en-GB.dump +0 -0
- data/resources/collation/tries/en-IE.dump +0 -0
- data/resources/collation/tries/en-SG.dump +0 -0
- data/resources/collation/tries/en-ZA.dump +0 -0
- data/resources/collation/tries/en.dump +0 -0
- data/resources/collation/tries/es-CO.dump +0 -0
- data/resources/collation/tries/es-MX.dump +0 -0
- data/resources/collation/tries/es-US.dump +0 -0
- data/resources/collation/tries/es.dump +0 -0
- data/resources/collation/tries/eu.dump +0 -0
- data/resources/collation/tries/fa.dump +0 -0
- data/resources/collation/tries/fi.dump +0 -0
- data/resources/collation/tries/fil.dump +0 -0
- data/resources/collation/tries/fr-BE.dump +0 -0
- data/resources/collation/tries/fr-CA.dump +0 -0
- data/resources/collation/tries/fr-CH.dump +0 -0
- data/resources/collation/tries/fr.dump +0 -0
- data/resources/collation/tries/ga.dump +0 -0
- data/resources/collation/tries/gl.dump +0 -0
- data/resources/collation/tries/he.dump +0 -0
- data/resources/collation/tries/hi.dump +0 -0
- data/resources/collation/tries/hr.dump +0 -0
- data/resources/collation/tries/hu.dump +0 -0
- data/resources/collation/tries/id.dump +0 -0
- data/resources/collation/tries/is.dump +0 -0
- data/resources/collation/tries/it-CH.dump +0 -0
- data/resources/collation/tries/it.dump +0 -0
- data/resources/collation/tries/ja.dump +0 -0
- data/resources/collation/tries/ko.dump +0 -0
- data/resources/collation/tries/lv.dump +0 -0
- data/resources/collation/tries/ms.dump +0 -0
- data/resources/collation/tries/nb.dump +0 -0
- data/resources/collation/tries/nl.dump +0 -0
- data/resources/collation/tries/pl.dump +0 -0
- data/resources/collation/tries/pt.dump +0 -0
- data/resources/collation/tries/ro.dump +0 -0
- data/resources/collation/tries/ru.dump +0 -0
- data/resources/collation/tries/sk.dump +0 -0
- data/resources/collation/tries/sq.dump +0 -0
- data/resources/collation/tries/sr.dump +0 -0
- data/resources/collation/tries/sv.dump +0 -0
- data/resources/collation/tries/ta.dump +0 -0
- data/resources/collation/tries/th.dump +0 -0
- data/resources/collation/tries/tr.dump +0 -0
- data/resources/collation/tries/uk.dump +0 -0
- data/resources/collation/tries/ur.dump +0 -0
- data/resources/collation/tries/vi.dump +0 -0
- data/resources/collation/tries/zh-Hant.dump +0 -0
- data/resources/collation/tries/zh.dump +0 -0
- data/resources/locales/af/plurals.yml +2 -1
- data/resources/locales/af/units.yml +108 -108
- data/resources/locales/ar/plurals.yml +5 -4
- data/resources/locales/ar/units.yml +220 -220
- data/resources/locales/be/plurals.yml +6 -6
- data/resources/locales/be/units.yml +122 -122
- data/resources/locales/bg/plurals.yml +2 -1
- data/resources/locales/bg/units.yml +108 -108
- data/resources/locales/bn/plurals.yml +2 -1
- data/resources/locales/bn/units.yml +108 -108
- data/resources/locales/ca/plurals.yml +3 -2
- data/resources/locales/ca/units.yml +108 -108
- data/resources/locales/cs/plurals.yml +5 -5
- data/resources/locales/cs/units.yml +136 -136
- data/resources/locales/cy/plurals.yml +3 -3
- data/resources/locales/cy/units.yml +108 -220
- data/resources/locales/da/plurals.yml +3 -2
- data/resources/locales/da/units.yml +108 -108
- data/resources/locales/de-CH/calendars.yml +303 -0
- data/resources/locales/de-CH/currencies.yml +955 -0
- data/resources/locales/de-CH/languages.yml +583 -0
- data/resources/locales/de-CH/layout.yml +5 -0
- data/resources/locales/de-CH/lists.yml +23 -0
- data/resources/locales/de-CH/numbers.yml +62 -0
- data/resources/locales/de-CH/plurals.yml +5 -0
- data/resources/locales/de-CH/rbnf.yml +4 -0
- data/resources/locales/de-CH/territories.yml +264 -0
- data/resources/locales/de-CH/units.yml +108 -0
- data/resources/locales/de/plurals.yml +3 -2
- data/resources/locales/de/units.yml +108 -108
- data/resources/locales/el/plurals.yml +2 -1
- data/resources/locales/el/units.yml +108 -108
- data/resources/locales/en-AU/calendars.yml +208 -0
- data/resources/locales/en-AU/currencies.yml +953 -0
- data/resources/locales/en-AU/languages.yml +583 -0
- data/resources/locales/en-AU/layout.yml +5 -0
- data/resources/locales/en-AU/lists.yml +23 -0
- data/resources/locales/en-AU/numbers.yml +62 -0
- data/resources/locales/en-AU/plurals.yml +5 -0
- data/resources/locales/en-AU/rbnf.yml +4 -0
- data/resources/locales/en-AU/territories.yml +264 -0
- data/resources/locales/en-AU/units.yml +108 -0
- data/resources/locales/en-CA/calendars.yml +208 -0
- data/resources/locales/en-CA/currencies.yml +953 -0
- data/resources/locales/en-CA/languages.yml +583 -0
- data/resources/locales/en-CA/layout.yml +5 -0
- data/resources/locales/en-CA/lists.yml +23 -0
- data/resources/locales/en-CA/numbers.yml +62 -0
- data/resources/locales/en-CA/plurals.yml +5 -0
- data/resources/locales/en-CA/rbnf.yml +4 -0
- data/resources/locales/en-CA/territories.yml +264 -0
- data/resources/locales/en-CA/units.yml +108 -0
- data/resources/locales/en-GB/plurals.yml +3 -2
- data/resources/locales/en-GB/units.yml +108 -108
- data/resources/locales/en-IE/calendars.yml +208 -0
- data/resources/locales/en-IE/currencies.yml +953 -0
- data/resources/locales/en-IE/languages.yml +583 -0
- data/resources/locales/en-IE/layout.yml +5 -0
- data/resources/locales/en-IE/lists.yml +23 -0
- data/resources/locales/en-IE/numbers.yml +62 -0
- data/resources/locales/en-IE/plurals.yml +5 -0
- data/resources/locales/en-IE/rbnf.yml +4 -0
- data/resources/locales/en-IE/territories.yml +264 -0
- data/resources/locales/en-IE/units.yml +108 -0
- data/resources/locales/en-SG/calendars.yml +208 -0
- data/resources/locales/en-SG/currencies.yml +953 -0
- data/resources/locales/en-SG/languages.yml +583 -0
- data/resources/locales/en-SG/layout.yml +5 -0
- data/resources/locales/en-SG/lists.yml +23 -0
- data/resources/locales/en-SG/numbers.yml +62 -0
- data/resources/locales/en-SG/plurals.yml +5 -0
- data/resources/locales/en-SG/rbnf.yml +4 -0
- data/resources/locales/en-SG/territories.yml +264 -0
- data/resources/locales/en-SG/units.yml +108 -0
- data/resources/locales/en-ZA/calendars.yml +208 -0
- data/resources/locales/en-ZA/currencies.yml +954 -0
- data/resources/locales/en-ZA/languages.yml +583 -0
- data/resources/locales/en-ZA/layout.yml +5 -0
- data/resources/locales/en-ZA/lists.yml +23 -0
- data/resources/locales/en-ZA/numbers.yml +62 -0
- data/resources/locales/en-ZA/plurals.yml +5 -0
- data/resources/locales/en-ZA/rbnf.yml +4 -0
- data/resources/locales/en-ZA/territories.yml +264 -0
- data/resources/locales/en-ZA/units.yml +108 -0
- data/resources/locales/en/plurals.yml +3 -2
- data/resources/locales/en/units.yml +108 -108
- data/resources/locales/es-CO/calendars.yml +290 -0
- data/resources/locales/es-CO/currencies.yml +953 -0
- data/resources/locales/es-CO/languages.yml +583 -0
- data/resources/locales/es-CO/layout.yml +5 -0
- data/resources/locales/es-CO/lists.yml +23 -0
- data/resources/locales/es-CO/numbers.yml +62 -0
- data/resources/locales/es-CO/plurals.yml +4 -0
- data/resources/locales/es-CO/rbnf.yml +4 -0
- data/resources/locales/es-CO/territories.yml +264 -0
- data/resources/locales/es-CO/units.yml +108 -0
- data/resources/locales/es-MX/calendars.yml +290 -0
- data/resources/locales/es-MX/currencies.yml +1075 -0
- data/resources/locales/es-MX/languages.yml +583 -0
- data/resources/locales/es-MX/layout.yml +5 -0
- data/resources/locales/es-MX/lists.yml +23 -0
- data/resources/locales/es-MX/numbers.yml +62 -0
- data/resources/locales/es-MX/plurals.yml +4 -0
- data/resources/locales/es-MX/rbnf.yml +4 -0
- data/resources/locales/es-MX/territories.yml +264 -0
- data/resources/locales/es-MX/units.yml +108 -0
- data/resources/locales/es-US/calendars.yml +296 -0
- data/resources/locales/es-US/currencies.yml +953 -0
- data/resources/locales/es-US/languages.yml +583 -0
- data/resources/locales/es-US/layout.yml +5 -0
- data/resources/locales/es-US/lists.yml +23 -0
- data/resources/locales/es-US/numbers.yml +62 -0
- data/resources/locales/es-US/plurals.yml +4 -0
- data/resources/locales/es-US/rbnf.yml +4 -0
- data/resources/locales/es-US/territories.yml +264 -0
- data/resources/locales/es-US/units.yml +108 -0
- data/resources/locales/es/plurals.yml +2 -1
- data/resources/locales/es/units.yml +108 -108
- data/resources/locales/eu/plurals.yml +2 -1
- data/resources/locales/eu/units.yml +108 -108
- data/resources/locales/fa/plurals.yml +2 -1
- data/resources/locales/fa/units.yml +108 -108
- data/resources/locales/fi/plurals.yml +3 -2
- data/resources/locales/fi/units.yml +108 -108
- data/resources/locales/fil/plurals.yml +3 -2
- data/resources/locales/fil/units.yml +108 -108
- data/resources/locales/fr-BE/calendars.yml +305 -0
- data/resources/locales/fr-BE/currencies.yml +968 -0
- data/resources/locales/fr-BE/languages.yml +583 -0
- data/resources/locales/fr-BE/layout.yml +5 -0
- data/resources/locales/fr-BE/lists.yml +23 -0
- data/resources/locales/fr-BE/numbers.yml +62 -0
- data/resources/locales/fr-BE/plurals.yml +4 -0
- data/resources/locales/fr-BE/rbnf.yml +596 -0
- data/resources/locales/fr-BE/territories.yml +264 -0
- data/resources/locales/fr-BE/units.yml +108 -0
- data/resources/locales/fr-CA/calendars.yml +308 -0
- data/resources/locales/fr-CA/currencies.yml +968 -0
- data/resources/locales/fr-CA/languages.yml +583 -0
- data/resources/locales/fr-CA/layout.yml +5 -0
- data/resources/locales/fr-CA/lists.yml +23 -0
- data/resources/locales/fr-CA/numbers.yml +62 -0
- data/resources/locales/fr-CA/plurals.yml +4 -0
- data/resources/locales/fr-CA/rbnf.yml +4 -0
- data/resources/locales/fr-CA/territories.yml +264 -0
- data/resources/locales/fr-CA/units.yml +108 -0
- data/resources/locales/fr-CH/calendars.yml +307 -0
- data/resources/locales/fr-CH/currencies.yml +969 -0
- data/resources/locales/fr-CH/languages.yml +583 -0
- data/resources/locales/fr-CH/layout.yml +5 -0
- data/resources/locales/fr-CH/lists.yml +23 -0
- data/resources/locales/fr-CH/numbers.yml +62 -0
- data/resources/locales/fr-CH/plurals.yml +4 -0
- data/resources/locales/fr-CH/rbnf.yml +599 -0
- data/resources/locales/fr-CH/territories.yml +264 -0
- data/resources/locales/fr-CH/units.yml +108 -0
- data/resources/locales/fr/plurals.yml +2 -1
- data/resources/locales/fr/units.yml +108 -108
- data/resources/locales/ga/plurals.yml +4 -3
- data/resources/locales/ga/units.yml +108 -108
- data/resources/locales/gl/plurals.yml +3 -2
- data/resources/locales/gl/units.yml +108 -108
- data/resources/locales/he/plurals.yml +5 -5
- data/resources/locales/he/units.yml +164 -164
- data/resources/locales/hi/plurals.yml +2 -1
- data/resources/locales/hi/units.yml +108 -108
- data/resources/locales/hr/plurals.yml +7 -11
- data/resources/locales/hr/units.yml +164 -164
- data/resources/locales/hu/plurals.yml +2 -1
- data/resources/locales/hu/units.yml +108 -108
- data/resources/locales/id/plurals.yml +2 -1
- data/resources/locales/id/units.yml +108 -108
- data/resources/locales/is/plurals.yml +4 -4
- data/resources/locales/is/units.yml +108 -108
- data/resources/locales/it-CH/calendars.yml +291 -0
- data/resources/locales/it-CH/currencies.yml +954 -0
- data/resources/locales/it-CH/languages.yml +583 -0
- data/resources/locales/it-CH/layout.yml +5 -0
- data/resources/locales/it-CH/lists.yml +23 -0
- data/resources/locales/it-CH/numbers.yml +62 -0
- data/resources/locales/it-CH/plurals.yml +5 -0
- data/resources/locales/it-CH/rbnf.yml +4 -0
- data/resources/locales/it-CH/territories.yml +264 -0
- data/resources/locales/it-CH/units.yml +108 -0
- data/resources/locales/it/plurals.yml +3 -2
- data/resources/locales/it/units.yml +108 -108
- data/resources/locales/ja/plurals.yml +2 -1
- data/resources/locales/ja/units.yml +108 -108
- data/resources/locales/ko/plurals.yml +2 -1
- data/resources/locales/ko/units.yml +108 -108
- data/resources/locales/lv/plurals.yml +8 -10
- data/resources/locales/lv/units.yml +136 -136
- data/resources/locales/ms/plurals.yml +2 -1
- data/resources/locales/ms/units.yml +108 -108
- data/resources/locales/nb/plurals.yml +2 -1
- data/resources/locales/nb/units.yml +108 -108
- data/resources/locales/nl/plurals.yml +3 -2
- data/resources/locales/nl/units.yml +108 -108
- data/resources/locales/pl/plurals.yml +8 -10
- data/resources/locales/pl/units.yml +164 -164
- data/resources/locales/pt/plurals.yml +4 -3
- data/resources/locales/pt/units.yml +108 -108
- data/resources/locales/ro/plurals.yml +5 -4
- data/resources/locales/ro/units.yml +136 -136
- data/resources/locales/ru/plurals.yml +6 -7
- data/resources/locales/ru/units.yml +164 -164
- data/resources/locales/sk/plurals.yml +5 -5
- data/resources/locales/sk/units.yml +136 -136
- data/resources/locales/sq/plurals.yml +2 -1
- data/resources/locales/sq/units.yml +108 -108
- data/resources/locales/sr/plurals.yml +7 -11
- data/resources/locales/sr/units.yml +164 -164
- data/resources/locales/sv/plurals.yml +3 -2
- data/resources/locales/sv/units.yml +108 -108
- data/resources/locales/ta/plurals.yml +2 -1
- data/resources/locales/ta/units.yml +108 -108
- data/resources/locales/th/plurals.yml +2 -1
- data/resources/locales/th/units.yml +108 -108
- data/resources/locales/tr/plurals.yml +2 -1
- data/resources/locales/tr/units.yml +108 -108
- data/resources/locales/uk/plurals.yml +8 -9
- data/resources/locales/uk/units.yml +164 -164
- data/resources/locales/ur/plurals.yml +3 -2
- data/resources/locales/ur/units.yml +108 -108
- data/resources/locales/vi/plurals.yml +2 -1
- data/resources/locales/vi/units.yml +108 -108
- data/resources/locales/zh-Hant/plurals.yml +3 -2
- data/resources/locales/zh-Hant/units.yml +108 -108
- data/resources/locales/zh/plurals.yml +2 -1
- data/resources/locales/zh/units.yml +108 -108
- data/resources/shared/language_codes_table.dump +0 -0
- data/resources/shared/phone_codes.yml +9 -1
- data/resources/shared/postal_codes.yml +1276 -333
- data/resources/shared/segments/segments_root.yml +3 -0
- data/spec/data_readers/timespan_data_reader_spec.rb +16 -0
- data/spec/formatters/calendars/datetime_formatter_spec.rb +2 -2
- data/spec/formatters/numbers/abbreviated/abbreviated_number_formatter_spec.rb +25 -17
- data/spec/formatters/numbers/abbreviated/short_decimal_formatter_spec.rb +47 -34
- data/spec/formatters/numbers/currency_formatter_spec.rb +1 -1
- data/spec/formatters/numbers/decimal_formatter_spec.rb +1 -1
- data/spec/formatters/numbers/number_formatter_spec.rb +1 -1
- data/spec/formatters/numbers/percent_formatter_spec.rb +1 -1
- data/spec/formatters/numbers/rbnf/locales/de-CH/rbnf_test.yml +940 -0
- data/spec/formatters/numbers/rbnf/locales/en-AU/rbnf_test.yml +1291 -0
- data/spec/formatters/numbers/rbnf/locales/en-CA/rbnf_test.yml +1291 -0
- data/spec/formatters/numbers/rbnf/locales/en-IE/rbnf_test.yml +1291 -0
- data/spec/formatters/numbers/rbnf/locales/en-SG/rbnf_test.yml +1291 -0
- data/spec/formatters/numbers/rbnf/locales/en-ZA/rbnf_test.yml +1291 -0
- data/spec/formatters/numbers/rbnf/locales/es-CO/rbnf_test.yml +1642 -0
- data/spec/formatters/numbers/rbnf/locales/es-MX/rbnf_test.yml +1642 -0
- data/spec/formatters/numbers/rbnf/locales/es-US/rbnf_test.yml +1642 -0
- data/spec/formatters/numbers/rbnf/locales/fr-BE/rbnf_test.yml +1408 -0
- data/spec/formatters/numbers/rbnf/locales/fr-CA/rbnf_test.yml +1408 -0
- data/spec/formatters/numbers/rbnf/locales/fr-CH/rbnf_test.yml +1408 -0
- data/spec/formatters/numbers/rbnf/locales/it-CH/rbnf_test.yml +1174 -0
- data/spec/formatters/plurals/rules_spec.rb +4 -0
- data/spec/localized/localized_datetime_spec.rb +1 -1
- data/spec/localized/localized_number_spec.rb +28 -0
- data/spec/localized/localized_time_spec.rb +1 -1
- data/spec/shared/calendar_spec.rb +4 -1
- data/spec/tokenizers/calendars/date_tokenizer_spec.rb +3 -3
- data/spec/tokenizers/calendars/datetime_tokenizer_spec.rb +1 -2
- data/spec/tokenizers/calendars/time_tokenizer_spec.rb +2 -2
- data/spec/tokenizers/numbers/number_tokenizer_spec.rb +4 -4
- metadata +399 -230
- data/spec/data_readers/timespan_data_reader.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ODMyYmYzMDM4ODg4NjY1OTIzOGMxNDY1MTRkNWI5YzU2Njg4ZDI1Yg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
N2YxZWZlMDNhZDRjODI3NGU1OGZlZWVhZjNhMDk0NzBhYjQ3ZGU5Mg==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
OGE2MTZmYTZhYTg2ZDBiZjA5MDk0YWQ1YTRlZjEzYjA5MzQ1ZDI2Y2IxYzg5
|
10
|
+
MjlhYjdhYmVkMzUyN2M4ZmU2NTljNzQ1YTUwZWIyNzFjYTYyODk1ZDdiZDA3
|
11
|
+
NzY4ZGJlNDIxOTdkYjhlMjRiMzNkYmQ5Njg0NDcxZjAzY2RiYjU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODM4YjY1MmI1MzQ2MWRmZTZkYjIyYTk1MTU0NmU4ODNhNDAyZTRjMzJiY2Yw
|
14
|
+
MDM3NGUwNmNiODY4NGIwNjA1YmRhOGQ4YzNiZjE2YzU5OGE0NGE2NDlmMGIy
|
15
|
+
NmI3NGZiMTM5ODk0YWI5YThhZDBiYWM3NzBmODhmYTBkNzk5MjE=
|
data/Gemfile
CHANGED
@@ -5,10 +5,8 @@ gemspec
|
|
5
5
|
group :development, :test do
|
6
6
|
gem 'rake'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
gem 'pry-nav'
|
11
|
-
end
|
8
|
+
gem 'pry'
|
9
|
+
gem 'pry-nav'
|
12
10
|
|
13
11
|
platform :rbx do
|
14
12
|
gem 'rubinius-debugger'
|
@@ -28,9 +26,7 @@ end
|
|
28
26
|
group :development do
|
29
27
|
gem 'nokogiri', "~> 1.5.9"
|
30
28
|
|
31
|
-
|
32
|
-
# gem 'ruby-cldr', :github => 'svenfuchs/ruby-cldr'
|
33
|
-
gem 'ruby-cldr', :github => 'camertron/ruby-cldr', :branch => "segmentation"
|
29
|
+
gem 'ruby-cldr', :github => 'svenfuchs/ruby-cldr', :tag => 'v0.1.1'
|
34
30
|
end
|
35
31
|
|
36
32
|
group :test do
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -472,7 +472,7 @@ postal_code.regexp # /\d{5}([ \-]\d{4})?/
|
|
472
472
|
Get a sample of valid postal codes with the `#sample` method:
|
473
473
|
|
474
474
|
```ruby
|
475
|
-
postal_code.sample(5) # ["
|
475
|
+
postal_code.sample(5) # ["15175", "65142", "23110", "81366", "81295-6386"]
|
476
476
|
```
|
477
477
|
|
478
478
|
### Phone Codes
|
data/Rakefile
CHANGED
@@ -62,22 +62,30 @@ else
|
|
62
62
|
end
|
63
63
|
|
64
64
|
task :update do
|
65
|
-
tasks =
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
"update
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
65
|
+
tasks = if RUBY_PLATFORM == 'java'
|
66
|
+
# these should be run using JRuby 1.7 in 1.9 mode and CLDR v23 (v24 collation rules syntax is not supported yet)
|
67
|
+
[
|
68
|
+
"update:tailoring_data", # per locale
|
69
|
+
"update:collation_tries", # per locale, must come after update:tailoring_data
|
70
|
+
"update:rbnf_tests", # per locale
|
71
|
+
]
|
72
|
+
else
|
73
|
+
puts "You might also want to run this rake task using JRuby 1.7 (in 1.9 mode) to update collation data and RBNF tests."
|
74
|
+
|
75
|
+
[
|
76
|
+
"update:locales_resources", # per locale
|
77
|
+
"update:unicode_data",
|
78
|
+
"update:unicode_properties",
|
79
|
+
"update:generate_casefolder", # must come after unicode data
|
80
|
+
"update:composition_exclusions",
|
81
|
+
"update:postal_codes",
|
82
|
+
"update:phone_codes",
|
83
|
+
"update:language_codes",
|
84
|
+
"update:canonical_compositions",
|
85
|
+
"update:segment_exceptions", # per locale
|
86
|
+
"update:readme"
|
87
|
+
]
|
88
|
+
end
|
81
89
|
|
82
90
|
tasks.each do |task|
|
83
91
|
puts "Executing #{task}"
|
@@ -85,6 +93,8 @@ task :update do
|
|
85
93
|
end
|
86
94
|
end
|
87
95
|
|
96
|
+
# TODO: 'add_locale' task that creates a new directory and runs all necessary 'update' tasks (+ suggests to run those that depend on JRuby)
|
97
|
+
|
88
98
|
namespace :update do
|
89
99
|
ICU_JAR = './vendor/icu4j-51_2.jar'
|
90
100
|
|
@@ -11,8 +11,8 @@ module TwitterCldr
|
|
11
11
|
ABBREVIATED_MIN_POWER = 3
|
12
12
|
ABBREVIATED_MAX_POWER = 14
|
13
13
|
|
14
|
-
NUMBER_MAX = 10 ** (ABBREVIATED_MAX_POWER + 1)
|
15
14
|
NUMBER_MIN = 10 ** ABBREVIATED_MIN_POWER
|
15
|
+
NUMBER_MAX = 10 ** (ABBREVIATED_MAX_POWER + 1)
|
16
16
|
|
17
17
|
BASE_PATH = [:numbers, :formats]
|
18
18
|
SYMBOL_PATH = [:numbers, :symbols]
|
@@ -34,6 +34,10 @@ module TwitterCldr
|
|
34
34
|
|
35
35
|
attr_reader :type, :format
|
36
36
|
|
37
|
+
def self.types
|
38
|
+
TYPE_PATHS.keys
|
39
|
+
end
|
40
|
+
|
37
41
|
def initialize(locale, options = {})
|
38
42
|
super(locale)
|
39
43
|
@type = options[:type] || DEFAULT_TYPE
|
@@ -98,7 +102,7 @@ module TwitterCldr
|
|
98
102
|
|
99
103
|
def valid_type_for?(number, type)
|
100
104
|
if abbreviated?(type)
|
101
|
-
(number
|
105
|
+
self.class.within_abbreviation_range?(number)
|
102
106
|
else
|
103
107
|
TYPE_PATHS.include?(type)
|
104
108
|
end
|
@@ -137,6 +141,9 @@ module TwitterCldr
|
|
137
141
|
end
|
138
142
|
end
|
139
143
|
|
144
|
+
def self.within_abbreviation_range?(number)
|
145
|
+
NUMBER_MIN <= number && number < NUMBER_MAX
|
146
|
+
end
|
140
147
|
end
|
141
148
|
end
|
142
149
|
end
|
@@ -82,16 +82,8 @@ module TwitterCldr
|
|
82
82
|
TwitterCldr::Formatters::TimespanFormatter.new(self)
|
83
83
|
end
|
84
84
|
|
85
|
-
def all_types
|
86
|
-
traverse(BASE_PATH + [PATHS[direction][unit]]).keys
|
87
|
-
end
|
88
|
-
|
89
85
|
protected
|
90
86
|
|
91
|
-
def default_type
|
92
|
-
all_types.first
|
93
|
-
end
|
94
|
-
|
95
87
|
def pluralization_for(rule, available)
|
96
88
|
# sometimes the plural rule will return ":one" when the resource only contains a path with "1"
|
97
89
|
case rule
|
@@ -111,12 +103,19 @@ module TwitterCldr
|
|
111
103
|
end
|
112
104
|
|
113
105
|
def resource
|
114
|
-
@resource
|
115
|
-
raw = TwitterCldr.get_locale_resource(locale, :units)
|
116
|
-
raw[TwitterCldr.convert_locale(locale)]
|
117
|
-
end
|
106
|
+
@resource ||= self.class.resource_for_locale(locale)
|
118
107
|
end
|
119
108
|
|
109
|
+
class << self
|
110
|
+
def all_types_for(locale, unit, direction)
|
111
|
+
TwitterCldr::Utils.traverse_hash(resource_for_locale(locale), BASE_PATH + [PATHS[direction][unit]]).keys
|
112
|
+
end
|
113
|
+
|
114
|
+
def resource_for_locale(locale)
|
115
|
+
@resources ||= {}
|
116
|
+
@resources[locale] ||= TwitterCldr.get_locale_resource(locale, :units)[TwitterCldr.convert_locale(locale)]
|
117
|
+
end
|
118
|
+
end
|
120
119
|
end
|
121
120
|
end
|
122
121
|
end
|
@@ -7,16 +7,18 @@ module TwitterCldr
|
|
7
7
|
module Formatters
|
8
8
|
class AbbreviatedNumberFormatter < NumberFormatter
|
9
9
|
|
10
|
-
|
10
|
+
FORMAT_REGEX = /^0+$/
|
11
11
|
|
12
|
-
|
13
|
-
within = number < TwitterCldr::DataReaders::NumberDataReader::NUMBER_MAX &&
|
14
|
-
number >= TwitterCldr::DataReaders::NumberDataReader::NUMBER_MIN
|
12
|
+
protected
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
def truncate_number(number, integer_format)
|
15
|
+
if TwitterCldr::DataReaders::NumberDataReader.within_abbreviation_range?(number)
|
16
|
+
if integer_format.format =~ FORMAT_REGEX
|
17
|
+
factor = [0, number.to_i.to_s.length - integer_format.format.length].max
|
18
|
+
number / (10.0 ** factor)
|
19
|
+
else
|
20
|
+
raise ArgumentError.new("unexpected format string #{integer_format.inspect}")
|
21
|
+
end
|
20
22
|
else
|
21
23
|
number
|
22
24
|
end
|
@@ -25,7 +25,7 @@ module TwitterCldr
|
|
25
25
|
options[:type] ||= :decimal
|
26
26
|
|
27
27
|
prefix, suffix, integer_format, fraction_format = *partition_tokens(tokens)
|
28
|
-
number =
|
28
|
+
number = truncate_number(number, integer_format)
|
29
29
|
|
30
30
|
int, fraction = parse_number(number, options)
|
31
31
|
result = integer_format.apply(int, options)
|
@@ -46,7 +46,7 @@ module TwitterCldr
|
|
46
46
|
)
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
49
|
+
def truncate_number(number, integer_format)
|
50
50
|
number # noop for base class
|
51
51
|
end
|
52
52
|
|
@@ -17,7 +17,7 @@ module TwitterCldr
|
|
17
17
|
|
18
18
|
class << self
|
19
19
|
def types
|
20
|
-
TwitterCldr::DataReaders::NumberDataReader
|
20
|
+
TwitterCldr::DataReaders::NumberDataReader.types
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -33,8 +33,18 @@ module TwitterCldr
|
|
33
33
|
:format => @format
|
34
34
|
})
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
pattern = data_reader.pattern(base_obj)
|
37
|
+
|
38
|
+
if pattern == 0
|
39
|
+
# can't format the number for current locale
|
40
|
+
base_obj.to_s
|
41
|
+
else
|
42
|
+
data_reader.formatter.format(
|
43
|
+
data_reader.tokenizer.tokenize(pattern),
|
44
|
+
base_obj,
|
45
|
+
options.merge(:type => @type)
|
46
|
+
)
|
47
|
+
end
|
38
48
|
end
|
39
49
|
|
40
50
|
def plural_rule
|
@@ -12,8 +12,7 @@ module TwitterCldr
|
|
12
12
|
|
13
13
|
def update_dumps
|
14
14
|
update_default_trie_dump
|
15
|
-
|
16
|
-
[:he].each { |locale| update_tailoring_trie_dump(locale) }
|
15
|
+
TwitterCldr.supported_locales.each { |locale| update_tailoring_trie_dump(locale) }
|
17
16
|
end
|
18
17
|
|
19
18
|
private
|
@@ -13,7 +13,7 @@ module TwitterCldr
|
|
13
13
|
BCP_47_FILE, ISO_639_FILE = %w[bcp-47.txt iso-639.txt]
|
14
14
|
|
15
15
|
INPUT_DATA = {
|
16
|
-
BCP_47_FILE => 'http://www.iana.org/assignments/language-subtag-registry',
|
16
|
+
BCP_47_FILE => 'http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry',
|
17
17
|
ISO_639_FILE => 'http://www-01.sil.org/iso639-3/iso-639-3_20120614.tab'
|
18
18
|
}
|
19
19
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# Copyright 2012 Twitter, Inc
|
4
4
|
# http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
|
6
|
+
require 'fileutils'
|
6
7
|
require 'cldr/export'
|
7
8
|
|
8
9
|
require 'twitter_cldr/resources/download'
|
@@ -12,7 +13,8 @@ module TwitterCldr
|
|
12
13
|
|
13
14
|
class LocalesResourcesImporter
|
14
15
|
|
15
|
-
# NOTE: units.yml was NOT updated to cldr 24 (too many significant changes) - add back in when appropriate
|
16
|
+
# NOTE: units.yml was NOT updated to cldr 24 (too many significant changes) - add back in when appropriate.
|
17
|
+
# Meanwhile, use ruby-cldr v0.0.2 and CLDR 22.1 to update units.yml files.
|
16
18
|
LOCALE_COMPONENTS = %w[calendars languages numbers plurals lists layout currencies territories rbnf] # units
|
17
19
|
SHARED_COMPONENTS = %w[currency_digits_and_rounding rbnf_root numbering_systems segments_root]
|
18
20
|
|
@@ -43,7 +45,15 @@ module TwitterCldr
|
|
43
45
|
def copy_zh_hant_plurals
|
44
46
|
File.open(File.join(@output_path, 'locales', 'zh-Hant', 'plurals.yml'), 'w:utf-8') do |output|
|
45
47
|
data = YAML.load(File.read(File.join(@output_path, 'locales', 'zh', 'plurals.yml')))
|
46
|
-
output.write(YAML.dump(:'zh-Hant' => data[:zh].gsub('
|
48
|
+
output.write(YAML.dump(:'zh-Hant' => data[:zh].gsub(":'zh'", ":'zh-Hant'")))
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def move_segments_root_file
|
53
|
+
file_path = File.join(@output_path, 'shared', 'segments_root.yml')
|
54
|
+
|
55
|
+
if File.file?(file_path)
|
56
|
+
FileUtils.move(file_path, File.join(@output_path, 'shared', 'segments', 'segments_root.yml'))
|
47
57
|
end
|
48
58
|
end
|
49
59
|
|
@@ -72,6 +82,7 @@ module TwitterCldr
|
|
72
82
|
deep_symbolize(component, locale, path)
|
73
83
|
end
|
74
84
|
|
85
|
+
move_segments_root_file
|
75
86
|
copy_zh_hant_plurals
|
76
87
|
end
|
77
88
|
|
@@ -10,7 +10,8 @@ require 'twitter_cldr/resources/download'
|
|
10
10
|
|
11
11
|
module TwitterCldr
|
12
12
|
module Resources
|
13
|
-
# This class should be used with JRuby 1.7 in 1.9 mode
|
13
|
+
# This class should be used with JRuby 1.7 in 1.9 mode, ICU4J version >= 49.1,
|
14
|
+
# and CLDR version <= 23 (v24 syntax is not supported yet).
|
14
15
|
#
|
15
16
|
class TailoringImporter < IcuBasedImporter
|
16
17
|
|
@@ -225,7 +226,7 @@ module TwitterCldr
|
|
225
226
|
end
|
226
227
|
|
227
228
|
def get_code_points(string)
|
228
|
-
TwitterCldr::
|
229
|
+
TwitterCldr::Utils::CodePoints.from_string(TwitterCldr::Normalization.normalize(string))
|
229
230
|
end
|
230
231
|
|
231
232
|
end
|
@@ -86,6 +86,10 @@ module TwitterCldr
|
|
86
86
|
get_order_for(TwitterCldr::DataReaders::DateTimeDataReader, options)
|
87
87
|
end
|
88
88
|
|
89
|
+
def calendar_data
|
90
|
+
@calendar_data ||= TwitterCldr::Utils.traverse_hash(resource, [locale, :calendars, calendar_type])
|
91
|
+
end
|
92
|
+
|
89
93
|
private
|
90
94
|
|
91
95
|
def cache_field_data(field, names_form = nil, format = nil)
|
@@ -154,10 +158,6 @@ module TwitterCldr
|
|
154
158
|
Regexp.new("^calendars\.#{calendar_type}\.(.*)$")
|
155
159
|
end
|
156
160
|
|
157
|
-
def calendar_data
|
158
|
-
@calendar_data ||= TwitterCldr::Utils.traverse_hash(resource, [locale, :calendars, calendar_type])
|
159
|
-
end
|
160
|
-
|
161
161
|
def resource
|
162
162
|
TwitterCldr.get_locale_resource(@locale, :calendars)
|
163
163
|
end
|
@@ -19,13 +19,11 @@ module TwitterCldr
|
|
19
19
|
def for_territory(territory)
|
20
20
|
key = territory.to_s.downcase.to_sym
|
21
21
|
if res = resource[key]
|
22
|
-
territory_cache[key] ||=
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
)
|
28
|
-
end
|
22
|
+
territory_cache[key] ||= new(
|
23
|
+
territory,
|
24
|
+
res[:regex],
|
25
|
+
TwitterCldr::Utils::RegexpAst.load(res[:ast])
|
26
|
+
)
|
29
27
|
else
|
30
28
|
raise InvalidTerritoryError, "invalid territory"
|
31
29
|
end
|
data/lib/twitter_cldr/version.rb
CHANGED