sinatra-r18n 3.2.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/sinatra-r18n.gemspec +1 -1
- data/spec/sinatra-r18n_spec.rb +24 -4
- data/spec/spec_helper.rb +0 -4
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7358e3bfc46da5f9f15e6d3663ca8b496c6100f5283f1f2aa24bf23ef7d32672
|
4
|
+
data.tar.gz: ae3dd8a8748aff652ff16f02b340bf1d42780da0abdcd2fb173e01a18367909b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b65bce01688a86729354ce43c0d16593a58cc79f618036981f374baead9925f88bd32afbf7a8ed0ee0e7eae45ec5260b97808784374659fce02bb9f4c7b2e18
|
7
|
+
data.tar.gz: fba147d2329880e2a2bcacea0a26e189d82f48c8a60cbf3ad6624b4327301164f8b7694d5a3b572b245ffcb41629b83dafa41d86db64a169a2e53499a4347945
|
data/README.md
CHANGED
@@ -101,8 +101,8 @@ R18n.default_places { './translations' }
|
|
101
101
|
# License
|
102
102
|
|
103
103
|
R18n is licensed under the GNU Lesser General Public License version 3.
|
104
|
-
You can read it in LICENSE file or in
|
104
|
+
You can read it in LICENSE file or in [www.gnu.org/licenses/lgpl-3.0.html](https://www.gnu.org/licenses/lgpl-3.0.html).
|
105
105
|
|
106
106
|
# Author
|
107
107
|
|
108
|
-
Andrey “A.I.” Sitnik
|
108
|
+
Andrey “A.I.” Sitnik [andrey@sitnik.ru](mailto:andrey@sitnik.ru)
|
data/sinatra-r18n.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
|
26
26
|
s.author = 'Andrey Sitnik'
|
27
27
|
s.email = 'andrey@sitnik.ru'
|
28
|
-
s.homepage = 'https://github.com/
|
28
|
+
s.homepage = 'https://github.com/r18n/r18n/tree/master/sinatra-r18n'
|
29
29
|
s.license = 'LGPL-3.0'
|
30
30
|
|
31
31
|
s.add_dependency 'r18n-core', "= #{R18n::VERSION}"
|
data/spec/sinatra-r18n_spec.rb
CHANGED
@@ -29,10 +29,30 @@ describe Sinatra::R18n do
|
|
29
29
|
expect(last_response.body).to eq 'Русский'
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
describe 'autodetect user locale' do
|
33
|
+
it 'works with regular' do
|
34
|
+
get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'ru,en;q=0.9'
|
35
|
+
expect(last_response).to be_ok
|
36
|
+
expect(last_response.body).to eq 'Русский'
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'works with only wildcard' do
|
40
|
+
get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => '*'
|
41
|
+
expect(last_response).to be_ok
|
42
|
+
expect(last_response.body).to eq 'English'
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'works with only regular and wildcard' do
|
46
|
+
get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'ru, en;q=0.9, *;q=0.5'
|
47
|
+
expect(last_response).to be_ok
|
48
|
+
expect(last_response.body).to eq 'Русский'
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'works with non-ISO code' do
|
52
|
+
get '/locale', {}, 'HTTP_ACCEPT_LANGUAGE' => 'Русский'
|
53
|
+
expect(last_response).to be_ok
|
54
|
+
expect(last_response.body).to eq 'English'
|
55
|
+
end
|
36
56
|
end
|
37
57
|
|
38
58
|
it 'uses locale from param' do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-r18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: r18n-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sinatra
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -70,7 +70,7 @@ files:
|
|
70
70
|
- spec/app/views/post.erb
|
71
71
|
- spec/sinatra-r18n_spec.rb
|
72
72
|
- spec/spec_helper.rb
|
73
|
-
homepage: https://github.com/
|
73
|
+
homepage: https://github.com/r18n/r18n/tree/master/sinatra-r18n
|
74
74
|
licenses:
|
75
75
|
- LGPL-3.0
|
76
76
|
metadata: {}
|
@@ -89,8 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
requirements: []
|
92
|
-
|
93
|
-
rubygems_version: 2.7.6
|
92
|
+
rubygems_version: 3.1.2
|
94
93
|
signing_key:
|
95
94
|
specification_version: 4
|
96
95
|
summary: A Sinatra extension that provides i18n support
|