From 017ce4e0925f292e90b7d8cb8d50c4e9afbca59c Mon Sep 17 00:00:00 2001 From: Badlop Date: Sun, 15 Apr 2012 00:05:03 +0200 Subject: [PATCH] Fix translation script to use ejabberd_regexp (EJAB-921) --- contrib/extract_translations/extract_translations.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/extract_translations/extract_translations.erl b/contrib/extract_translations/extract_translations.erl index 488357ba6..90f4ac519 100644 --- a/contrib/extract_translations/extract_translations.erl +++ b/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]).