Browse Source

Patch extract module when double quote is onvolved in modules

master
LecygneNoir 5 years ago
parent
commit
1a833eac68
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      extract_module.sh

+ 6
- 0
extract_module.sh View File

@ -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}"

Loading…
Cancel
Save