Skip to content

Commit

Permalink
fixed regex used for string substitutions in yml files
Browse files Browse the repository at this point in the history
  • Loading branch information
jbasdf committed Aug 15, 2009
1 parent 21458bf commit 83a3630
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/babelphish/yml_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def translate_many_yml_keys(translate_hash, tos, from)

def parse_substitutions(translate_text)
# pull out all the string substitutions so that google doesn't translate those
pattern = /\{\{.+\}\}/
pattern = /\{\{.+?\}\}/ # non greedy pattern match so that we properly match strings like: "{{name}} on {{application_name}}"
replacements = translate_text.scan(pattern)
translate_text.gsub!(pattern, SUBSTITUTION_PLACE_HOLDER)
replacements
Expand Down
2 changes: 1 addition & 1 deletion test/translations/fa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ fa:
more:
test_more: "این یک سطح پایین تر است."
test: "این یک تست است که رشته"
test_embedded: "این embedding با یک رشته {{insert}}است."
test_embedded: "این یک رشته با embedding {{insert}}است."

0 comments on commit 83a3630

Please sign in to comment.