A few more BMesh errors messages translated, and "automated" translation for modifers too!

This commit is contained in:
Bastien Montagne
2012-10-27 11:12:09 +00:00
parent 91584b0f0c
commit ec67334e25
10 changed files with 49 additions and 60 deletions

View File

@@ -154,12 +154,18 @@ _msg_re = r"(?P<msg_raw>" + _str_whole_re.format(_="_msg") + r")"
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 @@ TOOLS_DIR = os.path.join(os.path.dirname(__file__))
PYTHON3_EXEC = "python3"
# The Blender executable!
# This is just an example, youll 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, youll 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. Youll likely have to edit it in your user_settings.py
# if youre under Windows.
# The xgettext tool. Youll likely have to edit it in your user_settings.py if youre under Windows.
GETTEXT_XGETTEXT_EXECUTABLE = "xgettext"
# The gettext msgmerge tool. Youll likely have to edit it in your
# user_settings.py if youre under Windows.
# The gettext msgmerge tool. Youll likely have to edit it in your user_settings.py if youre under Windows.
GETTEXT_MSGMERGE_EXECUTABLE = "msgmerge"
# The gettext msgfmt "compiler". Youll likely have to edit it in your
# user_settings.py if youre under Windows.
# The gettext msgfmt "compiler". Youll likely have to edit it in your user_settings.py if youre under Windows.
GETTEXT_MSGFMT_EXECUTABLE = "msgfmt"
# The svn binary... Youll likely have to edit it in your
# user_settings.py if youre under Windows.
# The svn binary... Youll likely have to edit it in your user_settings.py if youre under Windows.
SVN_EXECUTABLE = "svn"
# The FriBidi C compiled library (.so under Linux, .dll under windows...).
# Youll likely have to edit it in your user_settings.py if youre under
# Windows., e.g. using the included one:
# Youll likely have to edit it in your user_settings.py if youre 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, youll 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, youll 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 @@ FILE_NAME_MESSAGES = os.path.join(TRUNK_PO_DIR, "messages.txt")
# 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 @@ FILE_NAME_POT = os.path.join(TRUNK_PO_DIR, ".".join((DOMAIN, "pot")))
# 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.

View File

@@ -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 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
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 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
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 @@ int editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *d
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;
}

View File

@@ -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 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
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 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
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 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm )
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 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm )
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;
}

View File

@@ -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 @@ int modifier_nonGeometrical(ModifierData *md)
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';

View File

@@ -28,12 +28,13 @@
#include "MEM_guardedalloc.h"
#include "BLI_math_vector.h"
#include "BKE_DerivedMesh.h"
#include "BLI_listbase.h"
#include "BLI_array.h"
#include "BLF_translation.h"
#include "BKE_DerivedMesh.h"
#include "bmesh.h"
#include "intern/bmesh_private.h"
@@ -960,7 +961,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const short do_del
int rlen = count_flagged_radial(bm, l_iter, _FLAG_JF);
if (rlen > 2) {
err = "Input faces do not form a contiguous manifold region";
err = N_("Input faces do not form a contiguous manifold region");
goto error;
}
else if (rlen == 1) {
@@ -1023,7 +1024,7 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const short do_del
newf = BM_face_create_ngon(bm, v1, v2, edges, tote, FALSE);
if (UNLIKELY(!newf || BMO_error_occurred(bm))) {
if (!BMO_error_occurred(bm))
err = "Invalid boundary region to join faces";
err = N_("Invalid boundary region to join faces");
goto error;
}

View File

@@ -303,8 +303,7 @@ static void *bmw_IslandboundWalker_step(BMWalker *walker)
if (!BM_vert_is_manifold(v)) {
BMW_reset(walker);
BMO_error_raise(walker->bm, NULL, BMERR_WALKER_FAILED,
"Non-manifold vert "
"while searching region boundary");
"Non-manifold vert while searching region boundary");
return NULL;
}

View File

@@ -1721,7 +1721,7 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
}
}
else {
modifier_setError(&mmd->modifier, "%s", TIP_("Failed to find bind solution (increase precision?)."));
modifier_setError(&mmd->modifier, "Failed to find bind solution (increase precision?)");
error("Mesh Deform: failed to find bind solution.");
break;
}

View File

@@ -167,7 +167,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if (result)
return result;
else
modifier_setError(md, "%s", TIP_("Can't execute boolean operation."));
modifier_setError(md, "Cannot execute boolean operation");
}
return derivedData;

View File

@@ -126,7 +126,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
}
if (dmd->face_count <= 3) {
modifier_setError(md, "%s", TIP_("Modifier requires more than 3 input faces"));
modifier_setError(md, "Modifier requires more than 3 input faces");
return dm;
}

View File

@@ -218,7 +218,7 @@ static void meshdeformModifier_do(
}
if (!cagedm) {
modifier_setError(md, "%s", TIP_("Can't get mesh from cage object."));
modifier_setError(md, "Cannot get mesh from cage object");
return;
}
@@ -246,17 +246,17 @@ static void meshdeformModifier_do(
totcagevert = cagedm->getNumVerts(cagedm);
if (mmd->totvert != totvert) {
modifier_setError(md, TIP_("Verts changed from %d to %d."), mmd->totvert, totvert);
modifier_setError(md, "Verts changed from %d to %d", mmd->totvert, totvert);
cagedm->release(cagedm);
return;
}
else if (mmd->totcagevert != totcagevert) {
modifier_setError(md, TIP_("Cage verts changed from %d to %d."), mmd->totcagevert, totcagevert);
modifier_setError(md, "Cage verts changed from %d to %d", mmd->totcagevert, totcagevert);
cagedm->release(cagedm);
return;
}
else if (mmd->bindcagecos == NULL) {
modifier_setError(md, "%s", TIP_("Bind data missing."));
modifier_setError(md, "Bind data missing");
cagedm->release(cagedm);
return;
}