locale 2.1.2 → 2.1.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 +5 -5
- data/Rakefile +0 -1
- data/doc/text/news.md +6 -0
- data/lib/locale/tag/cldr.rb +4 -2
- data/lib/locale/tag/common.rb +4 -2
- data/lib/locale/tag/posix.rb +4 -2
- data/lib/locale/tag/rfc.rb +4 -2
- data/lib/locale/tag/simple.rb +3 -1
- data/lib/locale/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6ec4fc8d1cf8b1f7c4a9a1f52571c25ac8fea84cf2a834eb5ce1bd28ad7650f3
|
4
|
+
data.tar.gz: c983bc5f2e425cfd999548fc25b77e6f17032c24ea403e91d4f258089fa16876
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 200a569b57b3dcd15bae51bea2011f1a7aa5772719d3333d3a282d608577a91620cfbca5b21ba5531f888aad85f6d851de0348edf6a343adc7b4ea9c5b9cb71d
|
7
|
+
data.tar.gz: 94f77b80770f5ae2c7508c00304b57a29863b4eef4d6a852a64a62c01e8915d09d280da786c496d137ee7d2d6573909639d85e21ecbdd2ac9606cf336441ab88
|
data/Rakefile
CHANGED
data/doc/text/news.md
CHANGED
data/lib/locale/tag/cldr.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
locale/tag/cldr.rb - Locale::Tag::CLDR
|
3
3
|
|
4
4
|
Copyright (C) 2008,2009 Masao Mutoh
|
5
|
+
Copyright (C) 2018 Kouhei Sutou <kou@clear-code.com>
|
5
6
|
|
6
7
|
You may redistribute it and/or modify it under the same
|
7
8
|
license terms as Ruby.
|
@@ -28,9 +29,10 @@ module Locale
|
|
28
29
|
class << self
|
29
30
|
# Parse the language tag and return the new Locale::Tag::CLDR.
|
30
31
|
def parse(tag)
|
31
|
-
|
32
|
+
case tag
|
33
|
+
when /\APOSIX\Z/ # This is the special case of POSIX locale but match this regexp.
|
32
34
|
nil
|
33
|
-
|
35
|
+
when TAG_RE
|
34
36
|
lang, script, region, subtag = $1, $2, $3, $4
|
35
37
|
|
36
38
|
extensions = {}
|
data/lib/locale/tag/common.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
locale/tag/common.rb - Locale::Tag::Common
|
3
3
|
|
4
4
|
Copyright (C) 2008,2009 Masao Mutoh
|
5
|
+
Copyright (C) 2018 Kouhei Sutou <kou@clear-code.com>
|
5
6
|
|
6
7
|
You may redistribute it and/or modify it under the same
|
7
8
|
license terms as Ruby.
|
@@ -35,9 +36,10 @@ module Locale
|
|
35
36
|
class << self
|
36
37
|
# Parse the language tag and return the new Locale::Tag::Common.
|
37
38
|
def parse(tag)
|
38
|
-
|
39
|
+
case tag
|
40
|
+
when /\APOSIX\Z/ # This is the special case of POSIX locale but match this regexp.
|
39
41
|
nil
|
40
|
-
|
42
|
+
when TAG_RE
|
41
43
|
lang, script, region, subtag = $1, $2, $3, $4
|
42
44
|
variants = subtag.scan(/(^|[-_])#{VARIANT}(?=([-_]|$))/i).collect{|v| v[1]}
|
43
45
|
|
data/lib/locale/tag/posix.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
locale/tag/posix.rb - Locale::Tag::Posix
|
3
3
|
|
4
4
|
Copyright (C) 2008 Masao Mutoh
|
5
|
+
Copyright (C) 2018 Kouhei Sutou <kou@clear-code.com>
|
5
6
|
|
6
7
|
You may redistribute it and/or modify it under the same
|
7
8
|
license terms as Ruby.
|
@@ -30,11 +31,12 @@ module Locale
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def self.parse(tag)
|
33
|
-
|
34
|
+
case tag
|
35
|
+
when /^(C|POSIX)$/
|
34
36
|
ret = self.new("en", "US")
|
35
37
|
ret.tag = tag
|
36
38
|
ret
|
37
|
-
|
39
|
+
when TAG_RE
|
38
40
|
ret = self.new($1, $2, $3, $4)
|
39
41
|
ret.tag = tag
|
40
42
|
ret
|
data/lib/locale/tag/rfc.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
locale/tag/rfc.rb - Locale::Tag::Rfc
|
3
3
|
|
4
4
|
Copyright (C) 2008,2009 Masao Mutoh
|
5
|
+
Copyright (C) 2018 Kouhei Sutou <kou@clear-code.com>
|
5
6
|
|
6
7
|
You may redistribute it and/or modify it under the same
|
7
8
|
license terms as Ruby.
|
@@ -29,9 +30,10 @@ module Locale
|
|
29
30
|
class << self
|
30
31
|
# Parse the language tag and return the new Locale::Tag::Rfc.
|
31
32
|
def parse(tag)
|
32
|
-
|
33
|
+
case tag
|
34
|
+
when /\APOSIX\Z/ # This is the special case of POSIX locale but match this regexp.
|
33
35
|
nil
|
34
|
-
|
36
|
+
when TAG_RE
|
35
37
|
lang, script, region, subtag = $1, $2, $3, $4
|
36
38
|
extensions = []
|
37
39
|
variants = []
|
data/lib/locale/tag/simple.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
locale/tag/simple.rb - Locale::Tag::Simple
|
3
3
|
|
4
4
|
Copyright (C) 2008,2009 Masao Mutoh
|
5
|
+
Copyright (C) 2018 Kouhei Sutou <kou@clear-code.com>
|
5
6
|
|
6
7
|
You may redistribute it and/or modify it under the same
|
7
8
|
license terms as Ruby.
|
@@ -52,7 +53,8 @@ module Locale
|
|
52
53
|
class << self
|
53
54
|
# Parse the language tag and return the new Locale::Tag::Simple.
|
54
55
|
def parse(tag)
|
55
|
-
|
56
|
+
case tag
|
57
|
+
when TAG_RE
|
56
58
|
ret = self.new($1, $2)
|
57
59
|
ret.tag = tag
|
58
60
|
ret
|
data/lib/locale/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -109,8 +109,9 @@ dependencies:
|
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
|
-
description:
|
113
|
-
|
112
|
+
description: 'Ruby-Locale is the pure ruby library which provides basic APIs for localization.
|
113
|
+
|
114
|
+
'
|
114
115
|
email:
|
115
116
|
- kou@clear-code.com
|
116
117
|
- mutomasa at gmail.com
|
@@ -190,18 +191,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
191
|
version: '0'
|
191
192
|
requirements: []
|
192
193
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.
|
194
|
+
rubygems_version: 2.7.6.2
|
194
195
|
signing_key:
|
195
196
|
specification_version: 4
|
196
197
|
summary: Ruby-Locale is the pure ruby library which provides basic APIs for localization.
|
197
198
|
test_files:
|
199
|
+
- test/test_locale.rb
|
200
|
+
- test/test_driver_win32.rb
|
198
201
|
- test/test_tag.rb
|
199
|
-
- test/test_detect_cgi.rb
|
200
|
-
- test/test_info.rb
|
201
202
|
- test/test_thread.rb
|
202
|
-
- test/test_driver_jruby.rb
|
203
203
|
- test/test_taglist.rb
|
204
|
-
- test/test_driver_win32.rb
|
205
204
|
- test/test_detect_general.rb
|
206
|
-
- test/
|
207
|
-
|
205
|
+
- test/test_driver_jruby.rb
|
206
|
+
- test/test_info.rb
|
207
|
+
- test/test_detect_cgi.rb
|