worldwide 0.6.8 → 0.7.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 +13 -1
- data/Gemfile.lock +2 -2
- data/data/cldr/locales/en/territories.yml +2 -0
- data/data/cldr/locales/fi/territories.yml +1 -1
- data/data/cldr/locales/fr/territories.yml +2 -0
- data/data/cldr/locales/it/territories.yml +1 -1
- data/data/cldr/locales/zh-Hant/territories.yml +2 -2
- data/data/cldr/locales/zh-TW/territories.yml +2 -2
- data/db/data/world.yml +1 -1
- data/lib/worldwide/field.rb +7 -3
- 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: 98738f7c982e2610e9f8a024fec119e4b79f06d8b7979977207c3a25888b88a6
|
4
|
+
data.tar.gz: 725fa21a0aa838c0b291705a4d3ffe0ee64fb910b020ed609ce2d2093428b045
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d544240d6147343c759ec204852e769241298fc743d6382180d319bc1db4e1867112fb8b128f6992d52c5da811b6fbf21ddeb3f48bbf5949c87f79518e12edb7
|
7
|
+
data.tar.gz: f58d1ca4ad9f1a5d9ca5860fe3b2388e57dc741526d28256f2d642605a5e6bb4acb5a713ff2f634262520e96b5d0e6d79b59c77cc0e64772bb89e55b6c176de9
|
data/CHANGELOG.md
CHANGED
@@ -27,10 +27,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
27
27
|
|
28
28
|
## [Unreleased]
|
29
29
|
|
30
|
-
|
30
|
+
Nil.
|
31
31
|
|
32
32
|
---
|
33
33
|
|
34
|
+
[0.7.1] - 2024-02-01
|
35
|
+
|
36
|
+
- Patch in a name for CQ (Sark). [#84](https://github.com/Shopify/worldwide/pull/84)
|
37
|
+
- Patch data related to region 830 (Channel Islands). [#85](https://github.com/Shopify/worldwide/pull/85)
|
38
|
+
- Patch name of SZ (eSwatini) in Italian. [#86](https://github.com/Shopify/worldwide/pull/86)
|
39
|
+
- Patch names of HK and MO in zh-TW and zh-Hant. [#87](https://github.com/Shopify/worldwide/pull/87)
|
40
|
+
- Patch name of GB (United Kingdom) in Suomi. [#88](https://github.com/Shopify/worldwide/pull/88)
|
41
|
+
|
42
|
+
[0.7.0] - 2024-01-31
|
43
|
+
|
44
|
+
- Support address field lookup when there is no country code. [#82](https://github.com/Shopify/worldwide/pull/82)
|
45
|
+
|
34
46
|
[0.6.8] - 2024-01-31
|
35
47
|
|
36
48
|
- Prefer "SAR" over "SAR China" in Chinese-language names for regions `HK` and `MO`. [#79](https://github.com/Shopify/worldwide/pull/79).
|
data/Gemfile.lock
CHANGED
@@ -32,6 +32,7 @@ en:
|
|
32
32
|
'155': Western Europe
|
33
33
|
'202': Sub-Saharan Africa
|
34
34
|
'419': Latin America
|
35
|
+
'830': Channel Islands
|
35
36
|
AC: Ascension Island
|
36
37
|
AD: Andorra
|
37
38
|
AE: United Arab Emirates
|
@@ -83,6 +84,7 @@ en:
|
|
83
84
|
CN: China
|
84
85
|
CO: Colombia
|
85
86
|
CP: Clipperton Island
|
87
|
+
CQ: Sark
|
86
88
|
CR: Costa Rica
|
87
89
|
CU: Cuba
|
88
90
|
CV: Cape Verde
|
@@ -32,6 +32,7 @@ fr:
|
|
32
32
|
'155': Europe de l’Ouest
|
33
33
|
'202': Afrique subsaharienne
|
34
34
|
'419': Amérique latine
|
35
|
+
'830': Îles Anglo-Normandes
|
35
36
|
AC: Île de l’Ascension
|
36
37
|
AD: Andorre
|
37
38
|
AE: Émirats arabes unis
|
@@ -83,6 +84,7 @@ fr:
|
|
83
84
|
CN: Chine
|
84
85
|
CO: Colombie
|
85
86
|
CP: Île Clipperton
|
87
|
+
CQ: Sercq
|
86
88
|
CR: Costa Rica
|
87
89
|
CU: Cuba
|
88
90
|
CV: Cap-Vert
|
@@ -132,7 +132,7 @@ zh-Hant:
|
|
132
132
|
GU: 關島
|
133
133
|
GW: 幾內亞比索
|
134
134
|
GY: 蓋亞那
|
135
|
-
HK:
|
135
|
+
HK: 香港特別行政區
|
136
136
|
HM: 赫德島及麥唐納群島
|
137
137
|
HN: 宏都拉斯
|
138
138
|
HR: 克羅埃西亞
|
@@ -186,7 +186,7 @@ zh-Hant:
|
|
186
186
|
ML: 馬利
|
187
187
|
MM: 緬甸
|
188
188
|
MN: 蒙古
|
189
|
-
MO:
|
189
|
+
MO: 澳門特別行政區
|
190
190
|
MP: 北馬利安納群島
|
191
191
|
MQ: 馬丁尼克
|
192
192
|
MR: 茅利塔尼亞
|
@@ -132,7 +132,7 @@ zh-TW:
|
|
132
132
|
GU: 關島
|
133
133
|
GW: 幾內亞比索
|
134
134
|
GY: 蓋亞那
|
135
|
-
HK:
|
135
|
+
HK: 香港特別行政區
|
136
136
|
HM: 赫德島及麥唐納群島
|
137
137
|
HN: 宏都拉斯
|
138
138
|
HR: 克羅埃西亞
|
@@ -186,7 +186,7 @@ zh-TW:
|
|
186
186
|
ML: 馬利
|
187
187
|
MM: 緬甸
|
188
188
|
MN: 蒙古
|
189
|
-
MO:
|
189
|
+
MO: 澳門特別行政區
|
190
190
|
MP: 北馬利安納群島
|
191
191
|
MQ: 馬丁尼克
|
192
192
|
MR: 茅利塔尼亞
|
data/db/data/world.yml
CHANGED
@@ -298,7 +298,7 @@ alternates:
|
|
298
298
|
- TF # French Southern Territories (also filed under 014 Eastern Africa and under FR France)
|
299
299
|
'154': # Northern Europe
|
300
300
|
'830': # Channel Islands
|
301
|
-
-
|
301
|
+
- GG # Guernsey
|
302
302
|
- JE # Jersey
|
303
303
|
- CQ # Sark
|
304
304
|
AU: # Australia
|
data/lib/worldwide/field.rb
CHANGED
@@ -26,8 +26,8 @@ module Worldwide
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def initialize(country_code
|
30
|
-
@country_code = country_code
|
29
|
+
def initialize(country_code: nil, field_key:)
|
30
|
+
@country_code = country_code&.upcase&.to_sym
|
31
31
|
@field_key = field_key.downcase.to_sym
|
32
32
|
end
|
33
33
|
|
@@ -65,8 +65,12 @@ module Worldwide
|
|
65
65
|
|
66
66
|
def lookup(key_suffix, locale:, options: {})
|
67
67
|
I18n.with_locale(locale) do
|
68
|
-
|
68
|
+
if @country_code.nil?
|
69
69
|
default_lookup(key_suffix, options: options)
|
70
|
+
else
|
71
|
+
I18n.t("#{base_key(@country_code)}.#{key_suffix}", default: nil, **options) ||
|
72
|
+
default_lookup(key_suffix, options: options)
|
73
|
+
end
|
70
74
|
end
|
71
75
|
end
|
72
76
|
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: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01
|
11
|
+
date: 2024-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|