i18n_screwdriver 9.2 → 9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/Gemfile.lock +79 -70
- data/app/assets/javascrips/i18n_screwdriver/config.coffee +2 -0
- data/app/assets/javascrips/i18n_screwdriver/screw.coffee +1 -1
- data/i18n_screwdriver.gemspec +1 -0
- data/lib/i18n_screwdriver.rb +4 -3
- data/lib/i18n_screwdriver/version.rb +1 -1
- data/spec/i18n_screwdriver_spec.rb +16 -0
- data/spec/locales/en.yml +3 -0
- data/spec/locales/it.yml +3 -0
- data/spec/spec_helper.rb +3 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 494976232d84a1a9b9e5e5f5375ccd27b10d5c91
|
4
|
+
data.tar.gz: 9ec2f827751a5874ba7abced143d3294c6aa8c9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89755396a9bed8a473915f250f0f40af1566a6a0dc895bb0b76e31875ecffdc3ba1a2f1201002ee55310e0cb7b25baf90515dd9dc375a02da3029f3f6468b45c
|
7
|
+
data.tar.gz: fecced1456e6fabdffe71161ade76c9ed11d226da61e5f5cbf0ca4e6edd6f4ed28a1e8508874c651dd5938e3ef08e2a6bc07e9fc832488b4ac56436a739a711e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,93 +1,98 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
i18n_screwdriver (9.
|
4
|
+
i18n_screwdriver (9.3)
|
5
5
|
rails (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
actionpack (=
|
12
|
-
|
13
|
-
|
10
|
+
actioncable (5.0.2)
|
11
|
+
actionpack (= 5.0.2)
|
12
|
+
nio4r (>= 1.2, < 3.0)
|
13
|
+
websocket-driver (~> 0.6.1)
|
14
|
+
actionmailer (5.0.2)
|
15
|
+
actionpack (= 5.0.2)
|
16
|
+
actionview (= 5.0.2)
|
17
|
+
activejob (= 5.0.2)
|
14
18
|
mail (~> 2.5, >= 2.5.4)
|
15
|
-
rails-dom-testing (~>
|
16
|
-
actionpack (
|
17
|
-
actionview (=
|
18
|
-
activesupport (=
|
19
|
-
rack (~>
|
20
|
-
rack-test (~> 0.6.
|
21
|
-
rails-dom-testing (~>
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
actionpack (5.0.2)
|
21
|
+
actionview (= 5.0.2)
|
22
|
+
activesupport (= 5.0.2)
|
23
|
+
rack (~> 2.0)
|
24
|
+
rack-test (~> 0.6.3)
|
25
|
+
rails-dom-testing (~> 2.0)
|
22
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
23
|
-
actionview (
|
24
|
-
activesupport (=
|
27
|
+
actionview (5.0.2)
|
28
|
+
activesupport (= 5.0.2)
|
25
29
|
builder (~> 3.1)
|
26
30
|
erubis (~> 2.7.0)
|
27
|
-
rails-dom-testing (~>
|
28
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
29
|
-
activejob (
|
30
|
-
activesupport (=
|
31
|
-
globalid (>= 0.3.
|
32
|
-
activemodel (
|
33
|
-
activesupport (=
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.0.2)
|
34
|
+
activesupport (= 5.0.2)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.0.2)
|
37
|
+
activesupport (= 5.0.2)
|
38
|
+
activerecord (5.0.2)
|
39
|
+
activemodel (= 5.0.2)
|
40
|
+
activesupport (= 5.0.2)
|
41
|
+
arel (~> 7.0)
|
42
|
+
activesupport (5.0.2)
|
43
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
40
44
|
i18n (~> 0.7)
|
41
|
-
json (~> 1.7, >= 1.7.7)
|
42
45
|
minitest (~> 5.1)
|
43
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
44
46
|
tzinfo (~> 1.1)
|
45
|
-
arel (
|
46
|
-
builder (3.2.
|
47
|
-
|
47
|
+
arel (7.1.4)
|
48
|
+
builder (3.2.3)
|
49
|
+
byebug (9.0.6)
|
50
|
+
concurrent-ruby (1.0.5)
|
48
51
|
diff-lcs (1.2.5)
|
49
52
|
erubis (2.7.0)
|
50
|
-
globalid (0.
|
51
|
-
activesupport (>= 4.
|
52
|
-
i18n (0.
|
53
|
-
json (1.8.3)
|
53
|
+
globalid (0.4.0)
|
54
|
+
activesupport (>= 4.2.0)
|
55
|
+
i18n (0.8.1)
|
54
56
|
loofah (2.0.3)
|
55
57
|
nokogiri (>= 1.5.9)
|
56
|
-
mail (2.6.
|
57
|
-
mime-types (>= 1.16, <
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
mail (2.6.4)
|
59
|
+
mime-types (>= 1.16, < 4)
|
60
|
+
method_source (0.8.2)
|
61
|
+
mime-types (3.1)
|
62
|
+
mime-types-data (~> 3.2015)
|
63
|
+
mime-types-data (3.2016.0521)
|
64
|
+
mini_portile2 (2.1.0)
|
65
|
+
minitest (5.10.1)
|
66
|
+
nio4r (2.0.0)
|
67
|
+
nokogiri (1.7.1)
|
68
|
+
mini_portile2 (~> 2.1.0)
|
69
|
+
rack (2.0.1)
|
64
70
|
rack-test (0.6.3)
|
65
71
|
rack (>= 1.0)
|
66
|
-
rails (
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
rails (5.0.2)
|
73
|
+
actioncable (= 5.0.2)
|
74
|
+
actionmailer (= 5.0.2)
|
75
|
+
actionpack (= 5.0.2)
|
76
|
+
actionview (= 5.0.2)
|
77
|
+
activejob (= 5.0.2)
|
78
|
+
activemodel (= 5.0.2)
|
79
|
+
activerecord (= 5.0.2)
|
80
|
+
activesupport (= 5.0.2)
|
74
81
|
bundler (>= 1.3.0, < 2.0)
|
75
|
-
railties (=
|
76
|
-
sprockets-rails
|
77
|
-
rails-
|
78
|
-
activesupport (>= 4.2.0.
|
79
|
-
|
80
|
-
activesupport (>= 4.2.0.beta, < 5.0)
|
81
|
-
nokogiri (~> 1.6.0)
|
82
|
-
rails-deprecated_sanitizer (>= 1.0.1)
|
82
|
+
railties (= 5.0.2)
|
83
|
+
sprockets-rails (>= 2.0.0)
|
84
|
+
rails-dom-testing (2.0.2)
|
85
|
+
activesupport (>= 4.2.0, < 6.0)
|
86
|
+
nokogiri (~> 1.6)
|
83
87
|
rails-html-sanitizer (1.0.3)
|
84
88
|
loofah (~> 2.0)
|
85
|
-
railties (
|
86
|
-
actionpack (=
|
87
|
-
activesupport (=
|
89
|
+
railties (5.0.2)
|
90
|
+
actionpack (= 5.0.2)
|
91
|
+
activesupport (= 5.0.2)
|
92
|
+
method_source
|
88
93
|
rake (>= 0.8.7)
|
89
94
|
thor (>= 0.18.1, < 2.0)
|
90
|
-
rake (
|
95
|
+
rake (12.0.0)
|
91
96
|
rspec (3.4.0)
|
92
97
|
rspec-core (~> 3.4.0)
|
93
98
|
rspec-expectations (~> 3.4.0)
|
@@ -101,24 +106,28 @@ GEM
|
|
101
106
|
diff-lcs (>= 1.2.0, < 2.0)
|
102
107
|
rspec-support (~> 3.4.0)
|
103
108
|
rspec-support (3.4.1)
|
104
|
-
sprockets (3.
|
109
|
+
sprockets (3.7.1)
|
105
110
|
concurrent-ruby (~> 1.0)
|
106
111
|
rack (> 1, < 3)
|
107
|
-
sprockets-rails (3.0
|
112
|
+
sprockets-rails (3.2.0)
|
108
113
|
actionpack (>= 4.0)
|
109
114
|
activesupport (>= 4.0)
|
110
115
|
sprockets (>= 3.0.0)
|
111
|
-
thor (0.19.
|
112
|
-
thread_safe (0.3.
|
113
|
-
tzinfo (1.2.
|
116
|
+
thor (0.19.4)
|
117
|
+
thread_safe (0.3.6)
|
118
|
+
tzinfo (1.2.3)
|
114
119
|
thread_safe (~> 0.1)
|
120
|
+
websocket-driver (0.6.5)
|
121
|
+
websocket-extensions (>= 0.1.0)
|
122
|
+
websocket-extensions (0.1.2)
|
115
123
|
|
116
124
|
PLATFORMS
|
117
125
|
ruby
|
118
126
|
|
119
127
|
DEPENDENCIES
|
128
|
+
byebug
|
120
129
|
i18n_screwdriver!
|
121
130
|
rspec
|
122
131
|
|
123
132
|
BUNDLED WITH
|
124
|
-
1.
|
133
|
+
1.12.5
|
data/i18n_screwdriver.gemspec
CHANGED
data/lib/i18n_screwdriver.rb
CHANGED
@@ -10,9 +10,10 @@ module I18nScrewdriver
|
|
10
10
|
File.join("config", "locales", "application.#{locale}.yml")
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.generate_key(
|
14
|
-
|
15
|
-
|
13
|
+
def self.generate_key(source)
|
14
|
+
return ":#{source}" if source.is_a?(Symbol)
|
15
|
+
source = source.strip
|
16
|
+
(source =~ /^:[a-z][a-z0-9_]*$/) ? source : Digest::MD5.hexdigest(source)
|
16
17
|
end
|
17
18
|
|
18
19
|
def self.file_with_translations_exists?(locale)
|
@@ -21,4 +21,20 @@ describe I18nScrewdriver do
|
|
21
21
|
expect(I18nScrewdriver.grab_js_texts_to_be_translated(%|=I18n.screw(`Hi %{name}!`, name: "gucki")|)).to eq(["Hi %{name}!"])
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
describe "translates (oh really?)" do
|
26
|
+
before do
|
27
|
+
I18n.locale = :en
|
28
|
+
end
|
29
|
+
it "translate a string" do
|
30
|
+
expect(I18nScrewdriver.translate("good morning")).to eq("good morning")
|
31
|
+
I18n.locale = :it
|
32
|
+
expect(I18nScrewdriver.translate("good morning")).to eq("buongiorno")
|
33
|
+
end
|
34
|
+
it "translate a symbol" do
|
35
|
+
expect(I18nScrewdriver.translate(:intro_text)).to eq("a long intro text")
|
36
|
+
I18n.locale = :it
|
37
|
+
expect(I18nScrewdriver.translate(:intro_text)).to eq("un lungo testo introduttivo")
|
38
|
+
end
|
39
|
+
end
|
24
40
|
end
|
data/spec/locales/en.yml
ADDED
data/spec/locales/it.yml
ADDED
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
require "bundler/setup"
|
2
2
|
Bundler.setup
|
3
3
|
|
4
|
+
require 'byebug'
|
4
5
|
require "i18n_screwdriver"
|
5
6
|
|
7
|
+
%w[en it].each {|locale| I18n.load_path << File.expand_path("../locales/#{locale}.yml", __FILE__) }
|
8
|
+
|
6
9
|
RSpec.configure do |config|
|
7
10
|
# some (optional) config here
|
8
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_screwdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '9.
|
4
|
+
version: '9.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Miesel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -25,6 +25,20 @@ dependencies:
|
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: byebug
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
28
42
|
- !ruby/object:Gem::Dependency
|
29
43
|
name: rails
|
30
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,8 @@ files:
|
|
66
80
|
- lib/i18n_screwdriver/version.rb
|
67
81
|
- lib/tasks/i18n.rake
|
68
82
|
- spec/i18n_screwdriver_spec.rb
|
83
|
+
- spec/locales/en.yml
|
84
|
+
- spec/locales/it.yml
|
69
85
|
- spec/spec_helper.rb
|
70
86
|
homepage: https://github.com/agileapplications/i18n_screwdriver
|
71
87
|
licenses:
|
@@ -87,10 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
103
|
version: '0'
|
88
104
|
requirements: []
|
89
105
|
rubyforge_project: i18n_screwdriver
|
90
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.6.6
|
91
107
|
signing_key:
|
92
108
|
specification_version: 4
|
93
109
|
summary: make translating with rails i18n fun again
|
94
|
-
test_files:
|
95
|
-
- spec/i18n_screwdriver_spec.rb
|
96
|
-
- spec/spec_helper.rb
|
110
|
+
test_files: []
|