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/object/object_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/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 312cceac77d..1cc428b3deb 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, "CurveGuide"); + rename_id(&ob->id, DATA_("CurveGuide")); ((Curve *)ob->data)->flag |= CU_PATH | CU_3D; ED_object_enter_editmode(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, "Field"); + rename_id(&ob->id, DATA_("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 "Point"; - case LA_SUN: return "Sun"; - case LA_SPOT: return "Spot"; - case LA_HEMI: return "Hemi"; - case LA_AREA: return "Area"; + 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"); default: - return "Lamp"; + return DATA_("Lamp"); } } @@ -980,7 +980,7 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op) BKE_nlatrack_add_strip(nlt, strip); /* auto-name the strip, and give the track an interesting name */ - strcpy(nlt->name, "SoundTrack"); + strcpy(nlt->name, DATA_("SoundTrack")); BKE_nlastrip_validate_name(adt, strip); WM_event_add_notifier(C, NC_ANIMATION | ND_NLA | NA_EDITED, NULL); |