Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-03-20 22:42:09 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-03-20 22:42:09 +0400
commit885441e75804a92d4c2270fd006f3e71fc460d7b (patch)
tree7d3e89d07af080a2146eb747ff9da6ecd9d0e7f9 /source/blender/blenkernel/intern/object.c
parente9b0b402cc85533c8b247b174f17f41b1892ef04 (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/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c93da151463..55ec5db419d 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -65,6 +65,8 @@
#include "BLI_utildefines.h"
#include "BLI_linklist.h"
+#include "BLF_translation.h"
+
#include "BKE_pbvh.h"
#include "BKE_main.h"
#include "BKE_global.h"
@@ -855,20 +857,20 @@ void *BKE_object_obdata_add_from_type(int type)
static const char *get_obdata_defname(int type)
{
switch (type) {
- case OB_MESH: return "Mesh";
- case OB_CURVE: return "Curve";
- case OB_SURF: return "Surf";
- case OB_FONT: return "Text";
- case OB_MBALL: return "Mball";
- case OB_CAMERA: return "Camera";
- case OB_LAMP: return "Lamp";
- case OB_LATTICE: return "Lattice";
- case OB_ARMATURE: return "Armature";
- case OB_SPEAKER: return "Speaker";
- case OB_EMPTY: return "Empty";
+ case OB_MESH: return DATA_("Mesh");
+ case OB_CURVE: return DATA_("Curve");
+ case OB_SURF: return DATA_("Surf");
+ case OB_FONT: return DATA_("Text");
+ case OB_MBALL: return DATA_("Mball");
+ case OB_CAMERA: return DATA_("Camera");
+ case OB_LAMP: return DATA_("Lamp");
+ case OB_LATTICE: return DATA_("Lattice");
+ case OB_ARMATURE: return DATA_("Armature");
+ case OB_SPEAKER: return DATA_("Speaker");
+ case OB_EMPTY: return DATA_("Empty");
default:
printf("get_obdata_defname: Internal error, bad type: %d\n", type);
- return "Empty";
+ return DATA_("Empty");
}
}