human_number 0.1.5 → 0.1.6
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/.rspec +2 -3
- data/lib/human_number/locale_support.rb +3 -0
- data/lib/human_number/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e4c992501e9303d1d288b507757e305bbf1cd148322bb5d23046f3ca9a5703
|
4
|
+
data.tar.gz: 74b84f6b21e5e4d7b869f81f4ee41a1f090be8884c07f0d58fb113029afde5de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8204b1d746ffda09e0973bc49d7418bbfb5a3355c791839a1afc6f22e2332de1fe9ceb44eee744f92d10d7e15f0e883d3ea8c1b1d171119c84e345160a1b14b
|
7
|
+
data.tar.gz: 4cf5346df66b1dfb6143dec1c61db38532bb172bf9a56fddc0700531941de333292081c7431fe1799e900723289947ef10b35d48252657efef9ec76fba6b6419
|
data/.rspec
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
--format
|
2
|
-
--
|
3
|
-
--require spec_helper
|
1
|
+
--format progress
|
2
|
+
--require spec_helper
|
@@ -113,12 +113,15 @@ module HumanNumber
|
|
113
113
|
# Return nil for unknown currencies so formatters can fall back appropriately
|
114
114
|
return nil if native_locales_for_currency(currency_code).empty?
|
115
115
|
|
116
|
+
# For native locales, use native currency formatting (native_unit, native_format)
|
116
117
|
if SUPPORTED_NATIVE_CURRENCY_KEYS.include?(key) && native_locale?(currency_code, locale)
|
117
118
|
native_key = native_currency_key(key)
|
118
119
|
|
119
120
|
return I18n.t(native_key, locale:) if I18n.exists?(native_key, locale)
|
120
121
|
end
|
121
122
|
|
123
|
+
# For non-native locales or standard keys, always use the currency's native locale
|
124
|
+
# This ensures we get the correct currency symbol regardless of user's locale
|
122
125
|
I18n.t(currency_key(key), locale: primary_locale_for_currency(currency_code, locale))
|
123
126
|
end
|
124
127
|
end
|
data/lib/human_number/version.rb
CHANGED