[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53800] trunk/blender/release/scripts/ modules/bl_i18n_utils: Some fixes:

Bastien Montagne montagne29 at wanadoo.fr
Mon Jan 14 22:41:27 CET 2013


Revision: 53800
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53800
Author:   mont29
Date:     2013-01-14 21:41:21 +0000 (Mon, 14 Jan 2013)
Log Message:
-----------
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!

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py	2013-01-14 20:27:25 UTC (rev 53799)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py	2013-01-14 21:41:21 UTC (rev 53800)
@@ -84,8 +84,8 @@
                             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."

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py	2013-01-14 20:27:25 UTC (rev 53799)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py	2013-01-14 21:41:21 UTC (rev 53800)
@@ -412,7 +412,9 @@
         # 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 @@
                     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:




More information about the Bf-blender-cvs mailing list