worldwide 1.6.0 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/npm-release.yml +5 -1
- data/CHANGELOG.md +10 -1
- data/Gemfile.lock +2 -1
- data/README.md +9 -2
- data/db/data/regions/BR/pt-BR.yml +2 -2
- data/db/data/regions/CH/pt-BR.yml +2 -2
- data/db/data/regions/DE/pt-BR.yml +2 -2
- data/db/data/regions/DK/pt-BR.yml +2 -2
- data/db/data/regions/ES/pt-BR.yml +2 -2
- data/db/data/regions/IT/pt-BR.yml +2 -2
- data/db/data/regions/JP.yml +1 -0
- data/db/data/regions/NL/pt-BR.yml +2 -2
- data/db/data/regions/NO/pt-BR.yml +2 -2
- data/db/data/regions/SE/pt-BR.yml +3 -3
- data/db/data/regions/_default/ja.yml +3 -3
- data/db/data/regions/_default/nl.yml +40 -40
- data/db/data/regions/_default/zh-TW.yml +33 -33
- data/lib/worldwide/units.rb +58 -54
- data/lib/worldwide/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb522e094858b83229463d40525a2ce96d80d421b7ed86da659eb6189c64fccc
|
4
|
+
data.tar.gz: 4f4317d023d51215356ff17b60658903875a1079c8f7fdc5501acdcb9c2f9706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de6b9334ce2b5e36ff9e1c431013e42fb4adb799561dd3ea59a5d42fbe2628c963adac2eb15ddc104209cf8172e4e4bb71b4d19338b398400d91641730b5e528
|
7
|
+
data.tar.gz: ddc4de7291e96a03f73e57da50c75720884f63298c9f78ef3b606706b279a1cb20899648f0e17bacebb84c747bbece697f043b3f8cba9478317ac4ca217093be
|
@@ -17,6 +17,8 @@ jobs:
|
|
17
17
|
steps:
|
18
18
|
- name: Checkout Repo
|
19
19
|
uses: actions/checkout@v3
|
20
|
+
with:
|
21
|
+
token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
|
20
22
|
- name: Setup Node
|
21
23
|
uses: actions/setup-node@v3
|
22
24
|
with:
|
@@ -33,6 +35,8 @@ jobs:
|
|
33
35
|
with:
|
34
36
|
publish: pnpm release
|
35
37
|
cwd: lang/typescript
|
38
|
+
title: Version NPM Package
|
39
|
+
commit: Version NPM Package
|
36
40
|
env:
|
37
41
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
38
|
-
GITHUB_TOKEN: ${{ secrets.
|
42
|
+
GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
|
data/CHANGELOG.md
CHANGED
@@ -26,9 +26,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
26
26
|
- Security in case of vulnerabilities.
|
27
27
|
|
28
28
|
## [Unreleased]
|
29
|
+
- Nil.
|
29
30
|
|
30
31
|
---
|
31
32
|
|
33
|
+
## [1.6.2] - 2024-07-10
|
34
|
+
|
35
|
+
- Improve tests related to building number requiredness [#249](https://github.com/Shopify/worldwide/pull/249)
|
36
|
+
- Update Dutch translations for street_number [#236](https://github.com/Shopify/worldwide/pull/236)
|
37
|
+
|
38
|
+
## [1.6.1] - 2024-07-03
|
39
|
+
- Move Units constants `SUPPORTED_HUMANIZATIONS` and `MEASUREMENT_KEYS` to `Worldwide.units.supported_humanizations` and `Worldwide.units.measurement_keys` [#240](https://github.com/Shopify/worldwide/pull/240)
|
40
|
+
- Allow house numbers on address2 for Japan [#245](https://github.com/Shopify/worldwide/pull/245)
|
41
|
+
|
32
42
|
## [1.6.0] - 2024-06-21
|
33
43
|
- Support multiple script-based address concatenation rules for each country [#224](https://github.com/Shopify/worldwide/pull/224)
|
34
44
|
- Fixed a typo in list of supported scripts from `Latn` to `Latin`
|
@@ -39,7 +49,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
39
49
|
## [1.4.1] - 2024-06-17
|
40
50
|
- Add translations for neighborhood error strings in AE, CR, KW, PA, PE, SA [#220](https://github.com/Shopify/worldwide/pull/220)
|
41
51
|
|
42
|
-
|
43
52
|
## [1.4.0] - 2024-06-14
|
44
53
|
- Add localized error strings for neighborhood in AE, CR, KW, PA, PE, SA [#215](https://github.com/Shopify/worldwide/pull/215)
|
45
54
|
- Change delimiter from Non-Breaking Space to Word Joiner [#221](https://github.com/Shopify/worldwide/pull/221)
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,7 @@ GIT
|
|
13
13
|
PATH
|
14
14
|
remote: .
|
15
15
|
specs:
|
16
|
-
worldwide (1.6.
|
16
|
+
worldwide (1.6.2)
|
17
17
|
activesupport (>= 7.0)
|
18
18
|
i18n
|
19
19
|
phonelib (~> 0.8)
|
@@ -126,6 +126,7 @@ GEM
|
|
126
126
|
PLATFORMS
|
127
127
|
arm64-darwin-21
|
128
128
|
arm64-darwin-22
|
129
|
+
arm64-darwin-23
|
129
130
|
x86_64-linux
|
130
131
|
|
131
132
|
DEPENDENCIES
|
data/README.md
CHANGED
@@ -74,10 +74,17 @@ I18n.enforce_available_locales = false
|
|
74
74
|
|
75
75
|
Here the list of the features we currently support:
|
76
76
|
|
77
|
-
- [🌏 Regions](#--regions-countries--territories--subdivisions--states--provinces--prefectures--etc)
|
77
|
+
- [🌏 Regions (Countries / Territories / Subdivisions / States / Provinces / Prefectures / etc.)](#--regions-countries--territories--subdivisions--states--provinces--prefectures--etc)
|
78
|
+
- [Regional Validations](#regional-validations)
|
79
|
+
- [Phone Validations](#phone-validations)
|
78
80
|
- [📫 Addresses](#--addresses)
|
81
|
+
- [Formatting](#formatting)
|
82
|
+
- [Validation](#validation)
|
83
|
+
- [Auto-correction](#auto-correction)
|
79
84
|
- [🗓 / ⌚ Date and Time formats](#-----date-and-time-formats)
|
85
|
+
- [Calendar quarter formatting](#calendar-quarter-formatting)
|
80
86
|
- [📅 Calendar Information](#--calendar-information)
|
87
|
+
- [Month and Weekday labels](#month-and-weekday-labels)
|
81
88
|
- [🕰 Localized Timezone](#--localized-timezone)
|
82
89
|
- [➡🕰 Map Deprecated Timezone Name to Modern Name](#--map-deprecated-timezone-name-to-modern-name)
|
83
90
|
- [👥 Names](#--names)
|
@@ -898,7 +905,7 @@ This module provides localized measurement unit formatting.
|
|
898
905
|
|
899
906
|
`Units.format` supports the following arguments:
|
900
907
|
- `amount`: the amount associated with the unit. This parameter is used to apply the unique pluralization rules of the requested locale.
|
901
|
-
- `unit`: the measurement unit.
|
908
|
+
- `unit`: the measurement unit. The keys listed in [`Worldwide.Units.measurement_keys`](https://github.com/Shopify/worldwide/blob/main/lib/worldwide/units.rb#L23-L70) are supported.
|
902
909
|
- `humanize`: can be `:long` or `:short`. `:long` returns the translated word of the unit. `:short` returns the localized abbreviation of the unit. The default value is `:short`.
|
903
910
|
|
904
911
|
```ruby
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
data/db/data/regions/JP.yml
CHANGED
@@ -13,6 +13,7 @@ zip_regex: "\\A〒?(\\d{7}|[0-9|0-9]{3}(-|ー)[0-9|0-9]{4})\\z"
|
|
13
13
|
partial_zip_regex: "\\A〒?([0-9|0-9]{0,3})(-|ー?)([0-9|0-9]{0,4})\\z"
|
14
14
|
phone_number_prefix: 81
|
15
15
|
building_number_required: true
|
16
|
+
building_number_may_be_in_address2: true
|
16
17
|
week_start_day: sunday
|
17
18
|
languages:
|
18
19
|
- en
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,8 +5,8 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
@@ -5,15 +5,15 @@ pt-BR:
|
|
5
5
|
addresses:
|
6
6
|
address1:
|
7
7
|
label:
|
8
|
-
default:
|
9
|
-
optional:
|
8
|
+
default: Endereço e número
|
9
|
+
optional: Endereço e número (opcional)
|
10
10
|
errors:
|
11
11
|
blank_instructional: Insira um endereço e o número
|
12
12
|
blank_informative: Faltam o endereço e o número
|
13
13
|
address2:
|
14
14
|
label:
|
15
15
|
default: Apartamento, bloco etc.
|
16
|
-
optional:
|
16
|
+
optional: Casa, apto. etc. (opcional)
|
17
17
|
errors:
|
18
18
|
blank_instructional: Insira apartamento, bloco etc.
|
19
19
|
blank_informative: Falta o apartamento ou o bloco
|
@@ -132,7 +132,7 @@ ja:
|
|
132
132
|
unknown_for_province_instructional: "%{province}の有効な市区町村を入力してください"
|
133
133
|
unknown_for_province_informative: 市区町村が%{province}と一致しません
|
134
134
|
unknown_for_zip_and_province_instructional: "%{province}の%{zip}の有効な市区町村を入力してください"
|
135
|
-
unknown_for_zip_and_province_informative:
|
135
|
+
unknown_for_zip_and_province_informative: 市区町村名/都市名が正しくない可能性があります
|
136
136
|
too_long_instructional: 市区町村が長すぎます (最大255文字)
|
137
137
|
too_long_informative: 市区町村が長すぎます
|
138
138
|
contains_emojis_instructional: 市区町村に絵文字を含めることはできません
|
@@ -147,8 +147,8 @@ ja:
|
|
147
147
|
contains_html_tags_informative: 市区町村にHTMLを含めることはできません
|
148
148
|
contains_url_instructional: 市区町村にURLを含めることはできません
|
149
149
|
contains_url_informative: 市区町村にURLを含めることはできません
|
150
|
-
unknown_for_address_instructional:
|
151
|
-
unknown_for_address_informative:
|
150
|
+
unknown_for_address_instructional: 市区町村名/都市名が正しくない可能性があります
|
151
|
+
unknown_for_address_informative: 市区町村名/都市名が正しくない可能性があります
|
152
152
|
country:
|
153
153
|
label:
|
154
154
|
default: 国/地域
|
@@ -101,16 +101,16 @@ nl:
|
|
101
101
|
contains_html_tags_informative: Adres mag geen HTML bevatten
|
102
102
|
contains_url_instructional: Adfres mag geen URL bevatten
|
103
103
|
contains_url_informative: Adres mag geen URL bevatten
|
104
|
-
missing_building_number_instructional: Voeg een
|
104
|
+
missing_building_number_instructional: Voeg een huisnummer toe als je
|
105
105
|
er een hebt
|
106
|
-
missing_building_number_informative:
|
106
|
+
missing_building_number_informative: Huisnummer ontbreekt mogelijk
|
107
107
|
street_unknown_for_zip_instructional: Vul een geldige straatnaam in voor
|
108
108
|
%{zip}
|
109
109
|
street_unknown_for_zip_informative: Straatnaam komt niet overeen met %{zip}
|
110
|
-
building_number_invalid_instructional: Kan
|
111
|
-
%{zip} niet vinden
|
112
|
-
building_number_invalid_informative: Kan gebouwnummer voor %{street},
|
110
|
+
building_number_invalid_instructional: Kan huisnummer voor %{street},
|
113
111
|
%{zip} niet vinden
|
112
|
+
building_number_invalid_informative: Kan huisnummer voor %{street}, %{zip}
|
113
|
+
niet vinden
|
114
114
|
unknown_for_address_instructional: Adresregel 1 is mogelijk onjuist
|
115
115
|
unknown_for_address_informative: Adresregel 1 is mogelijk onjuist
|
116
116
|
address2:
|
@@ -121,16 +121,16 @@ nl:
|
|
121
121
|
blank_instructional: Voer een appartement- of suitenummer in
|
122
122
|
blank_informative: Appartement- of suitenummer ontbreekt
|
123
123
|
too_long_instructional: Adresregel 2 is te lang (het maximum is 255 tekens)
|
124
|
-
missing_building_number_instructional: Voeg een
|
124
|
+
missing_building_number_instructional: Voeg een huisnummer toe als je
|
125
125
|
er een hebt
|
126
|
-
missing_building_number_informative:
|
126
|
+
missing_building_number_informative: Huisnummer ontbreekt mogelijk
|
127
127
|
street_unknown_for_zip_instructional: Vul een geldige straatnaam in voor
|
128
128
|
%{zip}
|
129
129
|
street_unknown_for_zip_informative: Straatnaam is niet geldig voor %{zip}
|
130
|
-
building_number_invalid_instructional: Kan
|
131
|
-
%{zip} niet vinden
|
132
|
-
building_number_invalid_informative: Kan gebouwnummer voor %{street},
|
130
|
+
building_number_invalid_instructional: Kan huisnummer voor %{street},
|
133
131
|
%{zip} niet vinden
|
132
|
+
building_number_invalid_informative: Kan huisnummer voor %{street}, %{zip}
|
133
|
+
niet vinden
|
134
134
|
too_long_informative: Adresregel 2 is te lang
|
135
135
|
contains_emojis_instructional: Adresregel 2 mag geen emoji's bevatten
|
136
136
|
contains_emojis_informative: Adresregel 2 mag geen emoji's bevatten
|
@@ -327,37 +327,37 @@ nl:
|
|
327
327
|
contains_html_tags_informative: Straat mag geen HTML bevatten
|
328
328
|
street_number:
|
329
329
|
label:
|
330
|
-
default:
|
331
|
-
optional:
|
330
|
+
default: Huisnummer
|
331
|
+
optional: Huisnummer (optioneel)
|
332
332
|
warnings:
|
333
333
|
contains_too_many_words: Geef minder dan %{word_count} woorden op voor
|
334
|
-
|
334
|
+
huisnummer
|
335
335
|
errors:
|
336
|
-
blank_instructional: Vul een
|
337
|
-
blank_informative:
|
338
|
-
too_long_instructional:
|
339
|
-
|
340
|
-
too_long_informative:
|
341
|
-
contains_emojis_instructional:
|
342
|
-
contains_emojis_informative:
|
343
|
-
contains_mathematical_symbols_instructional:
|
336
|
+
blank_instructional: Vul een huisnummer in
|
337
|
+
blank_informative: Huisnummer ontbreekt
|
338
|
+
too_long_instructional: Huisnummer is te lang (mag maximaal %{limit} tekens
|
339
|
+
zijn)
|
340
|
+
too_long_informative: Huisnummer is te lang
|
341
|
+
contains_emojis_instructional: Huisnummer mag geen emoji's bevatten
|
342
|
+
contains_emojis_informative: Huisnummer mag geen emoji's bevatten
|
343
|
+
contains_mathematical_symbols_instructional: Huisnummer mag geen wiskundige
|
344
344
|
symbolen bevatten
|
345
|
-
contains_mathematical_symbols_informative:
|
345
|
+
contains_mathematical_symbols_informative: Huisnummer mag geen wiskundige
|
346
346
|
symbolen bevatten
|
347
|
-
contains_restricted_characters_instructional:
|
348
|
-
|
349
|
-
contains_restricted_characters_informative:
|
347
|
+
contains_restricted_characters_instructional: Huisnummer mag alleen letters,
|
348
|
+
cijfers, lokale tekens en speciale tekens bevatten
|
349
|
+
contains_restricted_characters_informative: Huisnummer mag geen verboden
|
350
350
|
tekens bevatten
|
351
|
-
contains_html_tags_instructional:
|
352
|
-
contains_html_tags_informative:
|
353
|
-
contains_url_instructional:
|
354
|
-
contains_url_informative:
|
355
|
-
building_number_invalid_instructional: Kan
|
356
|
-
%{zip} niet vinden
|
357
|
-
building_number_invalid_informative: Kan gebouwnummer voor %{street},
|
351
|
+
contains_html_tags_instructional: Huisnummer mag geen HTML bevatten
|
352
|
+
contains_html_tags_informative: Huisnummer mag geen HTML bevatten
|
353
|
+
contains_url_instructional: Huisnummer mag geen URL bevatten
|
354
|
+
contains_url_informative: Huisnummer mag geen URL bevatten
|
355
|
+
building_number_invalid_instructional: Kan huisnummer voor %{street},
|
358
356
|
%{zip} niet vinden
|
359
|
-
|
360
|
-
|
357
|
+
building_number_invalid_informative: Kan huisnummer voor %{street}, %{zip}
|
358
|
+
niet vinden
|
359
|
+
unknown_for_address_instructional: Voer een geldig huisnummer in
|
360
|
+
unknown_for_address_informative: Huisnummer is niet geldig
|
361
361
|
neighborhood:
|
362
362
|
label:
|
363
363
|
default: Buurt
|
@@ -424,18 +424,18 @@ nl:
|
|
424
424
|
bevatten
|
425
425
|
contains_url_instructional: De tweede adresregel mag geen URL bevatten
|
426
426
|
contains_url_informative: De tweede adresregel mag geen URL bevatten
|
427
|
-
missing_building_number_instructional: Voeg een
|
428
|
-
er een hebt
|
429
|
-
missing_building_number_informative: Voeg een gebouwnummer toe als je
|
427
|
+
missing_building_number_instructional: Voeg een huisnummer toe als je
|
430
428
|
er een hebt
|
429
|
+
missing_building_number_informative: Voeg een huisnummer toe als je er
|
430
|
+
een hebt
|
431
431
|
street_unknown_for_zip_instructional: Vul een geldige straatnaam in voor
|
432
432
|
%{zip}
|
433
433
|
street_unknown_for_zip_informative: Vul een geldige straatnaam in voor
|
434
434
|
%{zip}
|
435
|
-
building_number_invalid_instructional: Kan
|
436
|
-
%{zip} niet vinden
|
437
|
-
building_number_invalid_informative: Kan gebouwnummer voor %{street},
|
435
|
+
building_number_invalid_instructional: Kan huisnummer voor %{street},
|
438
436
|
%{zip} niet vinden
|
437
|
+
building_number_invalid_informative: Kan huisnummer voor %{street}, %{zip}
|
438
|
+
niet vinden
|
439
439
|
unknown_for_address_instructional: De tweede adresregel is mogelijk onjuist
|
440
440
|
unknown_for_address_informative: De tweede adresregel is mogelijk onjuist
|
441
441
|
warnings:
|
@@ -81,12 +81,12 @@ zh-TW:
|
|
81
81
|
contains_html_tags_informative: 地址不得包含 HTML
|
82
82
|
contains_url_instructional: 地址不得包含網址
|
83
83
|
contains_url_informative: 地址不得包含網址
|
84
|
-
missing_building_number_instructional:
|
85
|
-
missing_building_number_informative:
|
84
|
+
missing_building_number_instructional: 如果您的地址有門牌號碼,請新增門牌號碼
|
85
|
+
missing_building_number_informative: 可能未輸入門牌號碼
|
86
86
|
street_unknown_for_zip_instructional: 請輸入 %{zip} 的有效街道名稱
|
87
87
|
street_unknown_for_zip_informative: 街道名稱與 %{zip} 不相符
|
88
|
-
building_number_invalid_instructional: 在 %{zip} %{street}
|
89
|
-
building_number_invalid_informative: 在 %{zip} %{street}
|
88
|
+
building_number_invalid_instructional: 在 %{zip} %{street} 找不到此門牌號碼
|
89
|
+
building_number_invalid_informative: 在 %{zip} %{street} 找不到此門牌號碼
|
90
90
|
unknown_for_address_instructional: 地址第 1 行可能並不正確
|
91
91
|
unknown_for_address_informative: 地址第 1 行可能並不正確
|
92
92
|
address2:
|
@@ -97,12 +97,12 @@ zh-TW:
|
|
97
97
|
blank_instructional: 輸入公寓、套房等
|
98
98
|
blank_informative: 缺少公寓或套房
|
99
99
|
too_long_instructional: 第二行地址過長 (最多 255 個字元)
|
100
|
-
missing_building_number_instructional:
|
101
|
-
missing_building_number_informative:
|
100
|
+
missing_building_number_instructional: 如果您的地址有門牌號碼,請新增門牌號碼
|
101
|
+
missing_building_number_informative: 可能未輸入門牌號碼
|
102
102
|
street_unknown_for_zip_instructional: 請輸入 %{zip} 的有效街道名稱
|
103
103
|
street_unknown_for_zip_informative: "%{zip} 的街道名稱無效"
|
104
|
-
building_number_invalid_instructional: 在 %{zip} %{street}
|
105
|
-
building_number_invalid_informative: 在 %{zip} %{street}
|
104
|
+
building_number_invalid_instructional: 在 %{zip} %{street} 找不到此門牌號碼
|
105
|
+
building_number_invalid_informative: 在 %{zip} %{street} 找不到此門牌號碼
|
106
106
|
too_long_informative: 第二行地址過長
|
107
107
|
contains_emojis_instructional: 第二行地址不得包含表情符號
|
108
108
|
contains_emojis_informative: 第二行地址不得包含表情符號
|
@@ -262,29 +262,29 @@ zh-TW:
|
|
262
262
|
contains_html_tags_informative: 街道不得包含 HTML
|
263
263
|
street_number:
|
264
264
|
label:
|
265
|
-
default:
|
266
|
-
optional:
|
265
|
+
default: 門牌號碼
|
266
|
+
optional: 門牌號碼 (選填)
|
267
267
|
warnings:
|
268
|
-
contains_too_many_words:
|
268
|
+
contains_too_many_words: 建議「門牌號碼」少於 %{word_count} 個字
|
269
269
|
errors:
|
270
|
-
blank_instructional:
|
271
|
-
blank_informative:
|
272
|
-
too_long_instructional: "
|
273
|
-
too_long_informative:
|
274
|
-
contains_emojis_instructional:
|
275
|
-
contains_emojis_informative:
|
276
|
-
contains_mathematical_symbols_instructional:
|
277
|
-
contains_mathematical_symbols_informative:
|
278
|
-
contains_restricted_characters_instructional:
|
279
|
-
contains_restricted_characters_informative:
|
280
|
-
contains_html_tags_instructional:
|
281
|
-
contains_html_tags_informative:
|
282
|
-
contains_url_instructional:
|
283
|
-
contains_url_informative:
|
284
|
-
building_number_invalid_instructional: 在 %{zip} %{street}
|
285
|
-
building_number_invalid_informative: 在 %{zip} %{street}
|
286
|
-
unknown_for_address_instructional:
|
287
|
-
unknown_for_address_informative:
|
270
|
+
blank_instructional: 請輸入門牌號碼
|
271
|
+
blank_informative: 缺少門牌號碼
|
272
|
+
too_long_instructional: "「門牌號碼」過長 (最多 %{limit} 個字元)"
|
273
|
+
too_long_informative: 門牌號碼過長
|
274
|
+
contains_emojis_instructional: 門牌號碼不得包含表情符號
|
275
|
+
contains_emojis_informative: 門牌號碼不得包含表情符號
|
276
|
+
contains_mathematical_symbols_instructional: 門牌號碼不得包含數學符號
|
277
|
+
contains_mathematical_symbols_informative: 門牌號碼不得包含數學符號
|
278
|
+
contains_restricted_characters_instructional: 門牌號碼僅可包含字母、數字、當地字元和特殊字元
|
279
|
+
contains_restricted_characters_informative: 門牌號碼不得包含限制的字元
|
280
|
+
contains_html_tags_instructional: 門牌號碼不得包含 HTML
|
281
|
+
contains_html_tags_informative: 門牌號碼不得包含 HTML
|
282
|
+
contains_url_instructional: 門牌號碼不得包含網址
|
283
|
+
contains_url_informative: 門牌號碼不得包含網址
|
284
|
+
building_number_invalid_instructional: 在 %{zip} %{street} 找不到此門牌號碼
|
285
|
+
building_number_invalid_informative: 在 %{zip} %{street} 找不到此門牌號碼
|
286
|
+
unknown_for_address_instructional: 請輸入有效的門牌號碼
|
287
|
+
unknown_for_address_informative: 門牌號碼無效
|
288
288
|
neighborhood:
|
289
289
|
label:
|
290
290
|
default: 鄰
|
@@ -335,12 +335,12 @@ zh-TW:
|
|
335
335
|
contains_html_tags_informative: "「地址第二行」不得包含 HTML 標籤"
|
336
336
|
contains_url_instructional: "「地址第二行」不得包含網址"
|
337
337
|
contains_url_informative: "「地址第二行」不得包含網址"
|
338
|
-
missing_building_number_instructional:
|
339
|
-
missing_building_number_informative:
|
338
|
+
missing_building_number_instructional: 如果您的地址有門牌號碼,請新增門牌號碼
|
339
|
+
missing_building_number_informative: 如果您的地址有門牌號碼,請新增門牌號碼
|
340
340
|
street_unknown_for_zip_instructional: 請輸入 %{zip} 的有效街道名稱
|
341
341
|
street_unknown_for_zip_informative: 請輸入 %{zip} 的有效街道名稱
|
342
|
-
building_number_invalid_instructional: 在 %{zip} %{street}
|
343
|
-
building_number_invalid_informative: 在 %{zip} %{street}
|
342
|
+
building_number_invalid_instructional: 在 %{zip} %{street} 找不到此門牌號碼
|
343
|
+
building_number_invalid_informative: 在 %{zip} %{street} 找不到此門牌號碼
|
344
344
|
unknown_for_address_instructional: "「地址第二行」可能並不正確"
|
345
345
|
unknown_for_address_informative: "「地址第二行」可能並不正確"
|
346
346
|
warnings:
|
data/lib/worldwide/units.rb
CHANGED
@@ -1,69 +1,73 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Worldwide
|
4
|
-
SUPPORTED_HUMANIZATIONS = {
|
5
|
-
short: :short,
|
6
|
-
long: :long,
|
7
|
-
}.freeze
|
8
|
-
|
9
|
-
MEASUREMENT_KEYS = {
|
10
|
-
millimeter: :length_millimeter,
|
11
|
-
millimeters: :length_millimeter,
|
12
|
-
centimeter: :length_centimeter,
|
13
|
-
centimeters: :length_centimeter,
|
14
|
-
foot: :length_foot,
|
15
|
-
feet: :length_foot,
|
16
|
-
inch: :length_inch,
|
17
|
-
inches: :length_inch,
|
18
|
-
meter: :length_meter,
|
19
|
-
meters: :length_meter,
|
20
|
-
gram: :mass_gram,
|
21
|
-
grams: :mass_gram,
|
22
|
-
kilogram: :mass_kilogram,
|
23
|
-
kilograms: :mass_kilogram,
|
24
|
-
ounce: :mass_ounce,
|
25
|
-
ounces: :mass_ounce,
|
26
|
-
pound: :mass_pound,
|
27
|
-
pounds: :mass_pound,
|
28
|
-
centiliter: :volume_centiliter,
|
29
|
-
centiliters: :volume_centiliter,
|
30
|
-
cubic_meter: :volume_cubic_meter,
|
31
|
-
cubic_meters: :volume_cubic_meter,
|
32
|
-
imperial_fluid_ounce: :volume_fluid_ounce_imperial,
|
33
|
-
imperial_fluid_ounces: :volume_fluid_ounce_imperial,
|
34
|
-
fluid_ounce: :volume_fluid_ounce,
|
35
|
-
fluid_ounces: :volume_fluid_ounce,
|
36
|
-
imperial_gallon: :volume_gallon_imperial,
|
37
|
-
imperial_gallons: :volume_gallon_imperial,
|
38
|
-
gallon: :volume_gallon,
|
39
|
-
gallons: :volume_gallon,
|
40
|
-
liter: :volume_liter,
|
41
|
-
liters: :volume_liter,
|
42
|
-
milliliter: :volume_milliliter,
|
43
|
-
milliliters: :volume_milliliter,
|
44
|
-
pint: :volume_pint,
|
45
|
-
pints: :volume_pint,
|
46
|
-
imperial_pint: :volume_pint_imperial,
|
47
|
-
imperial_pints: :volume_pint_imperial,
|
48
|
-
quart: :volume_quart,
|
49
|
-
quarts: :volume_quart,
|
50
|
-
imperial_quart: :volume_quart_imperial,
|
51
|
-
imperial_quarts: :volume_quart_imperial,
|
52
|
-
yard: :length_yard,
|
53
|
-
yards: :length_yard,
|
54
|
-
}.freeze
|
55
|
-
|
56
4
|
class Units
|
57
5
|
class << self
|
58
6
|
def format(amount, unit, humanize: :short)
|
59
|
-
supported_humanization =
|
7
|
+
supported_humanization = supported_humanizations[humanize.to_sym]
|
60
8
|
raise ArgumentError, "Unsupported value for `humanize`: #{humanize}." unless supported_humanization
|
61
9
|
|
62
|
-
measurement_key =
|
10
|
+
measurement_key = measurement_keys[unit.to_sym]
|
63
11
|
raise ArgumentError, "Unsupported value for `unit`: #{unit}." unless measurement_key
|
64
12
|
|
65
13
|
Cldr.t("units.unit_length.#{supported_humanization}.#{measurement_key}", count: amount)
|
66
14
|
end
|
15
|
+
|
16
|
+
def supported_humanizations
|
17
|
+
{
|
18
|
+
short: :short,
|
19
|
+
long: :long,
|
20
|
+
}.freeze
|
21
|
+
end
|
22
|
+
|
23
|
+
def measurement_keys
|
24
|
+
{
|
25
|
+
millimeter: :length_millimeter,
|
26
|
+
millimeters: :length_millimeter,
|
27
|
+
centimeter: :length_centimeter,
|
28
|
+
centimeters: :length_centimeter,
|
29
|
+
foot: :length_foot,
|
30
|
+
feet: :length_foot,
|
31
|
+
inch: :length_inch,
|
32
|
+
inches: :length_inch,
|
33
|
+
meter: :length_meter,
|
34
|
+
meters: :length_meter,
|
35
|
+
gram: :mass_gram,
|
36
|
+
grams: :mass_gram,
|
37
|
+
kilogram: :mass_kilogram,
|
38
|
+
kilograms: :mass_kilogram,
|
39
|
+
ounce: :mass_ounce,
|
40
|
+
ounces: :mass_ounce,
|
41
|
+
pound: :mass_pound,
|
42
|
+
pounds: :mass_pound,
|
43
|
+
centiliter: :volume_centiliter,
|
44
|
+
centiliters: :volume_centiliter,
|
45
|
+
cubic_meter: :volume_cubic_meter,
|
46
|
+
cubic_meters: :volume_cubic_meter,
|
47
|
+
imperial_fluid_ounce: :volume_fluid_ounce_imperial,
|
48
|
+
imperial_fluid_ounces: :volume_fluid_ounce_imperial,
|
49
|
+
fluid_ounce: :volume_fluid_ounce,
|
50
|
+
fluid_ounces: :volume_fluid_ounce,
|
51
|
+
imperial_gallon: :volume_gallon_imperial,
|
52
|
+
imperial_gallons: :volume_gallon_imperial,
|
53
|
+
gallon: :volume_gallon,
|
54
|
+
gallons: :volume_gallon,
|
55
|
+
liter: :volume_liter,
|
56
|
+
liters: :volume_liter,
|
57
|
+
milliliter: :volume_milliliter,
|
58
|
+
milliliters: :volume_milliliter,
|
59
|
+
pint: :volume_pint,
|
60
|
+
pints: :volume_pint,
|
61
|
+
imperial_pint: :volume_pint_imperial,
|
62
|
+
imperial_pints: :volume_pint_imperial,
|
63
|
+
quart: :volume_quart,
|
64
|
+
quarts: :volume_quart,
|
65
|
+
imperial_quart: :volume_quart_imperial,
|
66
|
+
imperial_quarts: :volume_quart_imperial,
|
67
|
+
yard: :length_yard,
|
68
|
+
yards: :length_yard,
|
69
|
+
}.freeze
|
70
|
+
end
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
data/lib/worldwide/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: worldwide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -8490,7 +8490,7 @@ licenses: []
|
|
8490
8490
|
metadata:
|
8491
8491
|
allowed_push_host: https://rubygems.org/
|
8492
8492
|
changelog_uri: https://github.com/Shopify/worldwide/blob/main/CHANGELOG.md
|
8493
|
-
post_install_message:
|
8493
|
+
post_install_message:
|
8494
8494
|
rdoc_options: []
|
8495
8495
|
require_paths:
|
8496
8496
|
- lib
|
@@ -8505,8 +8505,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
8505
8505
|
- !ruby/object:Gem::Version
|
8506
8506
|
version: '0'
|
8507
8507
|
requirements: []
|
8508
|
-
rubygems_version: 3.5.
|
8509
|
-
signing_key:
|
8508
|
+
rubygems_version: 3.5.14
|
8509
|
+
signing_key:
|
8510
8510
|
specification_version: 4
|
8511
8511
|
summary: Internationalization and localization APIs
|
8512
8512
|
test_files: []
|