diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2013-03-25 12:29:06 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2013-03-25 12:29:06 +0400 |
commit | 69265961749780e252e144d1f815c0fdda435b8a (patch) | |
tree | afe54648b63dc0f9746d38cff81de247ca0ddf98 /source/blender/editors | |
parent | 1b4c9e1ad40142fbf6a2d97303661a78527c134b (diff) |
More new data names translation (most cases should be covered now).
Also done a few cleanup here and there...
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/armature_naming.c | 6 | ||||
-rw-r--r-- | source/blender/editors/armature/pose_lib.c | 4 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 28 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 18 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 16 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 4 | ||||
-rw-r--r-- | source/blender/editors/physics/dynamicpaint_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 6 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 3 |
12 files changed, 54 insertions, 45 deletions
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index 561e196bf41..196b8064967 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -38,6 +38,8 @@ #include "BLI_blenlib.h" #include "BLI_ghash.h" +#include "BLF_translation.h" + #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_armature.h" @@ -85,7 +87,7 @@ void unique_editbone_name(ListBase *edbo, char *name, EditBone *bone) data.lb = edbo; data.bone = bone; - BLI_uniquename_cb(editbone_unique_check, &data, "Bone", '.', name, sizeof(bone->name)); + BLI_uniquename_cb(editbone_unique_check, &data, DATA_("Bone"), '.', name, sizeof(bone->name)); } /* ************************************************** */ @@ -98,7 +100,7 @@ static bool bone_unique_check(void *arg, const char *name) static void unique_bone_name(bArmature *arm, char *name) { - BLI_uniquename_cb(bone_unique_check, (void *)arm, "Bone", '.', name, sizeof(((Bone *)NULL)->name)); + BLI_uniquename_cb(bone_unique_check, (void *)arm, DATA_("Bone"), '.', name, sizeof(((Bone *)NULL)->name)); } /* helper call for armature_bone_rename */ diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 09c0f7e9647..cb7a699b522 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -462,7 +462,7 @@ static int poselib_add_exec(bContext *C, wmOperator *op) } /* validate name */ - BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name)); + BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name)); /* use Keying Set to determine what to store for the pose */ /* FIXME: in the past, the Keying Set respected selections (LocRotScale), but the current one doesn't @@ -666,7 +666,7 @@ static int poselib_rename_exec(bContext *C, wmOperator *op) /* copy name and validate it */ BLI_strncpy(marker->name, newname, sizeof(marker->name)); - BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name)); + BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name)); /* send notifiers for this - using keyframe editing notifiers, since action * may be being shown in anim editors as active action diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index f95fbd1eacb..c001c17a279 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -6150,20 +6150,20 @@ static const char *get_curve_defname(int type) if ((type & CU_TYPE) == CU_BEZIER) { switch (stype) { - case CU_PRIM_CURVE: return DATA_("BezierCurve"); - case CU_PRIM_CIRCLE: return DATA_("BezierCircle"); - case CU_PRIM_PATH: return DATA_("CurvePath"); + case CU_PRIM_CURVE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "BezierCurve"); + case CU_PRIM_CIRCLE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "BezierCircle"); + case CU_PRIM_PATH: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "CurvePath"); default: - return DATA_("Curve"); + return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "Curve"); } } else { switch (stype) { - case CU_PRIM_CURVE: return DATA_("NurbsCurve"); - case CU_PRIM_CIRCLE: return DATA_("NurbsCircle"); - case CU_PRIM_PATH: return DATA_("NurbsPath"); + case CU_PRIM_CURVE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "NurbsCurve"); + case CU_PRIM_CIRCLE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "NurbsCircle"); + case CU_PRIM_PATH: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "NurbsPath"); default: - return DATA_("Curve"); + return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "Curve"); } } } @@ -6173,13 +6173,13 @@ static const char *get_surf_defname(int type) int stype = type & CU_PRIMITIVE; switch (stype) { - case CU_PRIM_CURVE: return DATA_("SurfCurve"); - case CU_PRIM_CIRCLE: return DATA_("SurfCircle"); - case CU_PRIM_PATCH: return DATA_("SurfPatch"); - case CU_PRIM_SPHERE: return DATA_("SurfSphere"); - case CU_PRIM_DONUT: return DATA_("SurfTorus"); + case CU_PRIM_CURVE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfCurve"); + case CU_PRIM_CIRCLE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfCircle"); + case CU_PRIM_PATCH: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfPatch"); + case CU_PRIM_SPHERE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfSphere"); + case CU_PRIM_DONUT: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfTorus"); default: - return DATA_("Surface"); + return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "Surface"); } } diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 1daf39d3319..3117f45156d 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -108,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, DATA_("Plane"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Plane"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -149,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, DATA_("Cube"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "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)) { @@ -198,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, DATA_("Circle"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Circle"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -253,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, DATA_("Cylinder"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cylinder"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf( @@ -314,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, DATA_("Cone"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cone"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf( @@ -371,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, DATA_("Grid"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Grid"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -427,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, DATA_("Suzanne"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Suzanne"), &dia, mat, &state, loc, rot, layer); mat[0][0] *= dia; mat[1][1] *= dia; mat[2][2] *= dia; @@ -470,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, DATA_("Sphere"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Sphere"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf(em, op, "verts.out", @@ -522,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, DATA_("Icosphere"), &dia, mat, &state, loc, rot, layer); + obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Icosphere"), &dia, mat, &state, loc, rot, layer); em = BMEdit_FromObject(obedit); if (!EDBM_op_call_and_selectf( diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 63582feadb7..b33c7212f0e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -452,7 +452,7 @@ static int effector_add_exec(bContext *C, wmOperator *op) if (!ob) return OPERATOR_CANCELLED; - rename_id(&ob->id, DATA_("CurveGuide")); + rename_id(&ob->id, CTX_DATA_(BLF_I18NCONTEXT_ID_OBJECT, "CurveGuide")); ((Curve *)ob->data)->flag |= CU_PATH | CU_3D; ED_object_editmode_enter(C, 0); ED_object_new_primitive_matrix(C, ob, loc, rot, mat, FALSE); @@ -465,7 +465,7 @@ static int effector_add_exec(bContext *C, wmOperator *op) if (!ob) return OPERATOR_CANCELLED; - rename_id(&ob->id, DATA_("Field")); + rename_id(&ob->id, CTX_DATA_(BLF_I18NCONTEXT_ID_OBJECT, "Field")); if (ELEM(type, PFIELD_WIND, PFIELD_VORTEX)) ob->empty_drawtype = OB_SINGLE_ARROW; } @@ -822,13 +822,13 @@ void OBJECT_OT_drop_named_image(wmOperatorType *ot) static const char *get_lamp_defname(int type) { switch (type) { - case LA_LOCAL: return DATA_("Point"); - case LA_SUN: return DATA_("Sun"); - case LA_SPOT: return DATA_("Spot"); - case LA_HEMI: return DATA_("Hemi"); - case LA_AREA: return DATA_("Area"); + case LA_LOCAL: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Point"); + case LA_SUN: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Sun"); + case LA_SPOT: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Spot"); + case LA_HEMI: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Hemi"); + case LA_AREA: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Area"); default: - return DATA_("Lamp"); + return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Lamp"); } } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 5abbb7124c0..bdf04dcd20d 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -52,6 +52,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_customdata.h" #include "BKE_deform.h" @@ -135,7 +137,7 @@ bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name) bDeformGroup *ED_vgroup_add(Object *ob) { - return ED_vgroup_add_name(ob, "Group"); + return ED_vgroup_add_name(ob, DATA_("Group")); } void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup) diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index aa4652af0ba..05c3af40a29 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -66,12 +66,14 @@ static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op)) /* Make sure we're dealing with a canvas */ pmd = (DynamicPaintModifierData *)modifiers_findByType(cObject, eModifierType_DynamicPaint); - if (!pmd || !pmd->canvas) return OPERATOR_CANCELLED; + if (!pmd || !pmd->canvas) + return OPERATOR_CANCELLED; canvas = pmd->canvas; surface = dynamicPaint_createNewSurface(canvas, CTX_data_scene(C)); - if (!surface) return OPERATOR_CANCELLED; + if (!surface) + return OPERATOR_CANCELLED; /* set preview for this surface only and set active */ canvas->active_sur = 0; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 54f59a82adc..dc26bde6861 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -46,6 +46,8 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_animsys.h" #include "BKE_context.h" #include "BKE_curve.h" @@ -376,7 +378,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op)) ma = BKE_material_copy(ma); } else { - ma = BKE_material_add(bmain, "Material"); + ma = BKE_material_add(bmain, DATA_("Material")); if (BKE_scene_use_new_shading_nodes(scene)) { ED_node_shader_default(C, &ma->id); @@ -429,7 +431,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op)) if (tex) tex = BKE_texture_copy(tex); else - tex = add_texture(bmain, "Texture"); + tex = add_texture(bmain, DATA_("Texture")); /* hook into UI */ uiIDContextProperty(C, &ptr, &prop); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index d5d5add215c..68dd6c65e36 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3520,7 +3520,7 @@ static int scene_new_exec(bContext *C, wmOperator *op) int type = RNA_enum_get(op->ptr, "type"); if (type == SCE_COPY_NEW) { - newscene = BKE_scene_add(bmain, "Scene"); + newscene = BKE_scene_add(bmain, DATA_("Scene")); } else { /* different kinds of copying */ newscene = BKE_scene_copy(scene, type); diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 26a0d0a2fa8..c8bed8ebf11 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -506,8 +506,8 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname) Object *ob = (Object *)tselem->id; // id = object bActionGroup *grp = te->directdata; - BLI_uniquename(&ob->pose->agroups, grp, "Group", '.', offsetof(bActionGroup, name), - sizeof(grp->name)); + BLI_uniquename(&ob->pose->agroups, grp, CTX_DATA_(BLF_I18NCONTEXT_ID_ACTION, "Group"), '.', + offsetof(bActionGroup, name), sizeof(grp->name)); WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); } break; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8b21364a1cc..374aa84dfde 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2690,7 +2690,7 @@ void VIEW3D_OT_view_center_pick(wmOperatorType *ot) { /* identifiers */ ot->name = "Center View to Mouse"; - ot->description = "Center the view to the ZDepth Position under the Mouse Cursor"; + ot->description = "Center the view to the Z-depth position under the mouse cursor"; ot->idname = "VIEW3D_OT_view_center_pick"; /* api callbacks */ diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index b12c0906fa0..0c1f169935a 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -96,7 +96,8 @@ static bool uniqueOrientationNameCheck(void *arg, const char *name) static void uniqueOrientationName(ListBase *lb, char *name) { - BLI_uniquename_cb(uniqueOrientationNameCheck, lb, "Space", '.', name, sizeof(((TransformOrientation *)NULL)->name)); + BLI_uniquename_cb(uniqueOrientationNameCheck, lb, CTX_DATA_(BLF_I18NCONTEXT_ID_SCENE, "Space"), '.', name, + sizeof(((TransformOrientation *)NULL)->name)); } void BIF_createTransformOrientation(bContext *C, ReportList *reports, char *name, int use, int overwrite) |