diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-04-14 19:06:41 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-04-14 19:06:41 +0400 |
commit | 310c0b9f100bbaf0c51888808fcb9fbf11ea27f9 (patch) | |
tree | f20f590aea7163dfb3d5535d7ba3515513b0a2d8 /source/blender/editors | |
parent | 513f363ea05e9c9cf77588eb86dd4984f8aad60d (diff) |
Fixed another bunch of i18n bugs (thx to Leon Cheung for spotting them), among which:
* Drag'n'drop translation in Outliner
* "Execute" button in file window
* "Labels" of spacing elements, in multi-column enums
* A glitch with nodes "Value to RGB", they where called "ColorRamp" in node_type_base() call. This is not definitive, though, as it appears that UI node names are determined by this call, while it should be by "defines" in rna_nodetrre_types.h, I guess... Anyway, not good to have such things in two different places!
Also moved default context name under BLF_translation.h, much better to have those all in one place, accessible from whole Blender code!
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_buttons.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/SConscript | 8 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 33 | ||||
-rw-r--r-- | source/blender/editors/util/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/util/SConscript | 6 |
8 files changed, 50 insertions, 20 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 4d764bff311..d312ccf8aa1 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -223,11 +223,11 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Execute / cancel buttons. */ if (loadbutton) { - - uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, IFACE_(params->title), - max_x - loadbutton, line1_y, loadbutton, btn_h, TIP_(params->title)); + /* params->title is already translated! */ + uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title, + max_x - loadbutton, line1_y, loadbutton, btn_h, ""); uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, IFACE_("Cancel"), - max_x - loadbutton, line2_y, loadbutton, btn_h, TIP_("Cancel")); + max_x - loadbutton, line2_y, loadbutton, btn_h, ""); } uiEndBlock(C, block); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 3ed3c0690a2..55093c7e5de 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -123,7 +123,7 @@ short ED_fileselect_set_params(SpaceFile *sfile) const short is_directory= (RNA_struct_find_property(op->ptr, "directory") != NULL); const short is_relative_path= (RNA_struct_find_property(op->ptr, "relative_path") != NULL); - BLI_strncpy(params->title, op->type->name, sizeof(params->title)); + BLI_strncpy(params->title, RNA_struct_ui_name(op->type->srna), sizeof(params->title)); if (RNA_struct_find_property(op->ptr, "filemode")) params->type = RNA_int_get(op->ptr, "filemode"); diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index c67cb5f7c71..f7d517915da 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -44,6 +44,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_translation.h" + #include "BKE_context.h" #include "BKE_global.h" #include "BKE_node.h" @@ -150,7 +152,7 @@ void node_buttons_register(ARegionType *art) pt= MEM_callocN(sizeof(PanelType), "spacetype node panel active node"); strcpy(pt->idname, "NODE_PT_item"); - strcpy(pt->label, "Active Node"); + strcpy(pt->label, IFACE_("Active Node")); pt->draw= active_node_panel; pt->poll= active_node_poll; BLI_addtail(&art->paneltypes, pt); diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index 27b4a568860..5a7bbc21934 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel ../../blenlib + ../../blenfont ../../blenloader ../../imbuf ../../makesdna @@ -47,4 +48,8 @@ set(SRC outliner_intern.h ) +if(WITH_INTERNATIONAL) + add_definitions(-DWITH_INTERNATIONAL) +endif() + blender_add_lib(bf_editor_space_outliner "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_outliner/SConscript b/source/blender/editors/space_outliner/SConscript index ab0b8582d33..a6f2e3c2a5d 100644 --- a/source/blender/editors/space_outliner/SConscript +++ b/source/blender/editors/space_outliner/SConscript @@ -2,9 +2,13 @@ Import ('env') sources = env.Glob('*.c') +defs = [] -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs = '../include ../../blenlib ../../blenfont ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc ../../makesrna ../../blenloader' incs += ' #/extern/glew/include' -env.BlenderLib ( 'bf_editors_space_outliner', sources, Split(incs), [], libtype=['core'], priority=[60] ) +if env['WITH_BF_INTERNATIONAL']: + defs.append('WITH_INTERNATIONAL') + +env.BlenderLib ( 'bf_editors_space_outliner', sources, Split(incs), defines=defs, libtype=['core'], priority=[60] ) diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index c59cd626a93..981c4a5d867 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -65,6 +65,7 @@ # include <fnmatch.h> #endif +#include "BLF_translation.h" #include "BKE_animsys.h" #include "BKE_context.h" @@ -1538,7 +1539,7 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) } else { /* Menu creation */ - uiPopupMenu *pup= uiPupMenuBegin(C, "Set Parent To", ICON_NONE); + uiPopupMenu *pup= uiPupMenuBegin(C, IFACE_("Set Parent To"), ICON_NONE); uiLayout *layout= uiPupMenuLayout(pup); PointerRNA ptr; @@ -1548,7 +1549,8 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_OBJECT); /* Cannot use uiItemEnumO()... have multiple properties to set. */ - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Object", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Object"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); /* par becomes parent, make the associated menus */ if (par->type==OB_ARMATURE) { @@ -1556,57 +1558,66 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_ARMATURE); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Armature Deform", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Armature Deform"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_ARMATURE_NAME); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", " With Empty Groups", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_(" With Empty Groups"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_ARMATURE_ENVELOPE); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", " With Envelope Weights", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_(" With Envelope Weights"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_ARMATURE_AUTO); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", " With Automatic Weights", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_(" With Automatic Weights"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_BONE); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Bone", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Bone"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); } else if (par->type==OB_CURVE) { WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_CURVE); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Curve Deform", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Curve Deform"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_FOLLOW); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Follow Path", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Follow Path"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_PATH_CONST); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Path Constraint", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Path Constraint"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); } else if (par->type == OB_LATTICE) { WM_operator_properties_create(&ptr, "OUTLINER_OT_parent_drop"); RNA_string_set(&ptr, "parent", parname); RNA_string_set(&ptr, "child", childname); RNA_enum_set(&ptr, "type", PAR_LATTICE); - uiItemFullO(layout, "OUTLINER_OT_parent_drop", "Lattice Deform", 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); + uiItemFullO(layout, "OUTLINER_OT_parent_drop", IFACE_("Lattice Deform"), + 0, ptr.data, WM_OP_EXEC_DEFAULT, 0); } uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index 8eab2fda545..c13e6c16413 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -89,4 +89,8 @@ set(SRC ../include/UI_view2d.h ) +if(WITH_INTERNATIONAL) + add_definitions(-DWITH_INTERNATIONAL) +endif() + blender_add_lib(bf_editor_util "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript index 0a49c9c24a6..74879e54850 100644 --- a/source/blender/editors/util/SConscript +++ b/source/blender/editors/util/SConscript @@ -2,10 +2,14 @@ Import ('env') sources = env.Glob('*.c') +defs = [] incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../makesrna ../../bmesh' incs += ' ../../blenloader' -env.BlenderLib ( 'bf_editors_util', sources, Split(incs), [], libtype=['core','player'], priority=[330,210] ) +if env['WITH_BF_INTERNATIONAL']: + defs.append('WITH_INTERNATIONAL') + +env.BlenderLib ( 'bf_editors_util', sources, Split(incs), defines=defs, libtype=['core','player'], priority=[330,210] ) |