Browse Source

Patch convert_to_memoq to support untranslated segments and add VillageEncounter and mChapter1

LecygneNoir 4 months ago
parent
commit
a3d65c0a6b

+ 3891
- 0
compatibility-tools/VillageEncounters.po
File diff suppressed because it is too large
View File


+ 31032
- 0
compatibility-tools/VillageEncounters.txt_fre.rtf
File diff suppressed because it is too large
View File


+ 5937
- 0
compatibility-tools/VillageEncounters.txt_fre.rtf.work
File diff suppressed because it is too large
View File


+ 16
- 5
compatibility-tools/convert_memoq_to_po.sh View File

@@ -91,8 +91,14 @@ while read -r line; do
91 91
         # we reach end of story, insert the translated msgstr and reinit
92 92
         msgstr="${msgstr//'\lang1036 '/}"
93 93
         msgstr="${msgstr//'\cell }'/}"
94
-        echo "msgstr \"\"${msgstr}" >> "${TEMP_PO}"
95
-        echo >> "${TEMP_PO}"
94
+        # If there is still lang1036 then it means the msgstr is untranslated, insert an empty translation
95
+        if [[ ${msgstr} == *"lang1036"* ]]; then
96
+            echo "msgstr \"\"" >> "${TEMP_PO}"
97
+            echo >> "${TEMP_PO}"
98
+        else
99
+            echo "msgstr \"\"${msgstr}" >> "${TEMP_PO}"
100
+            echo >> "${TEMP_PO}"
101
+        fi
96 102
         comment_story=""
97 103
         msgstr=""
98 104
     elif [[ ${line} == *"\noproof [OUT]"* ]]; then
@@ -109,15 +115,20 @@ while read -r line; do
109 115
         line="${line//'"'/'\"'}"
110 116
         echo "msgid \"${line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${TEMP_PO}"
111 117
         echo >> "${TEMP_PO}"
118
+        # Insert an empty msgstr in case of untranslated [OUT]
119
+        # (in this case it never matches the \lang1036 [OUT] below so we need to insert it outside)
120
+        echo "msgstr \"\"" >> "${TEMP_PO}"
121
+        echo >> "${TEMP_PO}"
112 122
         ((out_incr++))
113 123
     elif [[ ${line} == *"\lang1036 [OUT]"* ]]; then
114
-        # It's an out for translated part (with lang1036) so write the msgstr
124
+        # It's an out for translated part (with lang1036) so write the msgstr.
115 125
         line="${line//'\cell }'/}"
116 126
         line="${line//'\lang1036 '/}"
117 127
         # Get rid of special character
118 128
         line="${line//'"'/'\"'}"
119 129
         encoded_line=$(convert_char_to_utf8 "${line}")
120
-        echo "msgstr \"${encoded_line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${TEMP_PO}"
130
+        # Insert without the msgstr as it has been inserted with the msgid before.
131
+        echo "\"${encoded_line#\[OUT\]}\"" | tr -d '\r' | tr -d '\n' >> "${TEMP_PO}"
121 132
         echo >> "${TEMP_PO}"
122 133
     elif [[ ${line} == *"[/NODE]"* ]]; then
123 134
         # We reach end of node, reinit
@@ -154,8 +165,8 @@ while read -r line; do
154 165
         if [[ $(echo "${line}" | grep "lang1036") ]]; then
155 166
             # Get rid of special character
156 167
             line="${line//'"'/'\"'}"
157
-            # We need a newline between each translated lines
158 168
             encoded_line=$(convert_char_to_utf8 "${line}")
169
+            # We need a newline between each translated lines
159 170
             msgstr="${msgstr}
160 171
 \"${encoded_line}\n\""
161 172
             continue

+ 11675
- 0
compatibility-tools/mChapter 1.po
File diff suppressed because it is too large
View File


+ 98476
- 0
compatibility-tools/mChapter 1.txt_fre.rtf
File diff suppressed because it is too large
View File


+ 19079
- 0
compatibility-tools/mChapter 1.txt_fre.rtf.work
File diff suppressed because it is too large
View File


Loading…
Cancel
Save