awesome_translations 0.0.46 → 0.0.47
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42ce40ffcca886ee6c5519d96837791db4aa1a26
|
4
|
+
data.tar.gz: f2d48e40304976711c8a7c4bbc32e177584a9111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcb9c89b029d63fe19046218f7861a8358101b755f13e91a4407682d63c8a11796f10b73e9f5bda45b53968e0055d00ed82eaa4e0ede8becca83fdaf5126bcba
|
7
|
+
data.tar.gz: df6597660e6cf0e209a85d2edaa7d36dfc50d43b146fbcce6fb7a03285953259eb4a8db4c9d8edf786f08f822e11315d5573c0e59e329e6db7f0d88d6ca52a64
|
@@ -53,6 +53,14 @@ private
|
|
53
53
|
line.scan(/\'([^\']+?)\'\s+\|\s+t\s*(\%}|\}\})/) do |match|
|
54
54
|
add_translation(line_no, "t", match[0], translations_found, yielder)
|
55
55
|
end
|
56
|
+
|
57
|
+
line.scan(/\"([^\"]+?)\"\s+\|\s+val:\s*\"([^\"]+?)\"\s*,\s*(.+?)\s*\|\s+t\s*/) do |match|
|
58
|
+
add_translation(line_no, "t", match[0], translations_found, yielder)
|
59
|
+
end
|
60
|
+
|
61
|
+
line.scan(/'([^\"]+?)'\s+\|\s+val:\s*'([^\"]+?)'\s*,\s*(.+?)\s*\|\s+t\s*/) do |match|
|
62
|
+
add_translation(line_no, "t", match[0], translations_found, yielder)
|
63
|
+
end
|
56
64
|
end
|
57
65
|
|
58
66
|
def parse_content(line_no, line, translations_found, yielder)
|
@@ -10,6 +10,7 @@ describe AwesomeTranslations::ErbInspector::FileInspector do
|
|
10
10
|
let(:files) { erb_inspector.files.to_a }
|
11
11
|
let(:file_paths) { files.map(&:file_path) }
|
12
12
|
let(:user_index_inspector) { files.find { |file_inspector| file_inspector.file_path == "app/views/users/index.html.haml" } }
|
13
|
+
let(:user_edit_inspector) { files.find { |file_inspector| file_inspector.file_path == "app/views/users/edit.html.liquid" } }
|
13
14
|
let(:user_index_translations) { user_index_inspector.translations.to_a }
|
14
15
|
let(:hello_world_translation) { user_index_translations.find { |translation| translation.key == ".hello_world" } }
|
15
16
|
|
@@ -17,5 +18,14 @@ describe AwesomeTranslations::ErbInspector::FileInspector do
|
|
17
18
|
it "finds the right number of translations" do
|
18
19
|
expect(user_index_translations.length).to eq 3
|
19
20
|
end
|
21
|
+
|
22
|
+
it "finds liquid translations" do
|
23
|
+
translation_keys = user_edit_inspector.translations.map(&:key)
|
24
|
+
|
25
|
+
expect(translation_keys).to include ".edit_user"
|
26
|
+
expect(translation_keys).to include ".test_for_liquid_templates"
|
27
|
+
expect(translation_keys).to include ".test_for_liquid_templates_with_var_double_quotes"
|
28
|
+
expect(translation_keys).to include ".test_for_liquid_templates_with_var_single_quotes"
|
29
|
+
end
|
20
30
|
end
|
21
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_translations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: array_enumerator
|