babelphish 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/babelphish.rb +1 -1
- data/lib/babelphish/translator.rb +8 -0
- metadata +2 -2
data/lib/babelphish.rb
CHANGED
@@ -36,7 +36,15 @@ module Babelphish
|
|
36
36
|
if translate_hash[key].is_a?(Hash)
|
37
37
|
translate_keys(translate_hash[key], to, from)
|
38
38
|
else
|
39
|
+
# pull out all the string substitutions so that google doesn't translate those
|
40
|
+
pattern = /\{\{.+\}\}/
|
41
|
+
holder = '{{---}}'
|
42
|
+
replacements = translate_hash[key].scan(pattern)
|
43
|
+
translate_hash[key].gsub!(pattern, holder)
|
39
44
|
translate_hash[key] = translate(translate_hash[key], to, from)
|
45
|
+
replacements.each do |r|
|
46
|
+
translate_hash[key].sub!(holder, r)
|
47
|
+
end
|
40
48
|
end
|
41
49
|
end
|
42
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babelphish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-21 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|