worldwide 0.6.8 → 0.7.0

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: d77d16a44dc494413132f4e14e2e990a2cd4d184bec491428f2beb5e14038cd6
4
+ data.tar.gz: 00b095d594e66f476403a8040d304a102ce494d9f5cc1fd9c9e8d9d833425c89
5
5
  SHA512:
6
- metadata.gz: 8a2279dad4234b6f6ee3c69db576660b37a24ae9a63852b13322cb9d7a33d3650f9df3ef5fab199eb42e03694b7967014b0203582ac40aa38c99665c63630b87
7
- data.tar.gz: 3d897410ee24c31a9b4a58cb1e6888f82e67fa67732e7073f1f2863de8c5b27c27877561651ed196e1d0b17a646ecaae6f9b416716e9e145e682961adf1ebe8d
6
+ metadata.gz: 8e737c2f727fb3e017a83a88490cbd73ff4c9408ec43c44b804fb07d1ebf5262c21d3e9df98a4f5bc6746e6d5f25997abb3f862f581c1595f60d36491ed22e81
7
+ data.tar.gz: 74436ab09a204d16cec2064c530e473b19109ffbd24d23320f735e081781333fde6af0c547044dbba4cc7f1147aab71585c74c443e98147a4e796133a1e4836d
data/CHANGELOG.md CHANGED
@@ -27,9 +27,11 @@ 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
+ [0.7.0] - 2024-01-31
33
+
34
+ - Support address field lookup when there is no country code. [#82](https://github.com/Shopify/worldwide/pull/82)
33
35
 
34
36
  [0.6.8] - 2024-01-31
35
37
 
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.0)
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
@@ -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.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify