diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-03-20 22:42:09 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-03-20 22:42:09 +0400 |
commit | 885441e75804a92d4c2270fd006f3e71fc460d7b (patch) | |
tree | 7d3e89d07af080a2146eb747ff9da6ecd9d0e7f9 /source/blender/editors/mesh/editmesh_add.c | |
parent | e9b0b402cc85533c8b247b174f17f41b1892ef04 (diff) |
I18n users request: add the ability to use a translated name for newly added/created objects or other datablocks.
This simply adds a third "translation type" (in addition to iface and tip), "new data", with relevant user settings flag and helper funcs/macros (and py api).
Currently implemented name translation when adding new objects, as well as modifiers and constraints, will add the others (cd layers, scenes, perhaps nodes [though I think they do not need this], etc.) later.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index bcff5adb345..29a7b599983 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -34,6 +34,8 @@ #include "BLI_math.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_library.h" #include "BKE_tessmesh.h" @@ -106,7 +108,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) unsigned int layer; ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Plane", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Plane"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -147,7 +149,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) unsigned int layer; ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Cube", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Cube"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_cube matrix=%m4 size=%f", mat, dia * 2.0f)) { @@ -196,7 +198,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) cap_tri = (cap_end == 2); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Circle", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Circle"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -251,7 +253,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) cap_tri = (cap_end == 2); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Cylinder", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Cylinder"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf( @@ -312,7 +314,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) cap_tri = (cap_end == 2); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Cone", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Cone"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf( @@ -369,7 +371,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) unsigned int layer; ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Grid", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Grid"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -425,7 +427,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op) if (!view_aligned) rot[0] += (float)M_PI / 2.0f; - obedit = make_prim_init(C, "Suzanne", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Suzanne"), &dia, mat, &state, loc, rot, layer); mat[0][0] *= dia; mat[1][1] *= dia; mat[2][2] *= dia; @@ -468,7 +470,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) unsigned int layer; ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Sphere", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Sphere"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -520,7 +522,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) unsigned int layer; ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); - obedit = make_prim_init(C, "Icosphere", &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, DATA_("Icosphere"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf( |