worldwide 0.3.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/Gemfile.lock +1 -1
- data/data/other/timezones/bg-BG.yml +1 -0
- data/data/other/timezones/cs.yml +1 -0
- data/data/other/timezones/da.yml +1 -0
- data/data/other/timezones/de.yml +1 -0
- data/data/other/timezones/el.yml +1 -0
- data/data/other/timezones/en.yml +1 -0
- data/data/other/timezones/es.yml +1 -0
- data/data/other/timezones/fi.yml +1 -0
- data/data/other/timezones/fr.yml +1 -0
- data/data/other/timezones/hi.yml +1 -0
- data/data/other/timezones/hr-HR.yml +1 -0
- data/data/other/timezones/hu.yml +1 -0
- data/data/other/timezones/id.yml +1 -0
- data/data/other/timezones/it.yml +1 -0
- data/data/other/timezones/ja.yml +1 -0
- data/data/other/timezones/ko.yml +1 -0
- data/data/other/timezones/lt-LT.yml +1 -0
- data/data/other/timezones/nb.yml +1 -0
- data/data/other/timezones/nl.yml +1 -0
- data/data/other/timezones/pl.yml +1 -0
- data/data/other/timezones/pt-BR.yml +1 -0
- data/data/other/timezones/pt-PT.yml +1 -0
- data/data/other/timezones/ro-RO.yml +1 -0
- data/data/other/timezones/ru.yml +1 -0
- data/data/other/timezones/sk-SK.yml +1 -0
- data/data/other/timezones/sl-SI.yml +1 -0
- data/data/other/timezones/sv.yml +1 -0
- data/data/other/timezones/th.yml +1 -0
- data/data/other/timezones/tr.yml +1 -0
- data/data/other/timezones/vi.yml +1 -0
- data/data/other/timezones/zh-CN.yml +1 -0
- data/data/other/timezones/zh-TW.yml +1 -0
- data/db/data/regions/AT.yml +1 -0
- data/db/data/regions/AW.yml +2 -0
- data/db/data/regions/AX.yml +3 -0
- data/db/data/regions/BL.yml +2 -0
- data/db/data/regions/BQ.yml +2 -0
- data/db/data/regions/CW.yml +2 -0
- data/db/data/regions/GF.yml +3 -0
- data/db/data/regions/GP.yml +4 -0
- data/db/data/regions/HK.yml +3 -0
- data/db/data/regions/IT.yml +4 -0
- data/db/data/regions/MF.yml +2 -0
- data/db/data/regions/MO.yml +3 -0
- data/db/data/regions/MQ.yml +3 -0
- data/db/data/regions/NC.yml +2 -0
- data/db/data/regions/PF.yml +2 -0
- data/db/data/regions/PM.yml +2 -0
- data/db/data/regions/RE.yml +4 -0
- data/db/data/regions/SJ.yml +2 -0
- data/db/data/regions/SX.yml +2 -0
- data/db/data/regions/TF.yml +2 -0
- data/db/data/regions/TW.yml +3 -0
- data/db/data/regions/UM.yml +2 -0
- data/db/data/regions/US.yml +12 -0
- data/db/data/regions/WF.yml +2 -0
- data/db/data/regions/YT.yml +4 -0
- data/lib/worldwide/region.rb +5 -1
- data/lib/worldwide/regions.rb +3 -11
- data/lib/worldwide/regions_loader.rb +35 -1
- data/lib/worldwide/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a9594ba5a0791de7841a1b420eb2035d7e426c407815a7b308cf19946a0c36e
|
4
|
+
data.tar.gz: 4b91f4790718a7f1c5023c08d39fe6dbea86c4b00a4a6406fef6eb94327c10f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7df4373be3cf1f576c9ea97d2a1c6db1a9e0742d9e5c1ae955059efde1618f09566303e4e038c56ef653a308e67c38f3d3e94b7b60f46b5441f471f07fb59c5
|
7
|
+
data.tar.gz: fc7f50b224674162e79e7178fd8f84e36dc99582ef0ebab5b9fc1c848d9b32f06ca20a1f12a7c9a909d6382cea3e970ab16227d3e34256944200d21498d9ff74
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
2
3
|
All notable changes to this project will be documented in this file.
|
3
4
|
|
4
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
5
6
|
|
6
7
|
## How do I make a good changelog?
|
8
|
+
|
7
9
|
### Guiding Principles
|
10
|
+
|
8
11
|
- Changelogs are for humans, not machines.
|
9
12
|
- There should be an entry for every single version.
|
10
13
|
- The same types of changes should be grouped.
|
@@ -28,7 +31,20 @@ Nil.
|
|
28
31
|
|
29
32
|
---
|
30
33
|
|
34
|
+
[0.4.1] - 2023-11-10
|
35
|
+
- Add support for deprecated timezone Australia/Canberra [#35](https://github.com/Shopify/worldwide/pull/35)
|
36
|
+
- Add alternate codes for territories [#39](https://github.com/Shopify/worldwide/pull/39)
|
37
|
+
- Allow building numbers on address2 field for Austrian addresses [#40](https://github.com/Shopify/worldwide/pull/40)
|
38
|
+
- Add zone name alternates for Italy [#42](https://github.com/Shopify/worldwide/pull/35)
|
39
|
+
|
40
|
+
[0.4.0] - 2023-11-08
|
41
|
+
|
42
|
+
- Add region name alternates [#32](https://github.com/Shopify/worldwide/pull/32)
|
43
|
+
- Cache `Region#parent_name` [#33](https://github.com/Shopify/worldwide/pull/33)
|
44
|
+
- Use hash tables to look up regions by code [#36](https://github.com/Shopify/worldwide/pull/36)
|
45
|
+
|
31
46
|
[0.3.0] - 2023-11-03
|
47
|
+
|
32
48
|
- Add code alternates for Japan [#23](https://github.com/Shopify/worldwide/pull/23)
|
33
49
|
- Add code alternates for Puerto Rico [#24](https://github.com/Shopify/worldwide/pull/24)
|
34
50
|
- Record multiple parents per region [#27](https://github.com/Shopify/worldwide/pull/27)
|
@@ -37,7 +53,6 @@ Nil.
|
|
37
53
|
[#29](https://github.com/Shopify/worldwide/pull/29)
|
38
54
|
- Handle ISO_CODE only zones lookup [#26](https://github.com/Shopify/worldwide/pull/26)
|
39
55
|
|
40
|
-
|
41
56
|
[0.2.0] - 2023-11-01
|
42
57
|
|
43
58
|
- Add Region#group and Region#group_name [#15](https://github.com/Shopify/worldwide/pull/15)
|
data/Gemfile.lock
CHANGED
@@ -121,6 +121,7 @@ bg-BG:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Гуам"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Хобарт"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Канбера, Мелбърн"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Канбера, Мелбърн"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Порт Морсби"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Сидни"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Владивосток"
|
data/data/other/timezones/cs.yml
CHANGED
@@ -121,6 +121,7 @@ cs:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/da.yml
CHANGED
@@ -121,6 +121,7 @@ da:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/de.yml
CHANGED
@@ -121,6 +121,7 @@ de:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Wladiwostok"
|
data/data/other/timezones/el.yml
CHANGED
@@ -121,6 +121,7 @@ el:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Γκουάμ"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Χόμπαρτ"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Καμπέρα, Μελβούρνη"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Καμπέρα, Μελβούρνη"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Πορτ Μόρεσμπι"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Σίδνεϊ"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Βλαδιβοστόκ"
|
data/data/other/timezones/en.yml
CHANGED
@@ -121,6 +121,7 @@ en:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/es.yml
CHANGED
@@ -121,6 +121,7 @@ es:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Puerto Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sídney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/fi.yml
CHANGED
@@ -121,6 +121,7 @@ fi:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/fr.yml
CHANGED
@@ -121,6 +121,7 @@ fr:
|
|
121
121
|
Pacific/Guam: "(GMT + 10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT + 10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT + 10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT + 10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT + 10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT + 10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT + 10:00) Vladivostok"
|
data/data/other/timezones/hi.yml
CHANGED
@@ -121,6 +121,7 @@ hi:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) गुआम"
|
122
122
|
Australia/Hobart: "(GMT+10:00) होबार्ट"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) कैनबरा, मेलबर्न"
|
124
|
+
Australia/Canberra: "(GMT+10:00) कैनबरा, मेलबर्न"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) पोर्ट मोरेस्बी"
|
125
126
|
Australia/Sydney: "(GMT+10:00) सिडनी"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) व्लादिवोस्तोक"
|
@@ -121,6 +121,7 @@ hr-HR:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/hu.yml
CHANGED
@@ -121,6 +121,7 @@ hu:
|
|
121
121
|
Pacific/Guam: "(GMT + 10: 00) Guam"
|
122
122
|
Australia/Hobart: "(GMT + 10: 00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT + 10: 00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT + 10: 00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT + 10: 00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT + 10: 00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT + 10: 00) Vlagyivosztok"
|
data/data/other/timezones/id.yml
CHANGED
@@ -121,6 +121,7 @@ id:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/it.yml
CHANGED
@@ -121,6 +121,7 @@ it:
|
|
121
121
|
Pacific/Guam: "(UTC+10:00) Guam"
|
122
122
|
Australia/Hobart: "(UTC+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(UTC+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(UTC+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(UTC+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(UTC+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(UTC+10:00) Vladivostok"
|
data/data/other/timezones/ja.yml
CHANGED
@@ -121,6 +121,7 @@ ja:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) グアム"
|
122
122
|
Australia/Hobart: "(GMT+10:00) ホバート"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) キャンベラ、メルボルン"
|
124
|
+
Australia/Canberra: "(GMT+10:00) キャンベラ、メルボルン"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) ポートモレスビー"
|
125
126
|
Australia/Sydney: "(GMT+10:00) シドニー"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) ウラジオストク"
|
data/data/other/timezones/ko.yml
CHANGED
@@ -121,6 +121,7 @@ ko:
|
|
121
121
|
Pacific/Guam: "(GMT + 10 : 00) 괌"
|
122
122
|
Australia/Hobart: "(GMT + 10 : 00) 호바트"
|
123
123
|
Australia/Melbourne: "(GMT + 10 : 00) 캔버라, 멜버른"
|
124
|
+
Australia/Canberra: "(GMT + 10 : 00) 캔버라, 멜버른"
|
124
125
|
Pacific/Port_Moresby: "(GMT + 10 : 00) 포트모르즈비"
|
125
126
|
Australia/Sydney: "(GMT + 10 : 00) 시드니"
|
126
127
|
Asia/Vladivostok: "(GMT + 10 : 00) 블라디보스토크"
|
@@ -121,6 +121,7 @@ lt-LT:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guamas"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobartas"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Kanbera, Melburnas"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Kanbera, Melburnas"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Morsbis"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sidnėjus"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostokas"
|
data/data/other/timezones/nb.yml
CHANGED
@@ -121,6 +121,7 @@ nb:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/nl.yml
CHANGED
@@ -121,6 +121,7 @@ nl:
|
|
121
121
|
Pacific/Guam: "(GMT + 10: 00) Guam"
|
122
122
|
Australia/Hobart: "(GMT + 10: 00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/pl.yml
CHANGED
@@ -121,6 +121,7 @@ pl:
|
|
121
121
|
Pacific/Guam: "(GMT + 10: 00) Guam"
|
122
122
|
Australia/Hobart: "(GMT + 10: 00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT + 10: 00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT + 10: 00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT + 10: 00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT + 10: 00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT + 10: 00) Władywostok"
|
@@ -121,6 +121,7 @@ pt-BR:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Camberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Camberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
@@ -121,6 +121,7 @@ pt-PT:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Camberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
@@ -121,6 +121,7 @@ ro-RO:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/ru.yml
CHANGED
@@ -121,6 +121,7 @@ ru:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Гуам"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Хобарт"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Канберра, Мельбурн"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Канберра, Мельбурн"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Порт-Морсби"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Сидней"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Владивосток"
|
@@ -121,6 +121,7 @@ sk-SK:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
@@ -121,6 +121,7 @@ sl-SI:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/sv.yml
CHANGED
@@ -121,6 +121,7 @@ sv:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/th.yml
CHANGED
@@ -121,6 +121,7 @@ th:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) กวม"
|
122
122
|
Australia/Hobart: "(GMT+10:00) โฮบาร์ต"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) แคนเบอร์รา, เมลเบิร์น"
|
124
|
+
Australia/Canberra: "(GMT+10:00) แคนเบอร์รา, เมลเบิร์น"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) พอร์ตมอร์สบี"
|
125
126
|
Australia/Sydney: "(GMT+10:00) ซิดนีย์"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) วลาดีวอสตอค"
|
data/data/other/timezones/tr.yml
CHANGED
@@ -121,6 +121,7 @@ tr:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sidney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
data/data/other/timezones/vi.yml
CHANGED
@@ -121,6 +121,7 @@ vi:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) Guam"
|
122
122
|
Australia/Hobart: "(GMT+10:00) Hobart"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) Canberra, Melbourne"
|
124
|
+
Australia/Canberra: "(GMT+10:00) Canberra, Melbourne"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) Port Moresby"
|
125
126
|
Australia/Sydney: "(GMT+10:00) Sydney"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) Vladivostok"
|
@@ -121,6 +121,7 @@ zh-CN:
|
|
121
121
|
Pacific/Guam: "(GMT+10:00) 关岛"
|
122
122
|
Australia/Hobart: "(GMT+10:00) 霍巴特"
|
123
123
|
Australia/Melbourne: "(GMT+10:00) 堪培拉、墨尔本"
|
124
|
+
Australia/Canberra: "(GMT+10:00) 堪培拉、墨尔本"
|
124
125
|
Pacific/Port_Moresby: "(GMT+10:00) 莫尔兹比港"
|
125
126
|
Australia/Sydney: "(GMT+10:00) 悉尼"
|
126
127
|
Asia/Vladivostok: "(GMT+10:00) 符拉迪沃斯托克"
|
@@ -121,6 +121,7 @@ zh-TW:
|
|
121
121
|
Pacific/Guam: "(格林威治標準時間加 10 個小時)關島"
|
122
122
|
Australia/Hobart: "(格林威治標準時間加 10 個小時)霍巴特"
|
123
123
|
Australia/Melbourne: "(格林威治標準時間加 10 個小時)坎培拉,墨爾本"
|
124
|
+
Australia/Canberra: "(格林威治標準時間加 10 個小時)坎培拉,墨爾本"
|
124
125
|
Pacific/Port_Moresby: "(格林威治標準時間加 10 個小時)莫爾斯貝港"
|
125
126
|
Australia/Sydney: "(格林威治標準時間加 10 個小時)雪梨"
|
126
127
|
Asia/Vladivostok: "(格林威治標準時間加 10 個小時)海參崴"
|
data/db/data/regions/AT.yml
CHANGED
data/db/data/regions/AW.yml
CHANGED
data/db/data/regions/AX.yml
CHANGED
data/db/data/regions/BL.yml
CHANGED
data/db/data/regions/BQ.yml
CHANGED
data/db/data/regions/CW.yml
CHANGED
data/db/data/regions/GF.yml
CHANGED
data/db/data/regions/GP.yml
CHANGED
data/db/data/regions/HK.yml
CHANGED
data/db/data/regions/IT.yml
CHANGED
@@ -788,6 +788,8 @@ zones:
|
|
788
788
|
zip_prefixes:
|
789
789
|
- '41'
|
790
790
|
- name: Monza e Brianza
|
791
|
+
name_alternates:
|
792
|
+
- Monza e della Brianza
|
791
793
|
code: MB
|
792
794
|
tax: 0.0
|
793
795
|
tax_name: VAT
|
@@ -1083,6 +1085,8 @@ zones:
|
|
1083
1085
|
- '890'
|
1084
1086
|
- '891'
|
1085
1087
|
- name: Reggio Emilia
|
1088
|
+
name_alternates:
|
1089
|
+
- Reggion nell'Emilia
|
1086
1090
|
code: RE
|
1087
1091
|
tax: 0.0
|
1088
1092
|
tax_name: VAT
|
data/db/data/regions/MF.yml
CHANGED
data/db/data/regions/MO.yml
CHANGED
data/db/data/regions/MQ.yml
CHANGED
data/db/data/regions/NC.yml
CHANGED
data/db/data/regions/PF.yml
CHANGED
data/db/data/regions/PM.yml
CHANGED
data/db/data/regions/RE.yml
CHANGED
data/db/data/regions/SJ.yml
CHANGED
data/db/data/regions/SX.yml
CHANGED
data/db/data/regions/TF.yml
CHANGED
data/db/data/regions/TW.yml
CHANGED
data/db/data/regions/UM.yml
CHANGED
data/db/data/regions/US.yml
CHANGED
@@ -7,6 +7,8 @@ unit_system: imperial
|
|
7
7
|
tax_name: Federal Tax
|
8
8
|
group: North American Countries
|
9
9
|
group_name: North America
|
10
|
+
name_alternates:
|
11
|
+
- United States of America
|
10
12
|
zip_label: Zip code
|
11
13
|
zip_regex: "(?-mix:\\A\\d{5}(-\\d{4})?\\z)|(?i-mx:\\AFPO\\s*A[A-Z]\\s*\\d{5}-\\d{4}\\z)"
|
12
14
|
zip_example: '90210'
|
@@ -73,6 +75,8 @@ zones:
|
|
73
75
|
example_city_zip: '96799'
|
74
76
|
tax_name: State Tax
|
75
77
|
code: AS
|
78
|
+
code_alternates:
|
79
|
+
- US-AS
|
76
80
|
iso_code: AS
|
77
81
|
zip_prefixes:
|
78
82
|
- '96799'
|
@@ -393,6 +397,8 @@ zones:
|
|
393
397
|
example_city_zip: '96929'
|
394
398
|
tax_name: State Tax
|
395
399
|
code: GU
|
400
|
+
code_alternates:
|
401
|
+
- US-GU
|
396
402
|
iso_code: GU
|
397
403
|
zip_prefixes:
|
398
404
|
- '9691'
|
@@ -1165,6 +1171,8 @@ zones:
|
|
1165
1171
|
example_city_zip: '96950'
|
1166
1172
|
tax_name: State Tax
|
1167
1173
|
code: MP
|
1174
|
+
code_alternates:
|
1175
|
+
- US-MP
|
1168
1176
|
iso_code: MP
|
1169
1177
|
zip_prefixes:
|
1170
1178
|
# Valid postal codes in MP are 96950, 96951, 96952
|
@@ -1357,6 +1365,8 @@ zones:
|
|
1357
1365
|
example_city_zip: '00717'
|
1358
1366
|
tax_name: State Tax
|
1359
1367
|
code: PR
|
1368
|
+
code_alternates:
|
1369
|
+
- US-PR
|
1360
1370
|
iso_code: PR
|
1361
1371
|
zip_prefixes:
|
1362
1372
|
- '006'
|
@@ -1722,6 +1732,8 @@ zones:
|
|
1722
1732
|
example_city_zip: '00802'
|
1723
1733
|
tax_name: State Tax
|
1724
1734
|
code: VI
|
1735
|
+
code_alternates:
|
1736
|
+
- US-VI
|
1725
1737
|
iso_code: VI
|
1726
1738
|
zip_prefixes:
|
1727
1739
|
- '008'
|
data/db/data/regions/WF.yml
CHANGED
data/db/data/regions/YT.yml
CHANGED
data/lib/worldwide/region.rb
CHANGED
@@ -110,6 +110,10 @@ module Worldwide
|
|
110
110
|
# This name is the name that was traditionally returned by "country_db".
|
111
111
|
attr_reader :legacy_name
|
112
112
|
|
113
|
+
# Other names that may be used to refer to this region.
|
114
|
+
# E.g., "Czech Republic" is also known as "Czechia".
|
115
|
+
attr_accessor :name_alternates
|
116
|
+
|
113
117
|
# iso_code values of regions (subdivisions) within the same country that border this region.
|
114
118
|
# E.g., for CA-ON, the neighbouring zones are CA-MB, CA-NU and CA-QC.
|
115
119
|
attr_accessor :neighbours
|
@@ -438,7 +442,7 @@ module Worldwide
|
|
438
442
|
end
|
439
443
|
|
440
444
|
def parent_country
|
441
|
-
parents.find(&:country?)
|
445
|
+
@parent_country ||= parents.find(&:country?)
|
442
446
|
end
|
443
447
|
|
444
448
|
# Checks whether the given value is acceptable according to the regular expression defined for the country.
|
data/lib/worldwide/regions.rb
CHANGED
@@ -16,7 +16,7 @@ module Worldwide
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def initialize
|
19
|
-
@regions = RegionsLoader.new.load_regions
|
19
|
+
@regions, @regions_by_cldr_code, @regions_by_iso_code = RegionsLoader.new.load_regions
|
20
20
|
end
|
21
21
|
|
22
22
|
def all
|
@@ -29,17 +29,9 @@ module Worldwide
|
|
29
29
|
end
|
30
30
|
|
31
31
|
result = if cldr
|
32
|
-
|
33
|
-
|
34
|
-
@regions.find do |r|
|
35
|
-
r.send(:answers_to_cldr_code, search_code)
|
36
|
-
end
|
32
|
+
@regions_by_cldr_code[cldr.to_s.upcase]
|
37
33
|
elsif code
|
38
|
-
|
39
|
-
|
40
|
-
@regions.find do |r|
|
41
|
-
r.send(:answers_to_iso_code, search_code) || r.alpha_three == search_code || r.numeric_three == search_code
|
42
|
-
end
|
34
|
+
@regions_by_iso_code[code.to_s.upcase]
|
43
35
|
else # search by name
|
44
36
|
search_name = name.upcase
|
45
37
|
|
@@ -9,6 +9,9 @@ module Worldwide
|
|
9
9
|
WORLD_CODE = "001" # UN code for the whole world
|
10
10
|
|
11
11
|
def load_regions
|
12
|
+
@regions_by_cldr_code = {}
|
13
|
+
@regions_by_iso_code = {}
|
14
|
+
|
12
15
|
# Load country/region definitions out of the db/data/regions/??.yml files
|
13
16
|
@regions = Dir["#{Worldwide::Paths::REGIONS_ROOT}/*.yml"].map do |filename|
|
14
17
|
load_territory(filename)
|
@@ -25,11 +28,39 @@ module Worldwide
|
|
25
28
|
|
26
29
|
construct_unknown
|
27
30
|
|
28
|
-
@regions.
|
31
|
+
@regions.each do |region|
|
32
|
+
construct_lookup_info(region)
|
33
|
+
end
|
34
|
+
|
35
|
+
[@regions.freeze, @regions_by_cldr_code, @regions_by_iso_code]
|
29
36
|
end
|
30
37
|
|
31
38
|
private
|
32
39
|
|
40
|
+
def construct_lookup_info(region)
|
41
|
+
pc = region.send(:parent_country)
|
42
|
+
|
43
|
+
# Remember CLDR code(s) for later use during lookup
|
44
|
+
|
45
|
+
search_code = region.cldr_code.to_s.upcase
|
46
|
+
@regions_by_cldr_code[search_code] = region if Util.present?(search_code)
|
47
|
+
|
48
|
+
@regions_by_cldr_code["#{pc.cldr_code.upcase}#{search_code}"] = region if Util.present?(pc&.cldr_code)
|
49
|
+
|
50
|
+
# Remember ISO 3166 code(s) for later use during lookup
|
51
|
+
|
52
|
+
iso_code = region.iso_code
|
53
|
+
@regions_by_iso_code[iso_code] = region if Util.present?(iso_code)
|
54
|
+
|
55
|
+
@regions_by_iso_code["#{pc.iso_code}-#{iso_code}"] = region if Util.present?(pc)
|
56
|
+
|
57
|
+
alpha_three = region.alpha_three
|
58
|
+
@regions_by_iso_code[alpha_three] = region if Util.present?(alpha_three)
|
59
|
+
|
60
|
+
numeric_three = region.numeric_three
|
61
|
+
@regions_by_iso_code[numeric_three] = region if Util.present?(numeric_three)
|
62
|
+
end
|
63
|
+
|
33
64
|
def apply_hierarchy(parent:, code:, children:)
|
34
65
|
current_region = find_region(code: code)
|
35
66
|
if current_region.nil?
|
@@ -61,6 +92,7 @@ module Worldwide
|
|
61
92
|
region.building_number_required = spec["building_number_required"] || true
|
62
93
|
region.building_number_may_be_in_address2 = spec["building_number_may_be_in_address2"] || false
|
63
94
|
currency_code = spec["currency"]
|
95
|
+
region.code_alternates = spec["code_alternates"] || []
|
64
96
|
region.currency = Worldwide.currency(code: currency_code) unless currency_code.nil?
|
65
97
|
region.flag = spec["emoji"]
|
66
98
|
region.format = spec["format"]
|
@@ -82,10 +114,12 @@ module Worldwide
|
|
82
114
|
region.zip_requirement = spec["zip_requirement"]
|
83
115
|
region.zip_regex = spec["zip_regex"]
|
84
116
|
region.zips_crossing_provinces = spec["zips_crossing_provinces"]
|
117
|
+
region.name_alternates = spec["name_alternates"] || []
|
85
118
|
end
|
86
119
|
|
87
120
|
def apply_zone_attributes(region, zone)
|
88
121
|
region.code_alternates = zone["code_alternates"] || []
|
122
|
+
region.name_alternates = zone["name_alternates"] || []
|
89
123
|
region.example_city = zone["example_city"]
|
90
124
|
region.neighbours = zone["neighboring_zones"]
|
91
125
|
region.zip_prefixes = zone["zip_prefixes"] || []
|
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: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|