locale 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.rdoc +2 -2
- data/doc/text/news.md +14 -0
- data/lib/locale/driver/cgi.rb +2 -2
- data/lib/locale/version.rb +2 -2
- data/locale.gemspec +3 -4
- data/test/test_detect_general.rb +24 -0
- data/test/test_driver_jruby.rb +5 -1
- data/test/test_driver_win32.rb +5 -1
- metadata +13 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0566995735dba653591ecc129791317aaccb9e04910bdf530a968eda9bc3d3b8'
|
4
|
+
data.tar.gz: 9352a3d86cb0d62bbb5d65aedeab76e20ec2a5ee9773ec51fec0409a04449fc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5de200054cccf923c4d542175d792dddb28a3ec59887e9a97c6aec55a59d588c1690527540a83affee5fe1843b01bd4bcef6bc02310b91da98b9c107c015cff0
|
7
|
+
data.tar.gz: 9e846daf080367701b615377af1d07ef1428b70bc779a664ea08ae8e061c8f26b13ac5229fdc1b95cd71966c7ae07c0d8db272a42d30da9481ca2a24bb2461dd
|
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -28,8 +28,8 @@ other i18n/l10n libs/apps to handle major locale ID standards.
|
|
28
28
|
* https://github.com/ruby-gettext/locale
|
29
29
|
|
30
30
|
== Requirements
|
31
|
-
* Ruby-1.8.7 or later <
|
32
|
-
* JRuby-1.1.4 or later <
|
31
|
+
* Ruby-1.8.7 or later <https://www.ruby-lang.org/>
|
32
|
+
* JRuby-1.1.4 or later <https://www.jruby.org/>
|
33
33
|
|
34
34
|
== Install
|
35
35
|
|
data/doc/text/news.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## 2.1.4: 2024-03-18
|
4
|
+
|
5
|
+
### Fixes
|
6
|
+
|
7
|
+
* `Locale::Middleware`: Fixed a bug that `lang` cookie and
|
8
|
+
`Accept-Language`/`Accept-Charset` HTTP headers never used.
|
9
|
+
* GH-15
|
10
|
+
* GH-16
|
11
|
+
* Patch by OZAWA Sakuro
|
12
|
+
|
13
|
+
### Thanks
|
14
|
+
|
15
|
+
* OZAWA Sakuro
|
16
|
+
|
3
17
|
## <a id="2-1-3">2.1.3</a>: 2020-02-12
|
4
18
|
|
5
19
|
### Improvements
|
data/lib/locale/driver/cgi.rb
CHANGED
@@ -95,8 +95,8 @@ module Locale
|
|
95
95
|
def set_request(query_langs, cookie_langs, accept_language, accept_charset)
|
96
96
|
Locale.clear
|
97
97
|
Thread.current[:current_request] = {
|
98
|
-
:query_langs => query_langs,
|
99
|
-
:cookie_langs => cookie_langs,
|
98
|
+
:query_langs => query_langs.compact,
|
99
|
+
:cookie_langs => cookie_langs.compact,
|
100
100
|
:accept_language => accept_language,
|
101
101
|
:accept_charset => accept_charset
|
102
102
|
}
|
data/lib/locale/version.rb
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
version - version information of Ruby-Locale
|
3
3
|
|
4
4
|
Copyright (C) 2008 Masao Mutoh
|
5
|
-
Copyright (C) 2013-
|
5
|
+
Copyright (C) 2013-2020 Sutou Kouhei <kou@clear-code.com>
|
6
6
|
|
7
7
|
You may redistribute it and/or modify it under the same
|
8
8
|
license terms as Ruby.
|
9
9
|
=end
|
10
10
|
module Locale
|
11
|
-
VERSION = "2.1.
|
11
|
+
VERSION = "2.1.4"
|
12
12
|
end
|
13
13
|
|
data/locale.gemspec
CHANGED
@@ -44,11 +44,10 @@ Ruby-Locale is the pure ruby library which provides basic APIs for localization.
|
|
44
44
|
s.test_files = Dir.glob("test/test_*.rb")
|
45
45
|
end
|
46
46
|
|
47
|
-
s.add_development_dependency("rake")
|
48
47
|
s.add_development_dependency("bundler")
|
49
|
-
s.add_development_dependency("
|
50
|
-
s.add_development_dependency("
|
48
|
+
s.add_development_dependency("kramdown")
|
49
|
+
s.add_development_dependency("rake")
|
51
50
|
s.add_development_dependency("test-unit")
|
52
|
-
s.add_development_dependency("test-unit-notify")
|
53
51
|
s.add_development_dependency("test-unit-rr")
|
52
|
+
s.add_development_dependency("yard")
|
54
53
|
end
|
data/test/test_detect_general.rb
CHANGED
@@ -27,6 +27,12 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
27
27
|
def setup
|
28
28
|
Locale.init
|
29
29
|
Locale.clear_all
|
30
|
+
@have_win32_driver =
|
31
|
+
(Locale::Driver.const_defined?(:Win32) and
|
32
|
+
Locale::Driver::Win32.respond_to?(:set_thread_locale_id))
|
33
|
+
if @have_win32_driver
|
34
|
+
Locale::Driver::Win32.set_thread_locale_id(0xffff) # invalid
|
35
|
+
end
|
30
36
|
ENV["LC_ALL"] = nil
|
31
37
|
ENV["LC_CTYPE"] = nil
|
32
38
|
ENV["LC_MESSAGES"] = nil
|
@@ -34,6 +40,12 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
34
40
|
ENV["LANGUAGE"] = nil
|
35
41
|
end
|
36
42
|
|
43
|
+
def teardown
|
44
|
+
if @have_win32_driver
|
45
|
+
Locale::Driver::Win32.set_thread_locale_id(nil)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
37
49
|
def test_lc_all
|
38
50
|
ENV["LC_ALL"] = "ja_JP.eucJP"
|
39
51
|
ENV["LC_CTYPE"] = "fr_FR.ISO-8859-1" #Ignored.
|
@@ -165,6 +177,8 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
165
177
|
end
|
166
178
|
|
167
179
|
test "LC_ALL=C" do
|
180
|
+
omit("Can't disable the JRuby's default") if jruby?
|
181
|
+
|
168
182
|
ENV["LC_ALL"] = "C"
|
169
183
|
ENV["LANGUAGE"] = "zh_CN.UTF-8:ja_JP" # ignored
|
170
184
|
|
@@ -173,6 +187,8 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
173
187
|
end
|
174
188
|
|
175
189
|
test "LC_MESSAGES=C" do
|
190
|
+
omit("Can't disable the JRuby's default") if jruby?
|
191
|
+
|
176
192
|
ENV["LC_MESSAGES"] = "C"
|
177
193
|
ENV["LANGUAGE"] = "zh_CN.UTF-8:ja_JP" # ignored
|
178
194
|
|
@@ -181,6 +197,8 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
181
197
|
end
|
182
198
|
|
183
199
|
test "LANG=C" do
|
200
|
+
omit("Can't disable the JRuby's default") if jruby?
|
201
|
+
|
184
202
|
ENV["LANG"] = "C"
|
185
203
|
ENV["LANGUAGE"] = "zh_CN.UTF-8:ja_JP" # ignored
|
186
204
|
|
@@ -213,6 +231,8 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
213
231
|
end
|
214
232
|
|
215
233
|
test "LC_ALL=C and LC_MESSAGES" do
|
234
|
+
omit("Can't disable the JRuby's default") if jruby?
|
235
|
+
|
216
236
|
ENV["LC_ALL"] = "C"
|
217
237
|
ENV["LC_MESSAGES"] = "ja_JP.Shift_JIS"
|
218
238
|
ENV["LANGUAGE"] = "zh_CN.UTF-8:ja_JP" # ignored
|
@@ -222,6 +242,8 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
222
242
|
end
|
223
243
|
|
224
244
|
test "LC_ALL=C and LANG" do
|
245
|
+
omit("Can't disable the JRuby's default") if jruby?
|
246
|
+
|
225
247
|
ENV["LC_ALL"] = "C"
|
226
248
|
ENV["LANG"] = "ja_JP.Shift_JIS"
|
227
249
|
ENV["LANGUAGE"] = "zh_CN.UTF-8:ja_JP" # ignored
|
@@ -231,6 +253,8 @@ class TestDetectGeneral < Test::Unit::TestCase
|
|
231
253
|
end
|
232
254
|
|
233
255
|
test "LC_MESSAGES=C and LANG" do
|
256
|
+
omit("Can't disable the JRuby's default") if jruby?
|
257
|
+
|
234
258
|
ENV["LC_MESSAGES"] = "C"
|
235
259
|
ENV["LANG"] = "ja_JP.Shift_JIS"
|
236
260
|
ENV["LANGUAGE"] = "zh_CN.UTF-8:ja_JP" # ignored
|
data/test/test_driver_jruby.rb
CHANGED
@@ -25,10 +25,14 @@ begin
|
|
25
25
|
class TestDiverJRuby < Test::Unit::TestCase
|
26
26
|
|
27
27
|
def setup
|
28
|
+
Locale.init
|
29
|
+
Locale.clear_all
|
28
30
|
ENV["LC_ALL"] = nil
|
29
31
|
ENV["LC_CTYPE"] = nil
|
32
|
+
ENV["LC_MESSAGES"] = nil
|
30
33
|
ENV["LANG"] = nil
|
31
34
|
ENV["LANGUAGE"] = nil
|
35
|
+
set_locale(Locale::Tag::Common.parse("en-US"))
|
32
36
|
end
|
33
37
|
|
34
38
|
def set_locale(tag)
|
@@ -56,7 +60,7 @@ begin
|
|
56
60
|
assert_equal Locale::Tag::Posix.parse("ja_JP"), Locale::Driver::JRuby.locales[0]
|
57
61
|
|
58
62
|
ENV["LC_ALL"] = "C"
|
59
|
-
assert_equal Locale::Tag::
|
63
|
+
assert_equal Locale::Tag::Common.parse("en-US"), Locale::Driver::JRuby.locales[0]
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
data/test/test_driver_win32.rb
CHANGED
@@ -5,8 +5,11 @@ begin
|
|
5
5
|
class TestDiverWin32 < Test::Unit::TestCase
|
6
6
|
|
7
7
|
def setup
|
8
|
+
Locale.init
|
9
|
+
Locale.clear_all
|
8
10
|
ENV["LC_ALL"] = nil
|
9
11
|
ENV["LC_CTYPE"] = nil
|
12
|
+
ENV["LC_MESSAGES"] = nil
|
10
13
|
ENV["LANG"] = nil
|
11
14
|
ENV["LANGUAGE"] = nil
|
12
15
|
Locale::Driver::Win32.set_thread_locale_id(nil)
|
@@ -56,7 +59,8 @@ begin
|
|
56
59
|
assert_equal "CP932", Locale::Driver::Win32.charset
|
57
60
|
|
58
61
|
ENV["LC_ALL"] = "C"
|
59
|
-
|
62
|
+
Locale::Driver::Win32.set_thread_locale_id(0x0409)
|
63
|
+
assert_equal Locale::Tag::Common.parse("en_US"), Locale::Driver::Win32.locales[0]
|
60
64
|
assert_equal "CP1252", Locale::Driver::Win32.charset
|
61
65
|
end
|
62
66
|
end
|
metadata
CHANGED
@@ -1,30 +1,15 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
- Masao Mutoh
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2024-03-18 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rake
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
13
|
- !ruby/object:Gem::Dependency
|
29
14
|
name: bundler
|
30
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,7 +25,7 @@ dependencies:
|
|
40
25
|
- !ruby/object:Gem::Version
|
41
26
|
version: '0'
|
42
27
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
28
|
+
name: kramdown
|
44
29
|
requirement: !ruby/object:Gem::Requirement
|
45
30
|
requirements:
|
46
31
|
- - ">="
|
@@ -54,7 +39,7 @@ dependencies:
|
|
54
39
|
- !ruby/object:Gem::Version
|
55
40
|
version: '0'
|
56
41
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
42
|
+
name: rake
|
58
43
|
requirement: !ruby/object:Gem::Requirement
|
59
44
|
requirements:
|
60
45
|
- - ">="
|
@@ -82,7 +67,7 @@ dependencies:
|
|
82
67
|
- !ruby/object:Gem::Version
|
83
68
|
version: '0'
|
84
69
|
- !ruby/object:Gem::Dependency
|
85
|
-
name: test-unit-
|
70
|
+
name: test-unit-rr
|
86
71
|
requirement: !ruby/object:Gem::Requirement
|
87
72
|
requirements:
|
88
73
|
- - ">="
|
@@ -96,7 +81,7 @@ dependencies:
|
|
96
81
|
- !ruby/object:Gem::Version
|
97
82
|
version: '0'
|
98
83
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
84
|
+
name: yard
|
100
85
|
requirement: !ruby/object:Gem::Requirement
|
101
86
|
requirements:
|
102
87
|
- - ">="
|
@@ -175,7 +160,6 @@ licenses:
|
|
175
160
|
- Ruby
|
176
161
|
- LGPLv3+
|
177
162
|
metadata: {}
|
178
|
-
post_install_message:
|
179
163
|
rdoc_options: []
|
180
164
|
require_paths:
|
181
165
|
- lib
|
@@ -190,18 +174,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
174
|
- !ruby/object:Gem::Version
|
191
175
|
version: '0'
|
192
176
|
requirements: []
|
193
|
-
|
194
|
-
rubygems_version: 2.7.6.2
|
195
|
-
signing_key:
|
177
|
+
rubygems_version: 3.6.0.dev
|
196
178
|
specification_version: 4
|
197
179
|
summary: Ruby-Locale is the pure ruby library which provides basic APIs for localization.
|
198
180
|
test_files:
|
199
|
-
- test/
|
200
|
-
- test/test_driver_win32.rb
|
201
|
-
- test/test_tag.rb
|
202
|
-
- test/test_thread.rb
|
203
|
-
- test/test_taglist.rb
|
181
|
+
- test/test_detect_cgi.rb
|
204
182
|
- test/test_detect_general.rb
|
205
183
|
- test/test_driver_jruby.rb
|
184
|
+
- test/test_driver_win32.rb
|
206
185
|
- test/test_info.rb
|
207
|
-
- test/
|
186
|
+
- test/test_locale.rb
|
187
|
+
- test/test_tag.rb
|
188
|
+
- test/test_taglist.rb
|
189
|
+
- test/test_thread.rb
|