diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-20 14:07:46 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-20 14:07:46 +0400 |
commit | 9a2f36b50f818c0c1b659363a1df298f7043e207 (patch) | |
tree | 29356fc32cdf7faba05e099e67e3da5adf349c39 /source/blender/editors | |
parent | 558d549aeb2ec7da41d31986707774eae0821da8 (diff) |
handle SpaceType and UserPref popups
Diffstat (limited to 'source/blender/editors')
19 files changed, 130 insertions, 179 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index e2bfedcf3ea..6a35ba9baf1 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -217,9 +217,9 @@ static int reset_default_theme_exec(bContext *C, wmOperator *UNUSED(op)) static void UI_OT_reset_default_theme(wmOperatorType *ot) { /* identifiers */ - ot->name= "Reset to Default Theme"; + ot->name= _("Reset to Default Theme"); ot->idname= "UI_OT_reset_default_theme"; - ot->description= "Reset to the default theme colors"; + ot->description= _("Reset to the default theme colors"); /* callbacks */ ot->exec= reset_default_theme_exec; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 9ebf7c9cd4f..64280bbda03 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -351,39 +351,14 @@ void uiStyleInit(void) /* XXX Maybe it's bad to do this */ if(style==NULL) { - if( strcmp(lang_set,"hr.UTF-8")==0 - || strcmp(lang_set,"ar.UTF-8")==0 - || strcmp(lang_set,"bg.UTF-8")==0 - || strcmp(lang_set,"ca.UTF-8")==0 - || strcmp(lang_set,"cs.UTF-8")==0 - || strcmp(lang_set,"de.UTF-8")==0 - || strcmp(lang_set,"el.UTF-8")==0 - || strcmp(lang_set,"es.UTF-8")==0 - || strcmp(lang_set,"fi.UTF-8")==0 - || strcmp(lang_set,"fr.UTF-8")==0 - || strcmp(lang_set,"it.UTF-8")==0 - || strcmp(lang_set,"ja.UTF-8")==0 - || strcmp(lang_set,"ko.UTF-8")==0 - || strcmp(lang_set,"pl.UTF-8")==0 - || strcmp(lang_set,"ro.UTF-8")==0 - || strcmp(lang_set,"ru.UTF-8")==0 - || strcmp(lang_set,"sr.UTF-8")==0 - || strcmp(lang_set,"sv.UTF-8")==0 - || strcmp(lang_set,"uk.UTF-8")==0 - || strcmp(lang_set,"zh_CN.UTF-8")==0 - ) + // load unifont only when need. It takes 15MB memories + // get_datatoc_bunifont_ttf() may return null, BLF_load_mem_unique() will handle it + if( blf_unifont == -1 ) + blf_unifont= BLF_load_mem_unique("unifont", (unsigned char *)get_datatoc_bunifont_ttf(), datatoc_bunifont_ttf_size); + if( blf_unifont != -1 ) { - // load unifont only when need. It takes 15MB memories - // get_datatoc_bunifont_ttf() may return null, BLF_load_mem_unique() will handle it - if( blf_unifont == -1 ) - blf_unifont= BLF_load_mem_unique("unifont", (unsigned char *)get_datatoc_bunifont_ttf(), datatoc_bunifont_ttf_size); - if( blf_unifont != -1 ) - { - BLF_size(blf_unifont, 12, 72); - ui_style_new(&U.uistyles, "Unifont Style", blf_unifont ); - } - else - ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT ); + BLF_size(blf_unifont, 12, 72); + ui_style_new(&U.uistyles, "Unifont Style", blf_unifont ); } else ui_style_new(&U.uistyles, "Default Style", UIFONT_DEFAULT ); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index bbd1bd8773b..625ca4c70ec 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1288,10 +1288,10 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand if(coba==NULL) return; - bt= uiDefBut(block, BUT, 0, "Add", 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband"); + bt= uiDefBut(block, BUT, 0, _("Add"), 0+xoffs,line1_y,40,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Add a new color stop to the colorband"); uiButSetNFunc(bt, colorband_add_cb, MEM_dupallocN(cb), coba); - bt= uiDefBut(block, BUT, 0, "Delete", 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position"); + bt= uiDefBut(block, BUT, 0, _("Delete"), 45+xoffs,line1_y,45,UI_UNIT_Y, NULL, 0, 0, 0, 0, "Delete the active position"); uiButSetNFunc(bt, colorband_del_cb, MEM_dupallocN(cb), coba); @@ -1301,8 +1301,8 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand uiDefButS(block, NUM, 0, "", 120+xoffs,line1_y,80, UI_UNIT_Y, &coba->cur, 0.0, (float)(MAX2(0, coba->tot-1)), 0, 0, "Choose active color stop"); - bt= uiDefButS(block, MENU, 0, "Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4", - 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, "Set interpolation between color stops"); + bt= uiDefButS(block, MENU, 0, _("Interpolation %t|Ease %x1|Cardinal %x3|Linear %x0|B-Spline %x2|Constant %x4"), + 210+xoffs, line1_y, 90, UI_UNIT_Y, &coba->ipotype, 0.0, 0.0, 0, 0, _("Set interpolation between color stops")); uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL); uiBlockEndAlign(block); diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index bd7d6c826a8..321ac8be102 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -351,7 +351,7 @@ void OBJECT_OT_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", object_type_items, 0, "Type", ""); + RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(object_type_items), 0, "Type", ""); ED_object_add_generic_props(ot, TRUE); } @@ -443,7 +443,7 @@ void OBJECT_OT_effector_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - ot->prop= RNA_def_enum(ot->srna, "type", field_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(field_type_items), 0, "Type", ""); ED_object_add_generic_props(ot, TRUE); } @@ -575,7 +575,7 @@ void OBJECT_OT_metaball_add(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_enum(ot->srna, "type", metaelem_type_items, 0, "Primitive", ""); + RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(metaelem_type_items), 0, "Primitive", ""); ED_object_add_generic_props(ot, TRUE); } @@ -708,16 +708,16 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) void OBJECT_OT_lamp_add(wmOperatorType *ot) { static EnumPropertyItem lamp_type_items[] = { - {LA_LOCAL, "POINT", ICON_LAMP_POINT, "Point", "Omnidirectional point light source"}, - {LA_SUN, "SUN", ICON_LAMP_SUN, "Sun", "Constant direction parallel ray light source"}, - {LA_SPOT, "SPOT", ICON_LAMP_SPOT, "Spot", "Directional cone light source"}, - {LA_HEMI, "HEMI", ICON_LAMP_HEMI, "Hemi", "180 degree constant light source"}, - {LA_AREA, "AREA", ICON_LAMP_AREA, "Area", "Directional area light source"}, + {LA_LOCAL, "POINT", ICON_LAMP_POINT, N_("Point"), N_("Omnidirectional point light source")}, + {LA_SUN, "SUN", ICON_LAMP_SUN, N_("Sun"), N_("Constant direction parallel ray light source")}, + {LA_SPOT, "SPOT", ICON_LAMP_SPOT, N_("Spot"), N_("Directional cone light source")}, + {LA_HEMI, "HEMI", ICON_LAMP_HEMI, N_("Hemi"), N_("180 degree constant light source")}, + {LA_AREA, "AREA", ICON_LAMP_AREA, N_("Area"), N_("Directional area light source")}, {0, NULL, 0, NULL, NULL}}; /* identifiers */ - ot->name= "Add Lamp"; - ot->description = "Add a lamp object to the scene"; + ot->name= _("Add Lamp"); + ot->description = _("Add a lamp object to the scene"); ot->idname= "OBJECT_OT_lamp_add"; /* api callbacks */ @@ -729,7 +729,7 @@ void OBJECT_OT_lamp_add(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", lamp_type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(lamp_type_items), 0, "Type", ""); ED_object_add_generic_props(ot, FALSE); } @@ -1019,8 +1019,8 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) { /* identifiers */ - ot->name= "Make Duplicates Real"; - ot->description = "Make dupli objects attached to this object real"; + ot->name= _("Make Duplicates Real"); + ot->description = _("Make dupli objects attached to this object real"); ot->idname= "OBJECT_OT_duplicates_make_real"; /* api callbacks */ @@ -1035,8 +1035,8 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot) /**************************** Convert **************************/ static EnumPropertyItem convert_target_items[]= { - {OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve from Mesh/Text", ""}, - {OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, "Mesh from Curve/Meta/Surf/Text", ""}, + {OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, N_("Curve from Mesh/Text"), ""}, + {OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, N_("Mesh from Curve/Meta/Surf/Text"), ""}, {0, NULL, 0, NULL, NULL}}; static void curvetomesh(Scene *scene, Object *ob) @@ -1397,7 +1397,7 @@ void OBJECT_OT_convert(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "target", convert_target_items, OB_MESH, _("Target"), _("Type of object to convert to")); + ot->prop= RNA_def_enum(ot->srna, "target", RNA_enum_items_gettexted(convert_target_items), OB_MESH, _("Target"), _("Type of object to convert to")); RNA_def_boolean(ot->srna, "keep_original", 0, _("Keep Original"), _("Keep original objects instead of replacing them")); } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 14213a0f191..89ac7800c0f 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1048,9 +1048,9 @@ static int object_constraints_clear_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_constraints_clear(wmOperatorType *ot) { /* identifiers */ - ot->name = "Clear Object Constraints"; + ot->name = _("Clear Object Constraints"); ot->idname= "OBJECT_OT_constraints_clear"; - ot->description= "Clear all the constraints for the active Object only"; + ot->description= _("Clear all the constraints for the active Object only"); /* callbacks */ ot->exec= object_constraints_clear_exec; @@ -1094,9 +1094,9 @@ static int pose_constraint_copy_exec(bContext *C, wmOperator *op) void POSE_OT_constraints_copy(wmOperatorType *ot) { /* identifiers */ - ot->name= "Copy Constraints to Selected"; + ot->name= _("Copy Constraints to Selected"); ot->idname= "POSE_OT_constraints_copy"; - ot->description = "Copy constraints to other selected bones."; + ot->description = _("Copy constraints to other selected bones."); /* api callbacks */ ot->exec= pose_constraint_copy_exec; @@ -1130,9 +1130,9 @@ static int object_constraint_copy_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_constraints_copy(wmOperatorType *ot) { /* identifiers */ - ot->name= "Copy Constraints to Selected"; + ot->name= _("Copy Constraints to Selected"); ot->idname= "OBJECT_OT_constraints_copy"; - ot->description = "Copy constraints to other selected objects."; + ot->description = _("Copy constraints to other selected objects."); /* api callbacks */ ot->exec= object_constraint_copy_exec; @@ -1442,8 +1442,8 @@ static int pose_constraint_add_exec(bContext *C, wmOperator *op) void OBJECT_OT_constraint_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Constraint"; - ot->description = "Add a constraint to the active object"; + ot->name= _("Add Constraint"); + ot->description = _("Add a constraint to the active object"); ot->idname= "OBJECT_OT_constraint_add"; /* api callbacks */ @@ -1461,8 +1461,8 @@ void OBJECT_OT_constraint_add(wmOperatorType *ot) void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Constraint (with Targets)"; - ot->description = "Add a constraint to the active object, with target (where applicable) set to the selected Objects/Bones"; + ot->name= _("Add Constraint (with Targets)"); + ot->description = _("Add a constraint to the active object, with target (where applicable) set to the selected Objects/Bones"); ot->idname= "OBJECT_OT_constraint_add_with_targets"; /* api callbacks */ @@ -1480,8 +1480,8 @@ void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) void POSE_OT_constraint_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Constraint"; - ot->description = "Add a constraint to the active bone"; + ot->name= _("Add Constraint"); + ot->description = _("Add a constraint to the active bone"); ot->idname= "POSE_OT_constraint_add"; /* api callbacks */ @@ -1499,8 +1499,8 @@ void POSE_OT_constraint_add(wmOperatorType *ot) void POSE_OT_constraint_add_with_targets(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Constraint (with Targets)"; - ot->description = "Add a constraint to the active bone, with target (where applicable) set to the selected Objects/Bones"; + ot->name= _("Add Constraint (with Targets)"); + ot->description = _("Add a constraint to the active bone, with target (where applicable) set to the selected Objects/Bones"); ot->idname= "POSE_OT_constraint_add_with_targets"; /* api callbacks */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 21e636e3340..1fc7c02fd74 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -2216,7 +2216,7 @@ static int game_property_clear_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_game_property_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Clear Game Property"; + ot->name= _("Clear Game Property"); ot->idname= "OBJECT_OT_game_property_clear"; /* api callbacks */ diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index b1ab68ff087..11883ec56e4 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -37,6 +37,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "DNA_group_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" @@ -95,8 +97,8 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) void GROUP_OT_objects_add_active(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add Selected To Active Group"; - ot->description = "Add the object to an object group that contains the active object"; + ot->name= _("Add Selected To Active Group"); + ot->description = _("Add the object to an object group that contains the active object"); ot->idname= "GROUP_OT_objects_add_active"; /* api callbacks */ @@ -142,8 +144,8 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) void GROUP_OT_objects_remove_active(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove Selected From Active Group"; - ot->description = "Remove the object from an object group that contains the active object"; + ot->name= _("Remove Selected From Active Group"); + ot->description = _("Remove the object from an object group that contains the active object"); ot->idname= "GROUP_OT_objects_remove_active"; /* api callbacks */ @@ -176,8 +178,8 @@ static int group_objects_remove_exec(bContext *C, wmOperator *UNUSED(op)) void GROUP_OT_objects_remove(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove From Groups"; - ot->description = "Remove selected objects from all groups"; + ot->name= _("Remove From Groups"); + ot->description = _("Remove selected objects from all groups"); ot->idname= "GROUP_OT_objects_remove"; /* api callbacks */ @@ -213,8 +215,8 @@ static int group_create_exec(bContext *C, wmOperator *op) void GROUP_OT_create(wmOperatorType *ot) { /* identifiers */ - ot->name= "Create New Group"; - ot->description = "Create an object group from selected objects"; + ot->name= _("Create New Group"); + ot->description = _("Create an object group from selected objects"); ot->idname= "GROUP_OT_create"; /* api callbacks */ @@ -249,9 +251,9 @@ static int group_add_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_group_add(wmOperatorType *ot) { /* identifiers */ - ot->name= "Add to Group"; + ot->name= _("Add to Group"); ot->idname= "OBJECT_OT_group_add"; - ot->description = "Add an object to a new group"; + ot->description = _("Add an object to a new group"); /* api callbacks */ ot->exec= group_add_exec; @@ -281,9 +283,9 @@ void OBJECT_OT_group_link(wmOperatorType *ot) PropertyRNA *prop; /* identifiers */ - ot->name= "Link to Group"; + ot->name= _("Link to Group"); ot->idname= "OBJECT_OT_group_link"; - ot->description = "Add an object to an existing group"; + ot->description = _("Add an object to an existing group"); /* api callbacks */ ot->exec= group_link_exec; @@ -317,7 +319,7 @@ static int group_remove_exec(bContext *C, wmOperator *UNUSED(op)) void OBJECT_OT_group_remove(wmOperatorType *ot) { /* identifiers */ - ot->name= "Remove Group"; + ot->name= _("Remove Group"); ot->idname= "OBJECT_OT_group_remove"; /* api callbacks */ diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 5fc33c6836d..e6a3df57c2d 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -228,7 +228,7 @@ void ED_operatormacros_object(void) } /* grr, should be able to pass options on... */ - ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", "Duplicate Linked", OPTYPE_UNDO|OPTYPE_REGISTER); + ot= WM_operatortype_append_macro("OBJECT_OT_duplicate_move_linked", _("Duplicate Linked"), OPTYPE_UNDO|OPTYPE_REGISTER); if(ot) { otmacro= WM_operatortype_macro_define(ot, "OBJECT_OT_duplicate"); RNA_boolean_set(otmacro->ptr, "linked", 1); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index cae78dcbccd..15dc040d58f 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1322,7 +1322,7 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot) /* identifiers */ ot->name= "Link Objects to Scene"; - ot->description = "Make linked data local to each object"; + ot->description = _("Make linked data local to each object"); ot->idname= "OBJECT_OT_make_links_scene"; /* api callbacks */ @@ -1334,7 +1334,7 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, "Scene", ""); + prop= RNA_def_enum(ot->srna, "scene", DummyRNA_NULL_items, 0, _("Scene"), ""); RNA_def_enum_funcs(prop, RNA_scene_local_itemf); ot->prop= prop; } @@ -1342,11 +1342,11 @@ void OBJECT_OT_make_links_scene(wmOperatorType *ot) void OBJECT_OT_make_links_data(wmOperatorType *ot) { static EnumPropertyItem make_links_items[]= { - {MAKE_LINKS_OBDATA, "OBDATA", 0, "Object Data", ""}, - {MAKE_LINKS_MATERIALS, "MATERIAL", 0, "Materials", ""}, - {MAKE_LINKS_ANIMDATA, "ANIMATION", 0, "Animation Data", ""}, - {MAKE_LINKS_DUPLIGROUP, "DUPLIGROUP", 0, "DupliGroup", ""}, - {MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, "Modifiers", ""}, + {MAKE_LINKS_OBDATA, "OBDATA", 0, N_("Object Data"), ""}, + {MAKE_LINKS_MATERIALS, "MATERIAL", 0, N_("Materials"), ""}, + {MAKE_LINKS_ANIMDATA, "ANIMATION", 0, N_("Animation Data"), ""}, + {MAKE_LINKS_DUPLIGROUP, "DUPLIGROUP", 0, N_("DupliGroup"), ""}, + {MAKE_LINKS_MODIFIERS, "MODIFIERS", 0, N_("Modifiers"), ""}, {0, NULL, 0, NULL, NULL}}; /* identifiers */ @@ -1362,7 +1362,7 @@ void OBJECT_OT_make_links_data(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", make_links_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(make_links_items), 0, "Type", ""); } @@ -1785,9 +1785,9 @@ static int make_local_exec(bContext *C, wmOperator *op) void OBJECT_OT_make_local(wmOperatorType *ot) { static EnumPropertyItem type_items[]= { - {1, "SELECTED_OBJECTS", 0, "Selected Objects", ""}, - {2, "SELECTED_OBJECTS_DATA", 0, "Selected Objects and Data", ""}, - {3, "ALL", 0, "All", ""}, + {1, "SELECTED_OBJECTS", 0, N_("Selected Objects"), ""}, + {2, "SELECTED_OBJECTS_DATA", 0, N_("Selected Objects and Data"), ""}, + {3, "ALL", 0, N_("All"), ""}, {0, NULL, 0, NULL, NULL}}; /* identifiers */ @@ -1804,7 +1804,7 @@ void OBJECT_OT_make_local(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - ot->prop= RNA_def_enum(ot->srna, "type", type_items, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(type_items), 0, "Type", ""); } static int make_single_user_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 3c2d46872cd..3492eda742a 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -166,20 +166,20 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", FALSE, _("Extend"), _("Extend selection instead of deselecting everything first.")); - ot->prop= RNA_def_enum(ot->srna, "type", object_type_items, 1, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(object_type_items), 1, "Type", ""); } /*********************** Selection by Links *********************/ static EnumPropertyItem prop_select_linked_types[] = { //{1, "IPO", 0, "Object IPO", ""}, // XXX depreceated animation system stuff... - {2, "OBDATA", 0, "Object Data", ""}, - {3, "MATERIAL", 0, "Material", ""}, - {4, "TEXTURE", 0, "Texture", ""}, - {5, "DUPGROUP", 0, "Dupligroup", ""}, - {6, "PARTICLE", 0, "Particle System", ""}, - {7, "LIBRARY", 0, "Library", ""}, - {8, "LIBRARY_OBDATA", 0, "Library (Object Data)", ""}, + {2, "OBDATA", 0, N_("Object Data"), ""}, + {3, "MATERIAL", 0, N_("Material"), ""}, + {4, "TEXTURE", 0, N_("Texture"), ""}, + {5, "DUPGROUP", 0, N_("Dupligroup"), ""}, + {6, "PARTICLE", 0, N_("Particle System"), ""}, + {7, "LIBRARY", 0, N_("Library"), ""}, + {8, "LIBRARY_OBDATA", 0, N_("Library (Object Data)"), ""}, {0, NULL, 0, NULL, NULL} }; @@ -348,23 +348,23 @@ void OBJECT_OT_select_linked(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", FALSE, _("Extend"), _("Extend selection instead of deselecting everything first.")); - ot->prop= RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_select_linked_types), 0, "Type", ""); } /*********************** Selected Grouped ********************/ static EnumPropertyItem prop_select_grouped_types[] = { - {1, "CHILDREN_RECURSIVE", 0, "Children", ""}, - {2, "CHILDREN", 0, "Immediate Children", ""}, - {3, "PARENT", 0, "Parent", ""}, - {4, "SIBLINGS", 0, "Siblings", "Shared Parent"}, - {5, "TYPE", 0, "Type", "Shared object type"}, - {6, "LAYER", 0, "Layer", "Shared layers"}, - {7, "GROUP", 0, "Group", "Shared group"}, - {8, "HOOK", 0, "Hook", ""}, - {9, "PASS", 0, "Pass", "Render pass Index"}, - {10, "COLOR", 0, "Color", "Object Color"}, - {11, "PROPERTIES", 0, "Properties", "Game Properties"}, + {1, "CHILDREN_RECURSIVE", 0, N_("Children"), ""}, + {2, "CHILDREN", 0, N_("Immediate Children"), ""}, + {3, "PARENT", 0, N_("Parent"), ""}, + {4, "SIBLINGS", 0, N_("Siblings"), N_("Shared Parent")}, + {5, "TYPE", 0, N_("Type"), N_("Shared object type")}, + {6, "LAYER", 0, N_("Layer"), N_("Shared layers")}, + {7, "GROUP", 0, N_("Group"), N_("Shared group")}, + {8, "HOOK", 0, N_("Hook"), ""}, + {9, "PASS", 0, N_("Pass"), N_("Render pass Index")}, + {10, "COLOR", 0, N_("Color"), N_("Object Color")}, + {11, "PROPERTIES", 0, N_("Properties"), N_("Game Properties")}, {0, NULL, 0, NULL, NULL} }; @@ -636,7 +636,7 @@ void OBJECT_OT_select_grouped(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "extend", FALSE, _("Extend"), _("Extend selection instead of deselecting everything first.")); - ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_select_grouped_types), 0, "Type", ""); } /************************* Select by Layer **********************/ diff --git a/source/blender/editors/render/render_view.c b/source/blender/editors/render/render_view.c index 9dfcde6ed0d..21c820a1e07 100644 --- a/source/blender/editors/render/render_view.c +++ b/source/blender/editors/render/render_view.c @@ -36,6 +36,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "DNA_scene_types.h" #include "BKE_blender.h" @@ -347,8 +349,8 @@ static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent void RENDER_OT_view_show(struct wmOperatorType *ot) { /* identifiers */ - ot->name= "Show/Hide Render View"; - ot->description= "Toggle show render view"; + ot->name= _("Show/Hide Render View"); + ot->description= _("Toggle show render view"); ot->idname= "RENDER_OT_view_show"; /* api callbacks */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index a1ba861f477..904c8235a32 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1173,41 +1173,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa) static const char *editortype_pup(void) { - return( - "Editor type:%t" - "|3D View %x1" - - "|%l" - - "|Timeline %x15" - "|Graph Editor %x2" - "|DopeSheet %x12" - "|NLA Editor %x13" - - "|%l" - - "|UV/Image Editor %x6" - - "|Video Sequence Editor %x8" - "|Text Editor %x9" - "|Node Editor %x16" - "|Logic Editor %x17" - - "|%l" - - "|Properties %x4" - "|Outliner %x3" - "|User Preferences %x19" - "|Info%x7" - - "|%l" - - "|File Browser %x5" - - "|%l" - - "|Python Console %x18" - ); + return _("Editor type:%t|3D View %x1|%l|Timeline %x15|Graph Editor %x2|DopeSheet %x12|NLA Editor %x13|%l|UV/Image Editor %x6|Video Sequence Editor %x8|Text Editor %x9|Node Editor %x16|Logic Editor %x17|%l|Properties %x4|Outliner %x3|User Preferences %x19|Info%x7|%l|File Browser %x5|%l|Python Console %x18"); } static void spacefunc(struct bContext *C, void *UNUSED(arg1), void *UNUSED(arg2)) diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 549a547b846..a7891db466a 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -52,6 +52,8 @@ #include "BLI_rand.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "BKE_action.h" #include "BKE_context.h" #include "BKE_curve.h" @@ -1469,8 +1471,8 @@ static int view3d_properties(bContext *C, wmOperator *UNUSED(op)) void VIEW3D_OT_properties(wmOperatorType *ot) { - ot->name= "Properties"; - ot->description= "Toggles the properties panel display"; + ot->name= _("Properties"); + ot->description= _("Toggles the properties panel display"); ot->idname= "VIEW3D_OT_properties"; ot->exec= view3d_properties; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8cef69fdaba..491bc4c1964 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2515,12 +2515,11 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot) RNA_def_boolean(ot->srna, "align_active", 0, _("Align Active"), _("Align to the active objects axis")); } -/* XXX add _() for strings */ static EnumPropertyItem prop_view_orbit_items[] = { - {V3D_VIEW_STEPLEFT, "ORBITLEFT", 0, "Orbit Left", "Orbit the view around to the Left"}, - {V3D_VIEW_STEPRIGHT, "ORBITRIGHT", 0, "Orbit Right", "Orbit the view around to the Right"}, - {V3D_VIEW_STEPUP, "ORBITUP", 0, "Orbit Up", "Orbit the view Up"}, - {V3D_VIEW_STEPDOWN, "ORBITDOWN", 0, "Orbit Down", "Orbit the view Down"}, + {V3D_VIEW_STEPLEFT, "ORBITLEFT", 0, N_("Orbit Left"), N_("Orbit the view around to the Left")}, + {V3D_VIEW_STEPRIGHT, "ORBITRIGHT", 0, N_("Orbit Right"), N_("Orbit the view around to the Right")}, + {V3D_VIEW_STEPUP, "ORBITUP", 0, N_("Orbit Up"), N_("Orbit the view Up")}, + {V3D_VIEW_STEPDOWN, "ORBITDOWN", 0, N_("Orbit Down"), N_("Orbit the view Down")}, {0, NULL, 0, NULL, NULL}}; static int vieworbit_exec(bContext *C, wmOperator *op) @@ -2580,15 +2579,15 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot) /* flags */ ot->flag= 0; - RNA_def_enum(ot->srna, "type", prop_view_orbit_items, 0, "Orbit", "Direction of View Orbit"); + RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_view_orbit_items), 0, "Orbit", "Direction of View Orbit"); } /* XXX add _() for strings */ static EnumPropertyItem prop_view_pan_items[] = { - {V3D_VIEW_PANLEFT, "PANLEFT", 0, "Pan Left", "Pan the view to the Left"}, - {V3D_VIEW_PANRIGHT, "PANRIGHT", 0, "Pan Right", "Pan the view to the Right"}, - {V3D_VIEW_PANUP, "PANUP", 0, "Pan Up", "Pan the view Up"}, - {V3D_VIEW_PANDOWN, "PANDOWN", 0, "Pan Down", "Pan the view Down"}, + {V3D_VIEW_PANLEFT, "PANLEFT", 0, N_("Pan Left"), N_("Pan the view to the Left")}, + {V3D_VIEW_PANRIGHT, "PANRIGHT", 0, N_("Pan Right"), N_("Pan the view to the Right")}, + {V3D_VIEW_PANUP, "PANUP", 0, N_("Pan Up"), N_("Pan the view Up")}, + {V3D_VIEW_PANDOWN, "PANDOWN", 0, N_("Pan Down"), N_("Pan the view Down")}, {0, NULL, 0, NULL, NULL}}; static int viewpan_exec(bContext *C, wmOperator *op) @@ -2629,7 +2628,7 @@ void VIEW3D_OT_view_pan(wmOperatorType *ot) /* flags */ ot->flag= 0; - RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan"); + RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_view_pan_items), 0, "Pan", "Direction of View Pan"); } static int viewpersportho_exec(bContext *C, wmOperator *UNUSED(op)) diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index ed1ed5b3881..604b0f155ff 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -39,6 +39,8 @@ #include "BLI_blenlib.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "BKE_context.h" #include "BKE_object.h" #include "BKE_report.h" @@ -932,8 +934,8 @@ static int fly_modal(bContext *C, wmOperator *op, wmEvent *event) void VIEW3D_OT_fly(wmOperatorType *ot) { /* identifiers */ - ot->name= "Fly Navigation"; - ot->description= "Interactively fly around the scene"; + ot->name= _("Fly Navigation"); + ot->description= _("Interactively fly around the scene"); ot->idname= "VIEW3D_OT_fly"; /* api callbacks */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 05975052913..13a7dc968cb 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1812,8 +1812,8 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) void VIEW3D_OT_select_border(wmOperatorType *ot) { /* identifiers */ - ot->name= "Border Select"; - ot->description= "Select items using border selection"; + ot->name= _("Border Select"); + ot->description= _("Select items using border selection"); ot->idname= "VIEW3D_OT_select_border"; /* api callbacks */ @@ -2293,8 +2293,8 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) void VIEW3D_OT_select_circle(wmOperatorType *ot) { - ot->name= "Circle Select"; - ot->description= "Select items using circle selection"; + ot->name= _("Circle Select"); + ot->description= _("Select items using circle selection"); ot->idname= "VIEW3D_OT_select_circle"; ot->invoke= WM_gesture_circle_invoke; diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index 8e5415945c7..f67056f5b71 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -21,6 +21,7 @@ set(INC ../include + ../../blenfont ../../blenkernel ../../blenloader ../../blenlib diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript index a694b211ca4..cfbf1c83079 100644 --- a/source/blender/editors/util/SConscript +++ b/source/blender/editors/util/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../makesrna' incs += ' ../../blenloader' diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 24a868891de..5d726e2c844 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -46,6 +46,8 @@ #include "BLI_dynstr.h" #include "BLI_utildefines.h" +#include "BLF_api.h" + #include "BKE_blender.h" #include "BKE_context.h" #include "BKE_global.h" @@ -288,8 +290,8 @@ static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op)) void ED_OT_undo(wmOperatorType *ot) { /* identifiers */ - ot->name= "Undo"; - ot->description= "Undo previous action"; + ot->name= _("Undo"); + ot->description= _("Undo previous action"); ot->idname= "ED_OT_undo"; /* api callbacks */ @@ -315,8 +317,8 @@ void ED_OT_undo_push(wmOperatorType *ot) void ED_OT_redo(wmOperatorType *ot) { /* identifiers */ - ot->name= "Redo"; - ot->description= "Redo previous action"; + ot->name= _("Redo"); + ot->description= _("Redo previous action"); ot->idname= "ED_OT_redo"; /* api callbacks */ @@ -507,8 +509,8 @@ static int undo_history_exec(bContext *C, wmOperator *op) void ED_OT_undo_history(wmOperatorType *ot) { /* identifiers */ - ot->name= "Undo History"; - ot->description= "Redo specific action in history"; + ot->name= _("Undo History"); + ot->description= _("Redo specific action in history"); ot->idname= "ED_OT_undo_history"; /* api callbacks */ |