diff --git a/extract_module.sh b/extract_module.sh index 9607f1c..d3fa390 100755 --- a/extract_module.sh +++ b/extract_module.sh @@ -48,6 +48,8 @@ while read -r line; do # OUT are one line, let's write it to the pot echo "#. ${comment_out}" | tr -d '\r' | tr -d '\n' >> "${POT}" echo >> "${POT}" + # Get rid of special character + line="${line//'"'/'\\"'}" echo "msgid \"${line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${POT}" echo >> "${POT}" echo 'msgstr ""' >> "${POT}" @@ -67,12 +69,16 @@ while read -r line; do comment_out="" out_incr=1 elif [[ "${comment_story}" != "" && ${story_first_line} == 1 ]]; then + # Get rid of special character + line="${line//'"'/'\\"'}" # If the line has nothing particular, and the comment_story is not empty, it's a story string # As the story_fist_line is set, it's the first line of the story, add the msgid echo "msgid \"${line}\"" | tr -d '\r' | tr -d '\n' >> "${POT}" echo >> "${POT}" story_first_line=0 elif [[ ${comment_story} != "" ]]; then + # Get rid of special character + line="${line//'"'/'\"'}" # We are on a multilines story, write it but without the msgid # Also as this is multiline, we need to add \n to the previous line (no way to detect it sooner...) sed -e '$s/\(.*\)"$/\1\\n"/' -i "${POT}"