ffi-icu 0.5.2 → 0.5.3
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/lib/ffi-icu/locale.rb +2 -2
- data/lib/ffi-icu/version.rb +1 -1
- data/spec/locale_spec.rb +3 -3
- 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: 4b8a17a4a005b3b00d2620f11efc9d766b9b5d5c9af0de255f0fd172c9922fa3
|
4
|
+
data.tar.gz: e7987937796171479989cd08e0e4102e45294ef0b5df7251b4e41f867b1dc19e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d49d10b1bddb4b0b809b50e8d8be7294a9a7e3f8566dc344f57ea3538aa6ed9c035d41866b5213bdb930169d4f731f10c47734bfb956a99b7a64d6f16ab831
|
7
|
+
data.tar.gz: 6f3e79cabd9351488e264e2d3bf545cc21447c7daece998c0c346c063213fb62b03f3eb8ea20388c3f4d280b249536fdf57d7d2bd88fa25dca9a973487ac74a4
|
data/lib/ffi-icu/locale.rb
CHANGED
@@ -104,9 +104,9 @@ module ICU
|
|
104
104
|
def display_name_with_context(locale, contexts = [])
|
105
105
|
contexts = DISPLAY_CONTEXT.select { |context| contexts.include?(context) }.values
|
106
106
|
|
107
|
-
with_locale_display_name(
|
107
|
+
with_locale_display_name(locale, contexts) do |locale_display_names|
|
108
108
|
Lib::Util.read_uchar_buffer(256) do |buffer, status|
|
109
|
-
Lib.uldn_localeDisplayName(locale_display_names,
|
109
|
+
Lib.uldn_localeDisplayName(locale_display_names, @id, buffer, buffer.size, status)
|
110
110
|
end
|
111
111
|
end
|
112
112
|
end
|
data/lib/ffi-icu/version.rb
CHANGED
data/spec/locale_spec.rb
CHANGED
@@ -124,8 +124,8 @@ module ICU
|
|
124
124
|
end
|
125
125
|
|
126
126
|
it 'returns the name using display context' do
|
127
|
-
expect(Locale.new('
|
128
|
-
expect(Locale.new('
|
127
|
+
expect(Locale.new('en_HK').display_name_with_context('en_US', [:length_full])).to eq('English (Hong Kong SAR China)')
|
128
|
+
expect(Locale.new('en_HK').display_name_with_context('en_US', [:length_short])).to eq('English (Hong Kong)')
|
129
129
|
end
|
130
130
|
|
131
131
|
it 'returns the script' do
|
@@ -145,7 +145,7 @@ module ICU
|
|
145
145
|
expect(Locale.new('en_VI').display_country('ccp')).to_not be_nil
|
146
146
|
expect(Locale.new('yue_Hant').display_language('ccp')).to_not be_nil
|
147
147
|
expect(Locale.new('en_VI').display_name('ccp')).to_not be_nil
|
148
|
-
expect(Locale.new('
|
148
|
+
expect(Locale.new('en_VI').display_name_with_context('ccp')).to_not be_nil
|
149
149
|
expect(Locale.new('yue_Hant').display_script('ccp')).to_not be_nil
|
150
150
|
expect(Locale.new('en_US_POSIX').display_variant('sl')).to_not be_nil
|
151
151
|
end
|