twitter_cldr 6.0.1 → 6.0.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 +4 -4
- data/lib/twitter_cldr/shared/locale.rb +5 -3
- data/lib/twitter_cldr/version.rb +1 -1
- data/spec/shared/likely_subtags_spec.rb +8 -0
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e16faa9cf2e7fda6f36008b520e7f18cc1cd64c9e5c0a9c01cc3c787cfddf38d
|
|
4
|
+
data.tar.gz: 0750c3375803f85d1c126b473d15b11e91429af41ca6940da670732ebe57ce8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ffa52ad4c2ae417fca4e1d87c23272845dbfd7069f14984b4c123ebdf770410cef4ae38c552d1fe225727897f926fb671a3b7624a48a3429e6ba8518722ba412
|
|
7
|
+
data.tar.gz: f839fa10c1623407fa95a8f7e044376b3f139ba2bd602d0d57c6982899455c046f0e947d9f047a6f7150bbbc4b75bf1010562c720656afec25fde2ebe2b55853
|
|
@@ -104,22 +104,24 @@ module TwitterCldr
|
|
|
104
104
|
types << :script if script?(subtag)
|
|
105
105
|
types << :region if region?(subtag)
|
|
106
106
|
types << :variant if variant?(subtag)
|
|
107
|
+
|
|
108
|
+
types << :language if language?(normalize_subtag(subtag, :language))
|
|
109
|
+
types << :script if script?(normalize_subtag(subtag, :script))
|
|
110
|
+
types << :region if region?(normalize_subtag(subtag, :region))
|
|
111
|
+
types << :variant if variant?(normalize_subtag(subtag, :variant))
|
|
107
112
|
end
|
|
108
113
|
end
|
|
109
114
|
|
|
110
115
|
def language?(subtag)
|
|
111
|
-
subtag = normalize_subtag(subtag, :language)
|
|
112
116
|
languages.include?(subtag) || language_aliases.include?(subtag.to_sym)
|
|
113
117
|
end
|
|
114
118
|
|
|
115
119
|
def script?(subtag)
|
|
116
|
-
subtag = normalize_subtag(subtag, :script)
|
|
117
120
|
scripts.include?(subtag) ||
|
|
118
121
|
!!PropertyValueAliases.long_alias_for('sc', subtag)
|
|
119
122
|
end
|
|
120
123
|
|
|
121
124
|
def region?(subtag)
|
|
122
|
-
subtag = normalize_subtag(subtag, :region)
|
|
123
125
|
territories.include?(subtag) || region_aliases.include?(subtag.to_sym)
|
|
124
126
|
end
|
|
125
127
|
|
data/lib/twitter_cldr/version.rb
CHANGED
|
@@ -49,6 +49,14 @@ describe TwitterCldr::Shared::LikelySubtags do
|
|
|
49
49
|
verify_subtags(locale, 'en', 'Latn', 'US')
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
it 'disambiguates between a language and region with the same code' do
|
|
53
|
+
locale = described_class.locale_for('und-CH')
|
|
54
|
+
verify_subtags(locale, 'de', 'Latn', 'CH')
|
|
55
|
+
|
|
56
|
+
locale = described_class.locale_for('und_Arab_AF')
|
|
57
|
+
verify_subtags(locale, 'ar', 'Arab', 'AF')
|
|
58
|
+
end
|
|
59
|
+
|
|
52
60
|
it "raises an error if the subtags can't be identified" do
|
|
53
61
|
locale = TwitterCldr::Shared::Locale.new('xz')
|
|
54
62
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: twitter_cldr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.0.
|
|
4
|
+
version: 6.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cameron Dutro
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-07-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: camertron-eprun
|
|
@@ -3908,7 +3908,7 @@ homepage: https://twitter.com
|
|
|
3908
3908
|
licenses:
|
|
3909
3909
|
- Apache-2.0
|
|
3910
3910
|
metadata: {}
|
|
3911
|
-
post_install_message:
|
|
3911
|
+
post_install_message:
|
|
3912
3912
|
rdoc_options: []
|
|
3913
3913
|
require_paths:
|
|
3914
3914
|
- lib
|
|
@@ -3923,8 +3923,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
3923
3923
|
- !ruby/object:Gem::Version
|
|
3924
3924
|
version: '0'
|
|
3925
3925
|
requirements: []
|
|
3926
|
-
rubygems_version: 3.1.
|
|
3927
|
-
signing_key:
|
|
3926
|
+
rubygems_version: 3.1.4
|
|
3927
|
+
signing_key:
|
|
3928
3928
|
specification_version: 4
|
|
3929
3929
|
summary: Ruby implementation of the ICU (International Components for Unicode) that
|
|
3930
3930
|
uses the Common Locale Data Repository to format dates, plurals, and more.
|