awesome_translations 0.0.56 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awesome_translations/erb_inspector.rb +1 -1
- data/lib/awesome_translations/erb_inspector/file_inspector.rb +3 -3
- data/lib/awesome_translations/version.rb +1 -1
- data/spec/dummy/app/assets/javascripts/translations.js +1 -0
- data/spec/lib/erb_inspector/file_inspector_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b94ef91440571e20b5449c6ee2cbcde310a1a6f
|
4
|
+
data.tar.gz: 1e7a3cbe89d9fe1b2a93d6368bcbdcf4f8ba4c6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0178ff4789c64a1a567e2c1f19f3e658fe7654b12f3a7ce39b588e261116473892673bb0ecf5edb4b10d61d96a1315855391f8bc20ecb6aa4d2e0bc17d45234
|
7
|
+
data.tar.gz: 48e1da2055e05f3d8052f831e07bce331e0b774fe9e7879381479bb9fa693d9985d953c873760ec36444c7f91dba59620f1fc6a8a0b9464f1b4e963a54f6c8df
|
@@ -4,7 +4,7 @@ class AwesomeTranslations::ErbInspector
|
|
4
4
|
|
5
5
|
def initialize(args = {})
|
6
6
|
@args = args
|
7
|
-
@args[:exts] ||= [".erb", ".haml", ".liquid", ".markerb", ".rb", ".rake", ".slim"
|
7
|
+
@args[:exts] ||= [".erb", ".haml", ".liquid", ".markerb", ".rb", ".rake", ".slim"] + AwesomeTranslations::ErbInspector::FileInspector::JS_FILE_EXTS
|
8
8
|
|
9
9
|
@dirs = @args[:dirs] || AwesomeTranslations.config.paths_to_translate
|
10
10
|
@ignored_folders = @args[:ignored_folders] || AwesomeTranslations.config.ignored_paths
|
@@ -68,11 +68,11 @@ private
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def parse_content_js(line_no, line, translations_found, yielder)
|
71
|
-
line.scan(
|
72
|
-
add_translation(line_no, "I18n.t", match[0], translations_found, yielder)
|
71
|
+
line.scan(/I18n\.t\('(.+?)'\s*(\)|,)/) do |match|
|
72
|
+
add_translation(line_no, "I18n-js.t", match[0], translations_found, yielder)
|
73
73
|
end
|
74
74
|
|
75
|
-
line.scan(
|
75
|
+
line.scan(/I18n\.t\("(.+?)"\s*(\)|,)/) do |match|
|
76
76
|
add_translation(line_no, "I18n-js.t", match[0], translations_found, yielder)
|
77
77
|
end
|
78
78
|
end
|
@@ -29,6 +29,7 @@ describe AwesomeTranslations::ErbInspector::FileInspector do
|
|
29
29
|
|
30
30
|
expect(translation_full_keys).to include "assets.javascripts.translations.hello_world"
|
31
31
|
expect(translation_full_keys).to include "javascripts.absolute.key"
|
32
|
+
expect(translation_full_keys).to include "javascripts.absolute.key_with_args"
|
32
33
|
end
|
33
34
|
|
34
35
|
it "finds liquid translations" do
|
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.57
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-record-transactioner
|