locale 2.1.3 → 2.1.5
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/Gemfile +5 -3
- data/README.rdoc +2 -2
- data/Rakefile +10 -0
- data/doc/text/news.md +33 -0
- data/lib/locale/driver/cgi.rb +2 -2
- data/lib/locale/version.rb +2 -2
- data/locale.gemspec +9 -7
- 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 +16 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea043b37569ec2c019a79b2cf1d2fd4ce0f256308daaeda3a259eeb7f8d869b4
|
|
4
|
+
data.tar.gz: 0bb4a49a48d2cbca4ec05b43a79c12e04589dee9dfd6abae8ec686505f7b1243
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 512abd837c157acfb55cfe4cf475a24f9a15624b7098b5302122eb2c96976cc871fc10078093f003bee6d4d838cba4c349b5170de0a1bb9e82a8b7e12d78a3ee
|
|
7
|
+
data.tar.gz: 1c61aabaa944ee2d45385d3840c916a0835531e20381f76454c207efa6af7839bc68d3b265eb28c396d0d42ce112bdd008df82f13f3828cb8e634a711754a4d2
|
data/Gemfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# -*-
|
|
1
|
+
# -*- ruby -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012 Kouhei
|
|
3
|
+
# Copyright (C) 2012-2026 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
#
|
|
5
5
|
# License: Ruby's or LGPL
|
|
6
6
|
#
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
# You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
|
|
20
|
-
source
|
|
20
|
+
source 'https://rubygems.org'
|
|
21
21
|
|
|
22
22
|
gemspec
|
|
23
|
+
|
|
24
|
+
gem "cgi"
|
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/Rakefile
CHANGED
|
@@ -41,3 +41,13 @@ task :test do
|
|
|
41
41
|
options = ARGV - Rake.application.top_level_tasks
|
|
42
42
|
ruby("test/run-test.rb", *options)
|
|
43
43
|
end
|
|
44
|
+
|
|
45
|
+
release_task = Rake.application["release"]
|
|
46
|
+
# We use Trusted Publishing.
|
|
47
|
+
release_task.prerequisites.delete("build")
|
|
48
|
+
release_task.prerequisites.delete("release:rubygem_push")
|
|
49
|
+
release_task_comment = release_task.comment
|
|
50
|
+
if release_task_comment
|
|
51
|
+
release_task.clear_comments
|
|
52
|
+
release_task.comment = release_task_comment.gsub(/ and build.*$/, "")
|
|
53
|
+
end
|
data/doc/text/news.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# News
|
|
2
2
|
|
|
3
|
+
## 2.1.5: 2026-02-25
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
* Use SPDX license identifier in gemspec.
|
|
8
|
+
* GH-18
|
|
9
|
+
* Patch by Dan Čermák
|
|
10
|
+
|
|
11
|
+
* Add Fiddle as a runtime dependency for Ruby 4.0. Ruby 4.0 or later
|
|
12
|
+
doesn't ship Fiddle as a default gem.
|
|
13
|
+
* GH-19
|
|
14
|
+
* GH-20
|
|
15
|
+
* Reported by Mamoru TASAKA
|
|
16
|
+
|
|
17
|
+
### Thanks
|
|
18
|
+
|
|
19
|
+
* Dan Čermák
|
|
20
|
+
* Mamoru TASAKA
|
|
21
|
+
|
|
22
|
+
## 2.1.4: 2024-03-18
|
|
23
|
+
|
|
24
|
+
### Fixes
|
|
25
|
+
|
|
26
|
+
* `Locale::Middleware`: Fixed a bug that `lang` cookie and
|
|
27
|
+
`Accept-Language`/`Accept-Charset` HTTP headers never used.
|
|
28
|
+
* GH-15
|
|
29
|
+
* GH-16
|
|
30
|
+
* Patch by OZAWA Sakuro
|
|
31
|
+
|
|
32
|
+
### Thanks
|
|
33
|
+
|
|
34
|
+
* OZAWA Sakuro
|
|
35
|
+
|
|
3
36
|
## <a id="2-1-3">2.1.3</a>: 2020-02-12
|
|
4
37
|
|
|
5
38
|
### 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-2026 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.5"
|
|
12
12
|
end
|
|
13
13
|
|
data/locale.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# -*- mode: ruby
|
|
1
|
+
# -*- mode: ruby -*-
|
|
2
2
|
#
|
|
3
|
-
# Copyright (C) 2012-
|
|
3
|
+
# Copyright (C) 2012-2026 Sutou Kouhei <kou@clear-code.com>
|
|
4
4
|
# Copyright (C) 2009 Masao Mutoh
|
|
5
5
|
#
|
|
6
6
|
# License: Ruby's or LGPL
|
|
@@ -32,7 +32,7 @@ Ruby-Locale is the pure ruby library which provides basic APIs for localization.
|
|
|
32
32
|
s.authors = ["Kouhei Sutou", "Masao Mutoh"]
|
|
33
33
|
s.email = ["kou@clear-code.com", "mutomasa at gmail.com"]
|
|
34
34
|
s.homepage = "https://github.com/ruby-gettext/locale"
|
|
35
|
-
s.licenses = ["Ruby", "
|
|
35
|
+
s.licenses = ["Ruby", "LGPL-3.0-or-later"]
|
|
36
36
|
s.require_paths = ["lib"]
|
|
37
37
|
Dir.chdir(base_dir) do
|
|
38
38
|
s.files = Dir.glob("{lib,samples}/**/*").find_all do |path|
|
|
@@ -44,11 +44,13 @@ 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
|
-
|
|
47
|
+
# This is needed only for Windows.
|
|
48
|
+
s.add_dependency("fiddle")
|
|
49
|
+
|
|
48
50
|
s.add_development_dependency("bundler")
|
|
49
|
-
s.add_development_dependency("
|
|
50
|
-
s.add_development_dependency("
|
|
51
|
+
s.add_development_dependency("kramdown")
|
|
52
|
+
s.add_development_dependency("rake")
|
|
51
53
|
s.add_development_dependency("test-unit")
|
|
52
|
-
s.add_development_dependency("test-unit-notify")
|
|
53
54
|
s.add_development_dependency("test-unit-rr")
|
|
55
|
+
s.add_development_dependency("yard")
|
|
54
56
|
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,24 +1,23 @@
|
|
|
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.5
|
|
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: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
|
-
name:
|
|
14
|
+
name: fiddle
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
16
|
requirements:
|
|
18
17
|
- - ">="
|
|
19
18
|
- !ruby/object:Gem::Version
|
|
20
19
|
version: '0'
|
|
21
|
-
type: :
|
|
20
|
+
type: :runtime
|
|
22
21
|
prerelease: false
|
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
23
|
requirements:
|
|
@@ -40,7 +39,7 @@ dependencies:
|
|
|
40
39
|
- !ruby/object:Gem::Version
|
|
41
40
|
version: '0'
|
|
42
41
|
- !ruby/object:Gem::Dependency
|
|
43
|
-
name:
|
|
42
|
+
name: kramdown
|
|
44
43
|
requirement: !ruby/object:Gem::Requirement
|
|
45
44
|
requirements:
|
|
46
45
|
- - ">="
|
|
@@ -54,7 +53,7 @@ dependencies:
|
|
|
54
53
|
- !ruby/object:Gem::Version
|
|
55
54
|
version: '0'
|
|
56
55
|
- !ruby/object:Gem::Dependency
|
|
57
|
-
name:
|
|
56
|
+
name: rake
|
|
58
57
|
requirement: !ruby/object:Gem::Requirement
|
|
59
58
|
requirements:
|
|
60
59
|
- - ">="
|
|
@@ -82,7 +81,7 @@ dependencies:
|
|
|
82
81
|
- !ruby/object:Gem::Version
|
|
83
82
|
version: '0'
|
|
84
83
|
- !ruby/object:Gem::Dependency
|
|
85
|
-
name: test-unit-
|
|
84
|
+
name: test-unit-rr
|
|
86
85
|
requirement: !ruby/object:Gem::Requirement
|
|
87
86
|
requirements:
|
|
88
87
|
- - ">="
|
|
@@ -96,7 +95,7 @@ dependencies:
|
|
|
96
95
|
- !ruby/object:Gem::Version
|
|
97
96
|
version: '0'
|
|
98
97
|
- !ruby/object:Gem::Dependency
|
|
99
|
-
name:
|
|
98
|
+
name: yard
|
|
100
99
|
requirement: !ruby/object:Gem::Requirement
|
|
101
100
|
requirements:
|
|
102
101
|
- - ">="
|
|
@@ -173,9 +172,8 @@ files:
|
|
|
173
172
|
homepage: https://github.com/ruby-gettext/locale
|
|
174
173
|
licenses:
|
|
175
174
|
- Ruby
|
|
176
|
-
-
|
|
175
|
+
- LGPL-3.0-or-later
|
|
177
176
|
metadata: {}
|
|
178
|
-
post_install_message:
|
|
179
177
|
rdoc_options: []
|
|
180
178
|
require_paths:
|
|
181
179
|
- lib
|
|
@@ -190,18 +188,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
190
188
|
- !ruby/object:Gem::Version
|
|
191
189
|
version: '0'
|
|
192
190
|
requirements: []
|
|
193
|
-
|
|
194
|
-
rubygems_version: 2.7.6.2
|
|
195
|
-
signing_key:
|
|
191
|
+
rubygems_version: 4.0.3
|
|
196
192
|
specification_version: 4
|
|
197
193
|
summary: Ruby-Locale is the pure ruby library which provides basic APIs for localization.
|
|
198
194
|
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
|
|
195
|
+
- test/test_detect_cgi.rb
|
|
204
196
|
- test/test_detect_general.rb
|
|
205
197
|
- test/test_driver_jruby.rb
|
|
198
|
+
- test/test_driver_win32.rb
|
|
206
199
|
- test/test_info.rb
|
|
207
|
-
- test/
|
|
200
|
+
- test/test_locale.rb
|
|
201
|
+
- test/test_tag.rb
|
|
202
|
+
- test/test_taglist.rb
|
|
203
|
+
- test/test_thread.rb
|