haml-i18n-extractor 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,6 @@ module Haml
7
7
 
8
8
  attr_reader :full_line, :text_to_replace, :line_type
9
9
 
10
- T_REGEX = /t\('\.(.*?)'\)/
11
10
 
12
11
  def initialize(full_line, text_to_replace,line_type, path, metadata = {})
13
12
  @path = path
@@ -47,12 +46,14 @@ module Haml
47
46
 
48
47
  private
49
48
 
49
+ T_REGEX = /t\('\.(.*?)'\)/
50
+
50
51
  # the_key_to_use ( for example in t('.the_key_to_use')
51
52
  def t_name(to_replace = @text_to_replace, orig_line = @orig_line)
52
53
  text_to_replace = to_replace.dup
53
54
  if has_been_translated?(text_to_replace)
54
55
  text_to_replace.match T_REGEX
55
- name = $1
56
+ name = normalized_name($1.dup)
56
57
  else
57
58
  name = normalized_name(text_to_replace.dup)
58
59
  name = normalized_name(orig_line.dup) if name.empty?
@@ -1,7 +1,7 @@
1
1
  module Haml
2
2
  module I18n
3
3
  class Extractor
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.3"
5
5
  end
6
6
  end
7
7
  end
@@ -2,3 +2,4 @@
2
2
  .other-class#id= "script with quote #{with_interpolation(bub)} interpolated!"
3
3
 
4
4
  = "this may #{be} the #{dup}"
5
+ = link_to "#{ad.name.first}", url_for([ad, :ok])
@@ -2,3 +2,4 @@
2
2
  .other-class#id= t('.script_with_quote_with_interpo', :with_interpolationbub => with_interpolation(bub))
3
3
 
4
4
  =t('.this_may_be_the_dup', :be => be, :dup => dup)
5
+ = link_to t('.adnamefirst', :adnamefirst => ad.name.first), url_for([ad, :ok])
data/test/support/ex5.yml CHANGED
@@ -6,3 +6,4 @@ en:
6
6
  script_with_quote_with_interpo: ! '"script with quote %{with_interpolationbub}
7
7
  interpolated!"'
8
8
  this_may_be_the_dup: ! ' "this may %{be} the %{dup}"'
9
+ adnamefirst: ! '%{adnamefirst}'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-i18n-extractor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shai Rosenfeld