worldwide 1.28.0 → 1.28.1
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 +4 -4
- data/.github/CODEOWNERS +7 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/lib/worldwide/cldr.rb +5 -0
- data/lib/worldwide/currency.rb +4 -2
- data/lib/worldwide/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: afc3540f3eaf751ee10b556f119aaee8388238ae648242af64cc87df2eb8faa4
|
|
4
|
+
data.tar.gz: bc26455e86b23aa4ce3446966fb61dd96ec4fa7b463d5df9903e8f5654a4ff3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd96594b69a597d00ada229bc983892e9e117d248edbdd7f2c3bb3ea9a83265b7dedaa3f396744d247566dfdfaa418bf80c31e42647fcd6732ff25e28c446fe8
|
|
7
|
+
data.tar.gz: 717ad7d14a176b38563072f8dbff0fe8b182c3fc92926b660357d9cfd511051514891e820baf146feae5805359ea3d3f8663d0ab875f2a645194259a3531031f
|
data/.github/CODEOWNERS
ADDED
data/CHANGELOG.md
CHANGED
|
@@ -29,6 +29,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
+
## [1.28.1] - 2026-09-23
|
|
33
|
+
|
|
34
|
+
- 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)
|
|
35
|
+
- 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)
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
32
39
|
## [1.28.0] - 2026-09-21
|
|
33
40
|
|
|
34
41
|
- 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
data/lib/worldwide/cldr.rb
CHANGED
|
@@ -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
|
data/lib/worldwide/currency.rb
CHANGED
|
@@ -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/)
|
data/lib/worldwide/version.rb
CHANGED
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.
|
|
4
|
+
version: 1.28.1
|
|
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"
|