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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc21061379ab6f17ea3528d1f19b83f81275c8f9b5eb3c89d4f652f49faa2367
4
- data.tar.gz: 5d5d8fd0716a26b5d856432950077a2722efc72daeddef4d128a9f346b861286
3
+ metadata.gz: 98738f7c982e2610e9f8a024fec119e4b79f06d8b7979977207c3a25888b88a6
4
+ data.tar.gz: 725fa21a0aa838c0b291705a4d3ffe0ee64fb910b020ed609ce2d2093428b045
5
5
  SHA512:
6
- metadata.gz: 8a2279dad4234b6f6ee3c69db576660b37a24ae9a63852b13322cb9d7a33d3650f9df3ef5fab199eb42e03694b7967014b0203582ac40aa38c99665c63630b87
7
- data.tar.gz: 3d897410ee24c31a9b4a58cb1e6888f82e67fa67732e7073f1f2863de8c5b27c27877561651ed196e1d0b17a646ecaae6f9b416716e9e145e682961adf1ebe8d
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
- nil.
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
@@ -13,7 +13,7 @@ GIT
13
13
  PATH
14
14
  remote: .
15
15
  specs:
16
- worldwide (0.6.8)
16
+ worldwide (0.7.1)
17
17
  activesupport (~> 7.0)
18
18
  i18n
19
19
  phonelib (~> 0.8)
@@ -132,4 +132,4 @@ DEPENDENCIES
132
132
  worldwide!
133
133
 
134
134
  BUNDLED WITH
135
- 2.4.6
135
+ 2.4.10
@@ -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
@@ -114,7 +114,7 @@ fi:
114
114
  FO: Färsaaret
115
115
  FR: Ranska
116
116
  GA: Gabon
117
- GB: Iso-Britannia
117
+ GB: Yhdistynyt kuningaskunta
118
118
  GD: Grenada
119
119
  GE: Georgia
120
120
  GF: Ranskan Guayana
@@ -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
@@ -252,7 +252,7 @@ it:
252
252
  SV: El Salvador
253
253
  SX: Sint Maarten
254
254
  SY: Siria
255
- SZ: Swaziland
255
+ SZ: eSwatini
256
256
  TA: Tristan da Cunha
257
257
  TC: Isole Turks e Caicos
258
258
  TD: Ciad
@@ -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
- - GY # Guernsey
301
+ - GG # Guernsey
302
302
  - JE # Jersey
303
303
  - CQ # Sark
304
304
  AU: # Australia
@@ -26,8 +26,8 @@ module Worldwide
26
26
  end
27
27
  end
28
28
 
29
- def initialize(country_code:, field_key:)
30
- @country_code = country_code.upcase.to_sym
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
- I18n.t("#{base_key(@country_code)}.#{key_suffix}", default: nil, **options) ||
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "0.6.8"
4
+ VERSION = "0.7.1"
5
5
  end
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.6.8
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-31 00:00:00.000000000 Z
11
+ date: 2024-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport