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?
|
data/test/support/ex5.haml
CHANGED
data/test/support/ex5.yml
CHANGED
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:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Shai Rosenfeld
|