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/blenkernel/intern/constraint.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/blenkernel/intern/constraint.c')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 3430c2ea7a1..dc47ff40863 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -43,6 +43,8 @@ #include "BLI_kdopbvh.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "DNA_armature_types.h" #include "DNA_camera_types.h" #include "DNA_constraint_types.h" @@ -4353,12 +4355,12 @@ static bConstraint *add_new_constraint_internal(const char *name, short type) cti->new_data(con->data); /* if no name is provided, use the type of the constraint as the name */ - newName = (name && name[0]) ? name : cti->name; + newName = (name && name[0]) ? name : DATA_(cti->name); } else { /* if no name is provided, use the generic "Const" name */ /* NOTE: any constraint type that gets here really shouldn't get added... */ - newName = (name && name[0]) ? name : "Const"; + newName = (name && name[0]) ? name : DATA_("Const"); } /* copy the name */ |