Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-01-15 01:41:21 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-01-15 01:41:21 +0400
commit819a75113e33c42a3b5fd66d67862512e22a0fe6 (patch)
treea0060ecef8123e9535759e7a34bad26303b90b4a /release/scripts/modules
parent0b212d5818a8054784282e7537799be771b121f7 (diff)
Some fixes:
* handle nicely multiple empty lines in po files (still have to figure out why po writer sometime output two lines instead of one!) * fix rtl processing!
Diffstat (limited to 'release/scripts/modules')
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/import_po_from_branches.py4
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
index f42b45e7d4e..956d2e96154 100755
--- a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
+++ b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
@@ -84,8 +84,8 @@ def main():
trans.append(m.msgstr)
trans = rtl_preprocess.log2vis(trans)
for k, t in zip(keys, trans):
- msgs[k].msgstr = t
- msgs.write(kinf='PO', dest=out_po)
+ msgs.msgs[k].msgstr = t
+ msgs.write(kind='PO', dest=out_po)
# Also copies org po!
shutil.copy(po, out_raw_po)
print("{:<10}: {:>6.1%} done, enough translated messages, processed and copied to trunk."
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index 891bbae3871..1c2e62b4c4e 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -412,7 +412,9 @@ class I18nMessages:
# Main loop over all lines in src...
for line_nr, line in enumerate(src.splitlines()):
if line == "":
- finalize_message(self, line_nr)
+ if reading_msgstr:
+ finalize_message(self, line_nr)
+ continue
elif line.startswith(PO_MSGCTXT) or line.startswith(_comm_msgctxt):
reading_comment = False
@@ -493,6 +495,7 @@ class I18nMessages:
msgstr_lines.append(line)
else:
self.parsing_errors.append((line_nr, "regular string outside msgctxt, msgid or msgstr scope"))
+ #self.parsing_errors += (str(comment_lines), str(msgctxt_lines), str(msgid_lines), str(msgstr_lines))
# If no final empty line, last message is not finalized!
if reading_msgstr: