twitter_cldr 6.0.1 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3393ba4d3d98613d00528bdcec456e18bc6a3aed3f9c51a40d75a390056c6c6
4
- data.tar.gz: 0d7d4ffd39998e264f25d25ba8fdb5d56d79d10c47ccadb7d4856a83e432a113
3
+ metadata.gz: e16faa9cf2e7fda6f36008b520e7f18cc1cd64c9e5c0a9c01cc3c787cfddf38d
4
+ data.tar.gz: 0750c3375803f85d1c126b473d15b11e91429af41ca6940da670732ebe57ce8d
5
5
  SHA512:
6
- metadata.gz: 4844ca03544ed92311170d968c9915bfc2b5865a17db8d0dbfb7834364f8ab208cb3f603c99a3a7695fbc619a07df98161245cf2247b957e7d51a461bfebe309
7
- data.tar.gz: 9c7d78338b5eb3199b016161eecc4c6d293fbe8628934a33e9deaaf828f90b771404ca2e77e4a2e09846397c45b34c97d7e315a2bc26393af5e0ce9f07648e1c
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
 
@@ -4,5 +4,5 @@
4
4
  # http://www.apache.org/licenses/LICENSE-2.0
5
5
 
6
6
  module TwitterCldr
7
- VERSION = '6.0.1'
7
+ VERSION = '6.0.2'
8
8
  end
@@ -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.1
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-05-16 00:00:00.000000000 Z
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.2
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.