Browse files

Fix translation script to use ejabberd_regexp (EJAB-921)

  • Loading branch information...
1 parent 4985968 commit 017ce4e0925f292e90b7d8cb8d50c4e9afbca59c @badlop badlop committed Apr 15, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 contrib/extract_translations/extract_translations.erl
View
8 contrib/extract_translations/extract_translations.erl
@@ -281,14 +281,14 @@ build_additional_translators(List) ->
List).
print_translation(File, Line, Str, StrT) ->
- {ok, StrQ, _} = regexp:gsub(Str, "\"", "\\\""),
- {ok, StrTQ, _} = regexp:gsub(StrT, "\"", "\\\""),
+ StrQ = ejabberd_regexp:greplace(Str, "\\\"", "\\\\\""),
+ StrTQ = ejabberd_regexp:greplace(StrT, "\\\"", "\\\\\""),
io:format("#: ~s:~p~nmsgid \"~s\"~nmsgstr \"~s\"~n~n", [File, Line, StrQ, StrTQ]).
print_translation_obsolete(Str, StrT) ->
File = "unknown.erl",
Line = 1,
- {ok, StrQ, _} = regexp:gsub(Str, "\"", "\\\""),
- {ok, StrTQ, _} = regexp:gsub(StrT, "\"", "\\\""),
+ StrQ = ejabberd_regexp:greplace(Str, "\\\"", "\\\\\""),
+ StrTQ = ejabberd_regexp:greplace(StrT, "\\\"", "\\\\\""),
io:format("#: ~s:~p~n#~~ msgid \"~s\"~n#~~ msgstr \"~s\"~n~n", [File, Line, StrQ, StrTQ]).

0 comments on commit 017ce4e

Please sign in to comment.