worldwide 1.28.0 → 1.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 909c8730bf69311da55d2880b5b246d70af5df8eedc3e9de3c162f537b585188
4
- data.tar.gz: 2a7eb3d5613c11b63719ea415acec13b5347496284faa44b28223bd93420bd5d
3
+ metadata.gz: ff22cf49d903a56eb383a47144d8b7785700834e92febb386c0408046ac05e29
4
+ data.tar.gz: 5649a3fa59a0f2873223f57e6eeee979797c27d647f427614f4434c9bb80a03f
5
5
  SHA512:
6
- metadata.gz: 6ece942742ed16568e01763b5ef6033f05f873e9cbfb6fae933dfa3b5552bb81210e7c57f0f78dd916c1680c8b05f9c60e64da4901744a28d00dc7a01f337ae3
7
- data.tar.gz: 5af292484d8cbe28f47ddf2acc3976d31c5fba811e140b9222844b3234cfbce3d14682bab4b4167ac684052772b614c7d97a1e7734b98dd0b550e23f0f1548bd
6
+ metadata.gz: 9d85c2aafb2703f4e5d83206be1e6dee801c2ef1e16359d3a3dc45720d3da11d701b868250e124bd8eebb1bacea8720bd1a0f01578c34ba4679aac108c60aaa5
7
+ data.tar.gz: ee3252a6b7dbaeb462731675d956322d029ac0a3ce783b08c08456858c5bbc1274ba6f1797b0dc628dc3dcf42b8f9060576cea1fb60d41f8fb3b9ff0efbefe9b
@@ -0,0 +1,7 @@
1
+ # CODEOWNERS file for worldwide
2
+ # This file defines code owners for specific files/patterns in this repository
3
+
4
+ # Address team reviews all changes except Gemfile.lock and RBI files
5
+ * @Shopify/address
6
+ Gemfile.lock
7
+ sorbet/rbi/gems/**
data/CHANGELOG.md CHANGED
@@ -29,6 +29,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
29
29
 
30
30
  ---
31
31
 
32
+ ## [1.28.2] - 2026-09-25
33
+
34
+ - Add the missing `2061` postcode to Australia's example address and correct its suburb to Kirribilli. [#606](https://github.com/Shopify/worldwide/pull/606)
35
+ - Remove the Brazilian `address1_regex` pattern that split a comma-delimited building number followed by a complement keyword, added in 1.26.3. [#613](https://github.com/Shopify/worldwide/pull/613)
36
+
37
+ ---
38
+
39
+ ## [1.28.1] - 2026-09-23
40
+
41
+ - Accept `USDC` as the only supported non-ISO currency code, while malformed and other unknown codes stay out of the currency cache. [#607](https://github.com/Shopify/worldwide/pull/607)
42
+ - Apply CLDR fallbacks for hosts that read `I18n.fallbacks` from `Thread.current`, which stopped seeing them in 1.25.6. [#607](https://github.com/Shopify/worldwide/pull/607)
43
+
44
+ ---
45
+
32
46
  ## [1.28.0] - 2026-09-21
33
47
 
34
48
  - Add `Region#iso_3166_code_assigned?` to distinguish currently assigned ISO 3166-1 alpha-2 codes from other region codes. [#598](https://github.com/Shopify/worldwide/pull/598)
data/Gemfile.lock CHANGED
@@ -13,7 +13,7 @@ GIT
13
13
  PATH
14
14
  remote: .
15
15
  specs:
16
- worldwide (1.28.0)
16
+ worldwide (1.28.2)
17
17
  activesupport (>= 7.0)
18
18
  i18n (>= 1.15)
19
19
  phonelib (~> 0.8)
data/data/regions/AU.yml CHANGED
@@ -27,8 +27,9 @@ languages:
27
27
  - en
28
28
  example_address:
29
29
  address1: 109 Kirribilli Ave
30
- city: Kiribilli
30
+ city: Kirribilli
31
31
  province_code: NSW
32
+ zip: '2061'
32
33
  phone: "+61 2 6283 3533"
33
34
  use_zone_code_as_short_name: true
34
35
  zones:
data/data/regions/BR.yml CHANGED
@@ -31,7 +31,6 @@ format_extended:
31
31
  address1_regex:
32
32
  - "^(?<streetName>.+?),\\s*(?<streetNumber>(?:\\d+[a-zà-öø-ÿ]?|\\d+(?:[-/]\\d+[a-zà-öø-ÿ]?)+|\\d+(?:\\s+\\d+)+|s\\/?n|sem n[úu]mero))$"
33
33
  - "^(?<streetName>.+?),\\s*(?<streetNumber>(?:\\d+[a-zà-öø-ÿ]?|\\d+(?:[-/]\\d+[a-zà-öø-ÿ]?)+|\\d+(?:\\s+\\d+)+|s\\/?n|sem n[úu]mero))\\s*,\\s*(?<line2>.+)$"
34
- - "^(?<streetName>.+?),\\s*(?<streetNumber>(?:\\d+[a-zà-öø-ÿ]?|\\d+(?:[-/]\\d+[a-zà-öø-ÿ]?)+|\\d+(?:\\s+\\d+)+|s\\/?n|sem n[úu]mero))\\s+(?<line2>(?:apt(?:o|\\.)?|apartamento|bloco|casa|sala|fundos|loja|condom[ií]nio)\\b.+)$"
35
34
  - "^(?<streetName>(?:[^\\d,\\s]+\\s)*[^\\d,\\s]+)\\s+(?<streetNumber>\\d+(?: ?[a-z])?)\\s+(?<line2>(?:apt(?:o|\\.)?|apartamento|bloco|casa|sala|fundos|loja)\\b.+)$"
36
35
  - "^(?<streetName>(?:[^\\d,\\s]+\\s)*[^\\d,\\s]+)(?:,? ?)(?<streetNumber>\\d+(?: ?[a-z])?)\\s*,\\s*(?<line2>.+)$"
37
36
  - "^(?<streetName>(?:[^\\d,\\s]+\\s)*[^\\d,\\s]+)(?:,? ?)(?<streetNumber>\\d+(?: ?[a-z])?)$"
@@ -82,15 +82,20 @@ module Worldwide
82
82
  # application's global fallbacks.
83
83
  original_config = STORAGE.config
84
84
  original_fallbacks = STORAGE.fallbacks
85
+ # Some hosts patch I18n.fallbacks to keep reading Thread.current, the slot
86
+ # used before i18n 1.15, so they must also see the CLDR fallbacks.
87
+ original_thread_fallbacks = Thread.current[:i18n_fallbacks]
85
88
  locale = I18n.locale
86
89
 
87
90
  STORAGE.config = config
88
91
  STORAGE.fallbacks = fallbacks
92
+ Thread.current[:i18n_fallbacks] = fallbacks
89
93
 
90
94
  I18n.with_locale(locale, &block)
91
95
  ensure
92
96
  STORAGE.config = original_config
93
97
  STORAGE.fallbacks = original_fallbacks
98
+ Thread.current[:i18n_fallbacks] = original_thread_fallbacks
94
99
  end
95
100
  end
96
101
  end
@@ -6,9 +6,11 @@ module Worldwide
6
6
  include PluralizationHelper
7
7
 
8
8
  EXCEPTIONS = { HKD: "HK$" }
9
+ # Extended codes must be explicit so the process cache remains bounded.
10
+ SUPPORTED_NON_ISO_CODES = ["USDC"].freeze
9
11
  SUPPORTED_ALTERNATE_FORMATS = [:japan]
10
12
  TEXT_ENCLOSED_BY_PARENTHESES = /\((.)+\)/
11
- private_constant :TEXT_ENCLOSED_BY_PARENTHESES
13
+ private_constant :SUPPORTED_NON_ISO_CODES, :TEXT_ENCLOSED_BY_PARENTHESES
12
14
 
13
15
  class << self
14
16
  def digits_and_rounding
@@ -28,7 +30,7 @@ module Worldwide
28
30
 
29
31
  def initialize(code:)
30
32
  adjusted_code = code.to_s.upcase.rjust(3, "0")
31
- if adjusted_code.match?(/\A[A-Z]{3}\z/)
33
+ if adjusted_code.match?(/\A[A-Z]{3}\z/) || SUPPORTED_NON_ISO_CODES.include?(adjusted_code)
32
34
  @currency_code = adjusted_code
33
35
  @numeric_code = Currencies.numeric_code_for(adjusted_code)
34
36
  elsif adjusted_code.match?(/\A[0-9]{3}\z/)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Worldwide
4
- VERSION = "1.28.0"
4
+ VERSION = "1.28.2"
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: 1.28.0
4
+ version: 1.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
@@ -59,6 +59,7 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".github/CODEOWNERS"
62
63
  - ".github/CODE_OF_CONDUCT.md"
63
64
  - ".github/CONTRIBUTING.md"
64
65
  - ".github/dependabot.yml"