|
|
@ -91,8 +91,14 @@ while read -r line; do |
|
|
|
# we reach end of story, insert the translated msgstr and reinit |
|
|
|
msgstr="${msgstr//'\lang1036 '/}" |
|
|
|
msgstr="${msgstr//'\cell }'/}" |
|
|
|
echo "msgstr \"\"${msgstr}" >> "${TEMP_PO}" |
|
|
|
echo >> "${TEMP_PO}" |
|
|
|
# If there is still lang1036 then it means the msgstr is untranslated, insert an empty translation |
|
|
|
if [[ ${msgstr} == *"lang1036"* ]]; then |
|
|
|
echo "msgstr \"\"" >> "${TEMP_PO}" |
|
|
|
echo >> "${TEMP_PO}" |
|
|
|
else |
|
|
|
echo "msgstr \"\"${msgstr}" >> "${TEMP_PO}" |
|
|
|
echo >> "${TEMP_PO}" |
|
|
|
fi |
|
|
|
comment_story="" |
|
|
|
msgstr="" |
|
|
|
elif [[ ${line} == *"\noproof [OUT]"* ]]; then |
|
|
@ -109,15 +115,20 @@ while read -r line; do |
|
|
|
line="${line//'"'/'\"'}" |
|
|
|
echo "msgid \"${line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${TEMP_PO}" |
|
|
|
echo >> "${TEMP_PO}" |
|
|
|
# Insert an empty msgstr in case of untranslated [OUT] |
|
|
|
# (in this case it never matches the \lang1036 [OUT] below so we need to insert it outside) |
|
|
|
echo "msgstr \"\"" >> "${TEMP_PO}" |
|
|
|
echo >> "${TEMP_PO}" |
|
|
|
((out_incr++)) |
|
|
|
elif [[ ${line} == *"\lang1036 [OUT]"* ]]; then |
|
|
|
# It's an out for translated part (with lang1036) so write the msgstr |
|
|
|
# It's an out for translated part (with lang1036) so write the msgstr. |
|
|
|
line="${line//'\cell }'/}" |
|
|
|
line="${line//'\lang1036 '/}" |
|
|
|
# Get rid of special character |
|
|
|
line="${line//'"'/'\"'}" |
|
|
|
encoded_line=$(convert_char_to_utf8 "${line}") |
|
|
|
echo "msgstr \"${encoded_line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${TEMP_PO}" |
|
|
|
# Insert without the msgstr as it has been inserted with the msgid before. |
|
|
|
echo "\"${encoded_line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${TEMP_PO}" |
|
|
|
echo >> "${TEMP_PO}" |
|
|
|
elif [[ ${line} == *"[/NODE]"* ]]; then |
|
|
|
# We reach end of node, reinit |
|
|
@ -154,8 +165,8 @@ while read -r line; do |
|
|
|
if [[ $(echo "${line}" | grep "lang1036") ]]; then |
|
|
|
# Get rid of special character |
|
|
|
line="${line//'"'/'\"'}" |
|
|
|
# We need a newline between each translated lines |
|
|
|
encoded_line=$(convert_char_to_utf8 "${line}") |
|
|
|
# We need a newline between each translated lines |
|
|
|
msgstr="${msgstr} |
|
|
|
\"${encoded_line}\n\"" |
|
|
|
continue |
|
|
|