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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 691783269b3a8692e8aa63371a814da6ef633dcb
4
- data.tar.gz: e4247d560bd742bdbc20fb930611aa230df51763
3
+ metadata.gz: 9b94ef91440571e20b5449c6ee2cbcde310a1a6f
4
+ data.tar.gz: 1e7a3cbe89d9fe1b2a93d6368bcbdcf4f8ba4c6c
5
5
  SHA512:
6
- metadata.gz: f4ba1c63858acfa9fe6732352a3f56fdf232f404dfe1fdd80eeea49522bf012bd9d7332f2baa28edf863c544e5c469240cecf47d6f404fe1717e7422926e763a
7
- data.tar.gz: d1db5d410bf1676ad674cbd4c7446d655871cdc3abe92d221eafd4eba5949ad72a7fe690614bea57e7a4ac765190d153e628fb92774489c5a5e6da49bc1d7046
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", "."] + AwesomeTranslations::ErbInspector::FileInspector::JS_FILE_EXTS
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(/\I18n\.t\('(.+?)'\)/) do |match|
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(/\I18n\.t\("(.+?)"\)/) do |match|
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
@@ -1,3 +1,3 @@
1
1
  module AwesomeTranslations
2
- VERSION = "0.0.56".freeze
2
+ VERSION = "0.0.57".freeze
3
3
  end
@@ -1,2 +1,3 @@
1
1
  console.log(I18n.t(".hello_world"))
2
2
  console.log(I18n.t("javascripts.absolute.key"))
3
+ console.log(I18n.t("javascripts.absolute.key_with_args", {some_arg: "Hello", some_other_arg: "World"}))
@@ -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.56
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-07-27 00:00:00.000000000 Z
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