i18n_helper 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +116 -93
- data/README.md +20 -2
- data/UPGRADE.md +19 -0
- data/app/controllers/locales_controller.rb +0 -2
- data/i18n_helper.gemspec +4 -4
- data/lib/i18n_helper/version.rb +1 -1
- data/spec/helpers/locales_helper_spec.rb +3 -3
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 459428248d080b68b903be47e76409adda393316
|
4
|
+
data.tar.gz: 5bb8d6aaae87d3f5de5591e6ed6684949428925d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baaf8c3ea63d8e4f4191eb469d9fb1737864705905e4cf7d8572a0b4beb41bedf9b9c8cde99847e9c4678b3a850a828d84e388c8311178d4611add7dc8444913
|
7
|
+
data.tar.gz: 3f77ce5c5e5a92482b57edea51d5045791d2b070b7795d568f0d43f4dc828490eb6055cf3772e24c18d79470f27465f6f44d7f36149e03761d837514ca2d99c2
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
i18n_helper
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,140 +1,163 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
i18n_helper (0.0.
|
4
|
+
i18n_helper (0.0.4)
|
5
5
|
i18n-language-translations (~> 0.0)
|
6
|
-
rails (~> 4.
|
6
|
+
rails (~> 4.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionmailer (4.
|
12
|
-
actionpack (= 4.
|
13
|
-
actionview (= 4.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
actionmailer (4.2.4)
|
12
|
+
actionpack (= 4.2.4)
|
13
|
+
actionview (= 4.2.4)
|
14
|
+
activejob (= 4.2.4)
|
15
|
+
mail (~> 2.5, >= 2.5.4)
|
16
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
17
|
+
actionpack (4.2.4)
|
18
|
+
actionview (= 4.2.4)
|
19
|
+
activesupport (= 4.2.4)
|
20
|
+
rack (~> 1.6)
|
19
21
|
rack-test (~> 0.6.2)
|
20
|
-
|
21
|
-
|
22
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
23
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
24
|
+
actionview (4.2.4)
|
25
|
+
activesupport (= 4.2.4)
|
22
26
|
builder (~> 3.1)
|
23
27
|
erubis (~> 2.7.0)
|
24
|
-
|
25
|
-
|
28
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
29
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
30
|
+
activejob (4.2.4)
|
31
|
+
activesupport (= 4.2.4)
|
32
|
+
globalid (>= 0.3.0)
|
33
|
+
activemodel (4.2.4)
|
34
|
+
activesupport (= 4.2.4)
|
26
35
|
builder (~> 3.1)
|
27
|
-
activerecord (4.
|
28
|
-
activemodel (= 4.
|
29
|
-
activesupport (= 4.
|
30
|
-
arel (~>
|
31
|
-
activesupport (4.
|
32
|
-
i18n (~> 0.
|
36
|
+
activerecord (4.2.4)
|
37
|
+
activemodel (= 4.2.4)
|
38
|
+
activesupport (= 4.2.4)
|
39
|
+
arel (~> 6.0)
|
40
|
+
activesupport (4.2.4)
|
41
|
+
i18n (~> 0.7)
|
33
42
|
json (~> 1.7, >= 1.7.7)
|
34
43
|
minitest (~> 5.1)
|
35
|
-
thread_safe (~> 0.
|
44
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
36
45
|
tzinfo (~> 1.1)
|
37
|
-
arel (
|
46
|
+
arel (6.0.3)
|
38
47
|
builder (3.2.2)
|
39
|
-
coveralls (0.
|
40
|
-
|
41
|
-
rest-client
|
42
|
-
simplecov (
|
43
|
-
term-ansicolor
|
44
|
-
thor
|
48
|
+
coveralls (0.8.2)
|
49
|
+
json (~> 1.8)
|
50
|
+
rest-client (>= 1.6.8, < 2)
|
51
|
+
simplecov (~> 0.10.0)
|
52
|
+
term-ansicolor (~> 1.3)
|
53
|
+
thor (~> 0.19.1)
|
45
54
|
diff-lcs (1.2.5)
|
46
55
|
docile (1.1.5)
|
56
|
+
domain_name (0.5.24)
|
57
|
+
unf (>= 0.0.5, < 1.0.0)
|
47
58
|
erubis (2.7.0)
|
48
|
-
factory_girl (4.
|
59
|
+
factory_girl (4.5.0)
|
49
60
|
activesupport (>= 3.0.0)
|
50
|
-
factory_girl_rails (4.
|
51
|
-
factory_girl (~> 4.
|
61
|
+
factory_girl_rails (4.5.0)
|
62
|
+
factory_girl (~> 4.5.0)
|
52
63
|
railties (>= 3.0.0)
|
53
|
-
gemnasium (3.2.
|
54
|
-
|
55
|
-
|
64
|
+
gemnasium (3.2.1)
|
65
|
+
globalid (0.3.6)
|
66
|
+
activesupport (>= 4.1.0)
|
67
|
+
http-cookie (1.0.2)
|
68
|
+
domain_name (~> 0.5)
|
69
|
+
i18n (0.7.0)
|
56
70
|
i18n-language-translations (0.0.2)
|
57
71
|
i18n (~> 0.5)
|
58
72
|
railties (>= 3.0.0)
|
59
|
-
json (1.8.
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
73
|
+
json (1.8.3)
|
74
|
+
loofah (2.0.3)
|
75
|
+
nokogiri (>= 1.5.9)
|
76
|
+
mail (2.6.3)
|
77
|
+
mime-types (>= 1.16, < 3)
|
78
|
+
mime-types (2.6.2)
|
79
|
+
mini_portile (0.6.2)
|
80
|
+
minitest (5.8.0)
|
81
|
+
netrc (0.10.3)
|
82
|
+
nokogiri (1.6.6.2)
|
83
|
+
mini_portile (~> 0.6.0)
|
84
|
+
rack (1.6.4)
|
85
|
+
rack-test (0.6.3)
|
70
86
|
rack (>= 1.0)
|
71
|
-
rails (4.
|
72
|
-
actionmailer (= 4.
|
73
|
-
actionpack (= 4.
|
74
|
-
actionview (= 4.
|
75
|
-
|
76
|
-
|
77
|
-
|
87
|
+
rails (4.2.4)
|
88
|
+
actionmailer (= 4.2.4)
|
89
|
+
actionpack (= 4.2.4)
|
90
|
+
actionview (= 4.2.4)
|
91
|
+
activejob (= 4.2.4)
|
92
|
+
activemodel (= 4.2.4)
|
93
|
+
activerecord (= 4.2.4)
|
94
|
+
activesupport (= 4.2.4)
|
78
95
|
bundler (>= 1.3.0, < 2.0)
|
79
|
-
railties (= 4.
|
80
|
-
sprockets-rails
|
81
|
-
|
82
|
-
|
83
|
-
|
96
|
+
railties (= 4.2.4)
|
97
|
+
sprockets-rails
|
98
|
+
rails-deprecated_sanitizer (1.0.3)
|
99
|
+
activesupport (>= 4.2.0.alpha)
|
100
|
+
rails-dom-testing (1.0.7)
|
101
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
102
|
+
nokogiri (~> 1.6.0)
|
103
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
104
|
+
rails-html-sanitizer (1.0.2)
|
105
|
+
loofah (~> 2.0)
|
106
|
+
railties (4.2.4)
|
107
|
+
actionpack (= 4.2.4)
|
108
|
+
activesupport (= 4.2.4)
|
84
109
|
rake (>= 0.8.7)
|
85
110
|
thor (>= 0.18.1, < 2.0)
|
86
|
-
rake (10.
|
87
|
-
rest-client (1.
|
111
|
+
rake (10.4.2)
|
112
|
+
rest-client (1.8.0)
|
113
|
+
http-cookie (>= 1.0.2, < 2.0)
|
88
114
|
mime-types (>= 1.16, < 3.0)
|
89
115
|
netrc (~> 0.7)
|
90
|
-
rspec-core (3.
|
91
|
-
rspec-support (~> 3.
|
92
|
-
rspec-expectations (3.
|
116
|
+
rspec-core (3.3.2)
|
117
|
+
rspec-support (~> 3.3.0)
|
118
|
+
rspec-expectations (3.3.1)
|
93
119
|
diff-lcs (>= 1.2.0, < 2.0)
|
94
|
-
rspec-support (~> 3.
|
95
|
-
rspec-mocks (3.
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
rspec-
|
103
|
-
rspec-
|
104
|
-
rspec-
|
105
|
-
|
106
|
-
|
120
|
+
rspec-support (~> 3.3.0)
|
121
|
+
rspec-mocks (3.3.2)
|
122
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
123
|
+
rspec-support (~> 3.3.0)
|
124
|
+
rspec-rails (3.3.3)
|
125
|
+
actionpack (>= 3.0, < 4.3)
|
126
|
+
activesupport (>= 3.0, < 4.3)
|
127
|
+
railties (>= 3.0, < 4.3)
|
128
|
+
rspec-core (~> 3.3.0)
|
129
|
+
rspec-expectations (~> 3.3.0)
|
130
|
+
rspec-mocks (~> 3.3.0)
|
131
|
+
rspec-support (~> 3.3.0)
|
132
|
+
rspec-support (3.3.0)
|
133
|
+
simplecov (0.10.0)
|
107
134
|
docile (~> 1.1.0)
|
108
|
-
|
109
|
-
simplecov-html (~> 0.
|
110
|
-
simplecov-html (0.
|
111
|
-
sprockets (
|
112
|
-
hike (~> 1.2)
|
113
|
-
multi_json (~> 1.0)
|
135
|
+
json (~> 1.8)
|
136
|
+
simplecov-html (~> 0.10.0)
|
137
|
+
simplecov-html (0.10.0)
|
138
|
+
sprockets (3.3.4)
|
114
139
|
rack (~> 1.0)
|
115
|
-
|
116
|
-
sprockets-rails (2.1.3)
|
140
|
+
sprockets-rails (2.3.3)
|
117
141
|
actionpack (>= 3.0)
|
118
142
|
activesupport (>= 3.0)
|
119
|
-
sprockets (
|
120
|
-
term-ansicolor (1.3.
|
143
|
+
sprockets (>= 2.8, < 4.0)
|
144
|
+
term-ansicolor (1.3.2)
|
121
145
|
tins (~> 1.0)
|
122
146
|
thor (0.19.1)
|
123
|
-
thread_safe (0.3.
|
124
|
-
|
125
|
-
tins (1.3.2)
|
126
|
-
treetop (1.4.15)
|
127
|
-
polyglot
|
128
|
-
polyglot (>= 0.3.1)
|
147
|
+
thread_safe (0.3.5)
|
148
|
+
tins (1.6.0)
|
129
149
|
tzinfo (1.2.2)
|
130
150
|
thread_safe (~> 0.1)
|
151
|
+
unf (0.1.4)
|
152
|
+
unf_ext
|
153
|
+
unf_ext (0.0.7.1)
|
131
154
|
|
132
155
|
PLATFORMS
|
133
156
|
ruby
|
134
157
|
|
135
158
|
DEPENDENCIES
|
136
|
-
coveralls (~> 0.
|
159
|
+
coveralls (~> 0.8)
|
137
160
|
factory_girl_rails (~> 4.4)
|
138
161
|
gemnasium (~> 3.2)
|
139
162
|
i18n_helper!
|
140
|
-
rspec-rails (~> 3.
|
163
|
+
rspec-rails (~> 3.2)
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/joel/i18n_helper.png?branch=master)](https://travis-ci.org/joel/i18n_helper) (Travis CI)
|
6
6
|
|
7
|
-
[![Coverage Status](https://coveralls.io/repos/joel/i18n_helper/badge.png)](https://coveralls.io/r/joel/i18n_helper)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/joel/i18n_helper/badge.png?branch=master)](https://coveralls.io/r/joel/i18n_helper)
|
8
8
|
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/i18n_helper.png)](http://badge.fury.io/rb/i18n_helper)
|
10
10
|
|
@@ -14,6 +14,24 @@ This is a really straightforward I18n locales helper. It can you help to change
|
|
14
14
|
|
15
15
|
![Screenshot](https://f.cloud.github.com/assets/5789/1832468/0ad6491c-73b6-11e3-8f14-3358168ed5ff.png)
|
16
16
|
|
17
|
+
# add callbacks
|
18
|
+
|
19
|
+
If we need to add or skip some callbacks, often skip authentication you can add a initializer on your mother app
|
20
|
+
|
21
|
+
Add `config/initializers/locales.rb`
|
22
|
+
|
23
|
+
```
|
24
|
+
module LocalesControllerCallbacks
|
25
|
+
extend ActiveSupport::Concern
|
26
|
+
|
27
|
+
included do
|
28
|
+
skip_before_action :authenticate_user!
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
LocalesController.send(:include, LocalesControllerCallbacks)
|
33
|
+
```
|
34
|
+
|
17
35
|
## Features
|
18
36
|
|
19
37
|
The locale of app is recorded on current session.
|
@@ -56,4 +74,4 @@ If you use an authentication system, like ```Devise```, and your ```User model``
|
|
56
74
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
57
75
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
58
76
|
4. Push to the branch (`git push origin my-new-feature`)
|
59
|
-
5. Create new Pull Request
|
77
|
+
5. Create new Pull Request
|
data/UPGRADE.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
### VERSION 0.0.3 => 0.0.4
|
2
|
+
|
3
|
+
If you use Devise of callback named verify_authenticity_token we need to add a initializers like
|
4
|
+
|
5
|
+
Add `config/initializers/locales.rb`
|
6
|
+
|
7
|
+
```
|
8
|
+
module LocalesControllerCallbacks
|
9
|
+
extend ActiveSupport::Concern
|
10
|
+
|
11
|
+
included do
|
12
|
+
skip_before_action :verify_authenticity_token
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
LocalesController.send(:include, LocalesControllerCallbacks)
|
17
|
+
```
|
18
|
+
|
19
|
+
Otherwise is ok.
|
data/i18n_helper.gemspec
CHANGED
@@ -22,15 +22,15 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
# s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.rdoc']
|
24
24
|
|
25
|
-
s.add_dependency 'rails', '~> 4.
|
25
|
+
s.add_dependency 'rails', '~> 4.2'
|
26
26
|
s.add_dependency 'i18n-language-translations', '~> 0.0' # 0.0.2 actual
|
27
27
|
|
28
|
-
s.add_development_dependency 'rspec-rails', '~> 3.
|
28
|
+
s.add_development_dependency 'rspec-rails', '~> 3.2'
|
29
29
|
s.add_development_dependency 'factory_girl_rails', '~> 4.4'
|
30
30
|
s.add_development_dependency 'gemnasium', '~> 3.2'
|
31
|
-
s.add_development_dependency 'coveralls', '~> 0.
|
31
|
+
s.add_development_dependency 'coveralls', '~> 0.8'
|
32
32
|
|
33
|
-
s.required_ruby_version = '~> 2.
|
33
|
+
s.required_ruby_version = '~> 2.2'
|
34
34
|
|
35
35
|
s.test_files = Dir['spec/**/*']
|
36
36
|
end
|
data/lib/i18n_helper/version.rb
CHANGED
@@ -54,8 +54,8 @@ describe LocalesHelper do
|
|
54
54
|
context 'en' do
|
55
55
|
let(:data) do
|
56
56
|
[
|
57
|
-
"<a data-method=\"post\" href=\"/locales/en\"
|
58
|
-
"<a data-method=\"post\" href=\"/locales/fr\"
|
57
|
+
"<a rel=\"nofollow\" data-method=\"post\" href=\"/locales/en\">English</a>",
|
58
|
+
"<a rel=\"nofollow\" data-method=\"post\" href=\"/locales/fr\">French</a>"
|
59
59
|
]
|
60
60
|
end
|
61
61
|
it do
|
@@ -67,4 +67,4 @@ describe LocalesHelper do
|
|
67
67
|
|
68
68
|
end
|
69
69
|
|
70
|
-
end
|
70
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel AZEMAR
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '4.
|
19
|
+
version: '4.2'
|
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: '4.
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: i18n-language-translations
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.2'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: factory_girl_rails
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0.
|
89
|
+
version: '0.8'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
96
|
+
version: '0.8'
|
97
97
|
description: Description of I18nHelper.
|
98
98
|
email:
|
99
99
|
- joel.azemar@gmail.com
|
@@ -106,6 +106,8 @@ files:
|
|
106
106
|
- ".coveralls.yml"
|
107
107
|
- ".gitignore"
|
108
108
|
- ".rspec"
|
109
|
+
- ".ruby-gemset"
|
110
|
+
- ".ruby-version"
|
109
111
|
- ".travis.yml"
|
110
112
|
- CHANGELOG.md
|
111
113
|
- Gemfile
|
@@ -113,6 +115,7 @@ files:
|
|
113
115
|
- MIT-LICENSE
|
114
116
|
- README.md
|
115
117
|
- Rakefile
|
118
|
+
- UPGRADE.md
|
116
119
|
- app/controllers/.keep
|
117
120
|
- app/controllers/locales_controller.rb
|
118
121
|
- app/helpers/.keep
|
@@ -181,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
184
|
requirements:
|
182
185
|
- - "~>"
|
183
186
|
- !ruby/object:Gem::Version
|
184
|
-
version: '2.
|
187
|
+
version: '2.2'
|
185
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
189
|
requirements:
|
187
190
|
- - ">="
|
@@ -189,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
192
|
version: '0'
|
190
193
|
requirements: []
|
191
194
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
195
|
+
rubygems_version: 2.4.5.1
|
193
196
|
signing_key:
|
194
197
|
specification_version: 4
|
195
198
|
summary: Summary of I18nHelper.
|