[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51676] trunk/blender: A few more BMesh errors messages translated, and "automated" translation for modifers too!

Bastien Montagne montagne29 at wanadoo.fr
Sat Oct 27 13:12:10 CEST 2012


Revision: 51676
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51676
Author:   mont29
Date:     2012-10-27 11:12:09 +0000 (Sat, 27 Oct 2012)
Log Message:
-----------
A few more BMesh errors messages translated, and "automated" translation for modifers too!

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/blenkernel/intern/cloth.c
    trunk/blender/source/blender/blenkernel/intern/modifier.c
    trunk/blender/source/blender/bmesh/intern/bmesh_core.c
    trunk/blender/source/blender/bmesh/intern/bmesh_walkers_impl.c
    trunk/blender/source/blender/editors/armature/meshlaplacian.c
    trunk/blender/source/blender/modifiers/intern/MOD_boolean.c
    trunk/blender/source/blender/modifiers/intern/MOD_decimate.c
    trunk/blender/source/blender/modifiers/intern/MOD_meshdeform.c

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py	2012-10-27 11:10:12 UTC (rev 51675)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py	2012-10-27 11:12:09 UTC (rev 51676)
@@ -154,12 +154,18 @@
 PYGETTEXT_KEYWORDS = (() +
     tuple((r"{}\(\s*" + _msg_re + r"\s*\)").format(it)
           for it in ("IFACE_", "TIP_", "N_")) +
+
     tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it)
           for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) + 
+
     tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
           for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf")) +
-    tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
-          for it in ("BMO_error_raise",))
+
+    tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*,").format(it)
+          for it in ("BMO_error_raise",)) +
+
+    tuple(("{}\\((?:[^\"',]+,)\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
+          for it in ("modifier_setError",))
 )
 
 ESCAPE_RE = (
@@ -225,47 +231,35 @@
 PYTHON3_EXEC = "python3"
 
 # The Blender executable!
-# This is just an example, you’ll most likely have to edit it in your
-# user_settings.py!
-BLENDER_EXEC = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..",
-                                            "blender"))
+# This is just an example, you’ll most likely have to edit it in your user_settings.py!
+BLENDER_EXEC = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "blender"))
 
-# The xgettext tool. You’ll likely have to edit it in your user_settings.py
-# if you’re under Windows.
+# The xgettext tool. You’ll likely have to edit it in your user_settings.py if you’re under Windows.
 GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
 
-# The gettext msgmerge tool. You’ll likely have to edit it in your
-# user_settings.py if you’re under Windows.
+# The gettext msgmerge tool. You’ll likely have to edit it in your user_settings.py if you’re under Windows.
 GETTEXT_MSGMERGE_EXECUTABLE = "msgmerge"
 
-# The gettext msgfmt "compiler". You’ll likely have to edit it in your
-# user_settings.py if you’re under Windows.
+# The gettext msgfmt "compiler". You’ll likely have to edit it in your user_settings.py if you’re under Windows.
 GETTEXT_MSGFMT_EXECUTABLE = "msgfmt"
 
-# The svn binary... You’ll likely have to edit it in your
-# user_settings.py if you’re under Windows.
+# The svn binary... You’ll likely have to edit it in your user_settings.py if you’re under Windows.
 SVN_EXECUTABLE = "svn"
 
 # The FriBidi C compiled library (.so under Linux, .dll under windows...).
-# You’ll likely have to edit it in your user_settings.py if you’re under
-# Windows., e.g. using the included one:
+# You’ll likely have to edit it in your user_settings.py if you’re under Windows., e.g. using the included one:
 #     FRIBIDI_LIB = os.path.join(TOOLS_DIR, "libfribidi.dll")
 FRIBIDI_LIB = "libfribidi.so.0"
 
-# The name of the (currently empty) file that must be present in a po's
-# directory to enable rtl-preprocess.
+# The name of the (currently empty) file that must be present in a po's directory to enable rtl-preprocess.
 RTL_PREPROCESS_FILE = "is_rtl"
 
 # The Blender source root path.
-# This is just an example, you’ll most likely have to override it in your
-# user_settings.py!
-SOURCE_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..",
-                                          "..", "..", "blender_msgs"))
+# This is just an example, you’ll most likely have to override it in your user_settings.py!
+SOURCE_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "..", "..", "blender_msgs"))
 
-# The bf-translation repository (you'll likely have to override this in your
-# user_settings.py).
-I18N_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..",
-                                        "..", "..", "i18n"))
+# The bf-translation repository (you'll likely have to override this in your user_settings.py).
+I18N_DIR = os.path.abspath(os.path.join(TOOLS_DIR, "..", "..", "..", "..", "..", "..", "i18n"))
 
 # The /branches path (overriden in bf-translation's i18n_override_settings.py).
 BRANCHES_DIR = os.path.join(I18N_DIR, "branches")
@@ -285,12 +279,10 @@
 # The Blender source path to check for i18n macros.
 POTFILES_SOURCE_DIR = os.path.join(SOURCE_DIR, "source")
 
-# The "source" file storing which files should be processed by xgettext,
-# used to create FILE_NAME_POTFILES
+# The "source" file storing which files should be processed by xgettext, used to create FILE_NAME_POTFILES
 FILE_NAME_SRC_POTFILES = os.path.join(TRUNK_PO_DIR, "_POTFILES.in")
 
-# The final (generated) file storing which files
-# should be processed by xgettext.
+# The final (generated) file storing which files should be processed by xgettext.
 FILE_NAME_POTFILES = os.path.join(TRUNK_PO_DIR, "POTFILES.in")
 
 # The template messages file.
@@ -298,9 +290,7 @@
 
 # Other py files that should be searched for ui strings, relative to SOURCE_DIR.
 # Needed for Cycles, currently...
-CUSTOM_PY_UI_FILES = [os.path.join("intern", "cycles", "blender",
-                                   "addon", "ui.py"),
-                     ]
+CUSTOM_PY_UI_FILES = [os.path.join("intern", "cycles", "blender", "addon", "ui.py"),]
 
 
 # A cache storing validated msgids, to avoid re-spellchecking them.

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-10-27 11:10:12 UTC (rev 51675)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2012-10-27 11:12:09 UTC (rev 51676)
@@ -51,8 +51,6 @@
 #include "BLI_utildefines.h"
 #include "BLI_linklist.h"
 
-#include "BLF_translation.h"
-
 #include "BKE_cdderivedmesh.h"
 #include "BKE_displist.h"
 #include "BKE_key.h"
@@ -1507,7 +1505,7 @@
 		if (!modifier_isEnabled(scene, md, required_mode)) continue;
 		if (mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue;
 		if ((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
-			modifier_setError(md, "%s", TIP_("Modifier requires original data, bad stack position."));
+			modifier_setError(md, "Modifier requires original data, bad stack position");
 			continue;
 		}
 		if (sculpt_mode && (!has_multires || multires_applied)) {
@@ -1520,7 +1518,7 @@
 			unsupported |= multires_applied;
 
 			if (unsupported) {
-				modifier_setError(md, "%s", TIP_("Not supported in sculpt mode."));
+				modifier_setError(md, "Not supported in sculpt mode");
 				continue;
 			}
 		}
@@ -1881,7 +1879,7 @@
 
 	if (!modifier_isEnabled(scene, md, required_mode)) return 0;
 	if ((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
-		modifier_setError(md, "%s", TIP_("Modifier requires original data, bad stack position."));
+		modifier_setError(md, "Modifier requires original data, bad stack position");
 		return 0;
 	}
 	

Modified: trunk/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cloth.c	2012-10-27 11:10:12 UTC (rev 51675)
+++ trunk/blender/source/blender/blenkernel/intern/cloth.c	2012-10-27 11:12:09 UTC (rev 51676)
@@ -41,8 +41,6 @@
 #include "BLI_utildefines.h"
 #include "BLI_linklist.h"
 
-#include "BLF_translation.h"
-
 #include "BKE_cdderivedmesh.h"
 #include "BKE_cloth.h"
 #include "BKE_effect.h"
@@ -845,7 +843,7 @@
 		clmd->clothObject->edgehash = NULL;
 	}
 	else if (!clmd->clothObject) {
-		modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject."));
+		modifier_setError(&(clmd->modifier), "Out of memory on allocating clmd->clothObject");
 		return 0;
 	}
 
@@ -907,7 +905,7 @@
 
 	if ( !cloth_build_springs ( clmd, dm ) ) {
 		cloth_free_modifier ( clmd );
-		modifier_setError(&(clmd->modifier), "%s", TIP_("Can't build springs."));
+		modifier_setError(&(clmd->modifier), "Cannot build springs");
 		printf("cloth_free_modifier cloth_build_springs\n");
 		return 0;
 	}
@@ -949,7 +947,7 @@
 	clmd->clothObject->verts = MEM_callocN ( sizeof ( ClothVertex ) * clmd->clothObject->numverts, "clothVertex" );
 	if ( clmd->clothObject->verts == NULL ) {
 		cloth_free_modifier ( clmd );
-		modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject->verts."));
+		modifier_setError(&(clmd->modifier), "Out of memory on allocating clmd->clothObject->verts");
 		printf("cloth_free_modifier clmd->clothObject->verts\n");
 		return;
 	}
@@ -959,7 +957,7 @@
 	clmd->clothObject->mfaces = MEM_callocN ( sizeof ( MFace ) * clmd->clothObject->numfaces, "clothMFaces" );
 	if ( clmd->clothObject->mfaces == NULL ) {
 		cloth_free_modifier ( clmd );
-		modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject->mfaces."));
+		modifier_setError(&(clmd->modifier), "Out of memory on allocating clmd->clothObject->mfaces");
 		printf("cloth_free_modifier clmd->clothObject->mfaces\n");
 		return;
 	}

Modified: trunk/blender/source/blender/blenkernel/intern/modifier.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/modifier.c	2012-10-27 11:10:12 UTC (rev 51675)
+++ trunk/blender/source/blender/blenkernel/intern/modifier.c	2012-10-27 11:12:09 UTC (rev 51676)
@@ -55,6 +55,8 @@
 #include "BLI_linklist.h"
 #include "BLI_string.h"
 
+#include "BLF_translation.h"
+
 #include "BKE_cloth.h"
 #include "BKE_key.h"
 #include "BKE_multires.h"
@@ -259,12 +261,13 @@
 	return (mti->type == eModifierTypeType_NonGeometrical);
 }
 
-void modifier_setError(ModifierData *md, const char *format, ...)
+void modifier_setError(ModifierData *md, const char *_format, ...)
 {
 	char buffer[512];
 	va_list ap;
+	const char *format = TIP_(_format);
 
-	va_start(ap, format);
+	va_start(ap, _format);
 	vsnprintf(buffer, sizeof(buffer), format, ap);
 	va_end(ap);
 	buffer[sizeof(buffer) - 1] = '\0';

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_core.c
===================================================================

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list