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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2012-04-13 23:59:29 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-04-13 23:59:29 +0400
commit4c1c092fb95f1ee8edf05e91280e0ac71521ccd1 (patch)
tree4daf9b26b2218a0663106b8a36d54aaa640d6ae2 /source
parent455b8212b6f64184979a292247bebd081a1e75d9 (diff)
Fixed (or partly fixed) various missing UI translations, mainly with some specific ops invocations (popup menus…), and (to some extent) with the undo/redo stuff.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_layout.c10
-rw-r--r--source/blender/editors/interface/interface_regions.c31
-rw-r--r--source/blender/editors/util/CMakeLists.txt1
-rw-r--r--source/blender/editors/util/SConscript2
-rw-r--r--source/blender/editors/util/undo.c8
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c10
6 files changed, 35 insertions, 27 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 58b54fef0df..e772d98f860 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1500,7 +1500,7 @@ void uiItemM(uiLayout *layout, bContext *UNUSED(C), const char *menuname, const
if (layout->root->type == UI_LAYOUT_MENU && !icon)
icon = ICON_BLANK1;
- ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL, mt->description);
+ ui_item_menu(layout, name, icon, ui_item_menutype_func, mt, NULL, TIP_(mt->description));
}
/* label item */
@@ -1618,7 +1618,7 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname,
}
if (!name)
- name = ot->name;
+ name = RNA_struct_ui_name(ot->srna);
if (layout->root->type == UI_LAYOUT_MENU && !icon)
icon = ICON_BLANK1;
@@ -1627,7 +1627,7 @@ void uiItemMenuEnumO(uiLayout *layout, const char *opname, const char *propname,
BLI_strncpy(lvl->propname, propname, sizeof(lvl->propname));
lvl->opcontext = layout->root->opcontext;
- ui_item_menu(layout, name, icon, menu_item_enum_opname_menu, NULL, lvl, ot->description);
+ ui_item_menu(layout, name, icon, menu_item_enum_opname_menu, NULL, lvl, RNA_struct_ui_description(ot->srna));
}
static void menu_item_enum_rna_menu(bContext *UNUSED(C), uiLayout *layout, void *arg)
@@ -2830,14 +2830,14 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op, i
}
if (flag & UI_LAYOUT_OP_SHOW_TITLE) {
- uiItemL(layout, op->type->name, ICON_NONE);
+ uiItemL(layout, RNA_struct_ui_name(op->type->srna), ICON_NONE);
}
/* poll() on this operator may still fail, at the moment there is no nice feedback when this happens
* just fails silently */
if (!WM_operator_repeat_check(C, op)) {
uiBlockSetButLock(uiLayoutGetBlock(layout), TRUE, "Operator cannot redo");
- uiItemL(layout, "* Redo Unsupported *", ICON_NONE); // XXX, could give some nicer feedback or not show redo panel at all?
+ uiItemL(layout, IFACE_("* Redo Unsupported *"), ICON_NONE); // XXX, could give some nicer feedback or not show redo panel at all?
}
/* menu */
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 7c012204739..9bcda7d86ed 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -2068,12 +2068,13 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
butwidth = width - UI_UNIT_X - 10;
/* existence of profile means storage is in linear color space, with display correction */
+ /* XXX That tip message is not use anywhere! */
if (block->color_profile == BLI_PR_NONE) {
- BLI_strncpy(tip, "Value in Display Color Space", sizeof(tip));
+ BLI_strncpy(tip, N_("Value in Display Color Space"), sizeof(tip));
copy_v3_v3(rgb_gamma, rgba);
}
else {
- BLI_strncpy(tip, "Value in Linear RGB Color Space", sizeof(tip));
+ BLI_strncpy(tip, N_("Value in Linear RGB Color Space"), sizeof(tip));
/* make an sRGB version, for Hex code */
linearrgb_to_srgb_v3_v3(rgb_gamma, rgba);
}
@@ -2101,11 +2102,11 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
/* mode */
uiBlockBeginAlign(block);
- bt = uiDefButS(block, ROW, 0, "RGB", 0, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 0.0, 0, 0, "");
+ bt = uiDefButS(block, ROW, 0, IFACE_("RGB"), 0, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 0.0, 0, 0, "");
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
- bt = uiDefButS(block, ROW, 0, "HSV", width / 3, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 1.0, 0, 0, "");
+ bt = uiDefButS(block, ROW, 0, IFACE_("HSV"), width / 3, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 1.0, 0, 0, "");
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
- bt = uiDefButS(block, ROW, 0, "Hex", 2 * width / 3, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 2.0, 0, 0, "");
+ bt = uiDefButS(block, ROW, 0, IFACE_("Hex"), 2 * width / 3, -30, width / 3, UI_UNIT_Y, &colormode, 0.0, 2.0, 0, 0, "");
uiButSetFunc(bt, do_picker_new_mode_cb, bt, NULL);
uiBlockEndAlign(block);
@@ -2114,11 +2115,11 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
/* RGB values */
uiBlockBeginAlign(block);
- bt = uiDefButR_prop(block, NUMSLI, 0, "R ", 0, -60, butwidth, UI_UNIT_Y, ptr, prop, 0, 0.0, 0.0, 0, 3, "Red");
+ bt = uiDefButR_prop(block, NUMSLI, 0, IFACE_("R "), 0, -60, butwidth, UI_UNIT_Y, ptr, prop, 0, 0.0, 0.0, 0, 3, TIP_("Red"));
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
- bt = uiDefButR_prop(block, NUMSLI, 0, "G ", 0, -80, butwidth, UI_UNIT_Y, ptr, prop, 1, 0.0, 0.0, 0, 3, "Green");
+ bt = uiDefButR_prop(block, NUMSLI, 0, IFACE_("G "), 0, -80, butwidth, UI_UNIT_Y, ptr, prop, 1, 0.0, 0.0, 0, 3, TIP_("Green"));
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
- bt = uiDefButR_prop(block, NUMSLI, 0, "B ", 0, -100, butwidth, UI_UNIT_Y, ptr, prop, 2, 0.0, 0.0, 0, 3, "Blue");
+ bt = uiDefButR_prop(block, NUMSLI, 0, IFACE_("B "), 0, -100, butwidth, UI_UNIT_Y, ptr, prop, 2, 0.0, 0.0, 0, 3, TIP_("Blue"));
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
// could use uiItemFullR(col, ptr, prop, -1, 0, UI_ITEM_R_EXPAND|UI_ITEM_R_SLIDER, "", ICON_NONE);
@@ -2126,16 +2127,16 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
/* HSV values */
uiBlockBeginAlign(block);
- bt = uiDefButF(block, NUMSLI, 0, "H ", 0, -60, butwidth, UI_UNIT_Y, hsv, 0.0, 1.0, 10, 3, "Hue");
+ bt = uiDefButF(block, NUMSLI, 0, IFACE_("H "), 0, -60, butwidth, UI_UNIT_Y, hsv, 0.0, 1.0, 10, 3, TIP_("Hue"));
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
- bt = uiDefButF(block, NUMSLI, 0, "S ", 0, -80, butwidth, UI_UNIT_Y, hsv + 1, 0.0, 1.0, 10, 3, "Saturation");
+ bt = uiDefButF(block, NUMSLI, 0, IFACE_("S "), 0, -80, butwidth, UI_UNIT_Y, hsv + 1, 0.0, 1.0, 10, 3, TIP_("Saturation"));
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
- bt = uiDefButF(block, NUMSLI, 0, "V ", 0, -100, butwidth, UI_UNIT_Y, hsv + 2, 0.0, max, 10, 3, "Value");
+ bt = uiDefButF(block, NUMSLI, 0, IFACE_("V "), 0, -100, butwidth, UI_UNIT_Y, hsv + 2, 0.0, max, 10, 3, TIP_("Value"));
uiButSetFunc(bt, do_hsv_rna_cb, bt, hsv);
uiBlockEndAlign(block);
if (rgba[3] != FLT_MAX) {
- bt = uiDefButR_prop(block, NUMSLI, 0, "A ", 0, -120, butwidth, UI_UNIT_Y, ptr, prop, 3, 0.0, 0.0, 0, 0, "Alpha");
+ bt = uiDefButR_prop(block, NUMSLI, 0, IFACE_("A "), 0, -120, butwidth, UI_UNIT_Y, ptr, prop, 3, 0.0, 0.0, 0, 0, TIP_("Alpha"));
uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
}
else {
@@ -2144,9 +2145,9 @@ static void uiBlockPicker(uiBlock *block, float rgba[4], PointerRNA *ptr, Proper
BLI_snprintf(hexcol, sizeof(hexcol), "%02X%02X%02X", FTOCHAR(rgb_gamma[0]), FTOCHAR(rgb_gamma[1]), FTOCHAR(rgb_gamma[2]));
- bt = uiDefBut(block, TEX, 0, "Hex: ", 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, "Hex triplet for color (#RRGGBB)");
+ bt = uiDefBut(block, TEX, 0, IFACE_("Hex: "), 0, -60, butwidth, UI_UNIT_Y, hexcol, 0, 8, 0, 0, TIP_("Hex triplet for color (#RRGGBB)"));
uiButSetFunc(bt, do_hex_rna_cb, bt, hexcol);
- uiDefBut(block, LABEL, 0, "(Gamma Corrected)", 0, -80, butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, IFACE_("(Gamma Corrected)"), 0, -80, butwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
rgb_to_hsv(rgba[0], rgba[1], rgba[2], hsv, hsv + 1, hsv + 2);
@@ -2651,7 +2652,7 @@ void uiPupMenuInvoke(bContext *C, const char *idname)
if (mt->poll && mt->poll(C, mt) == 0)
return;
- pup = uiPupMenuBegin(C, mt->label, ICON_NONE);
+ pup = uiPupMenuBegin(C, IFACE_(mt->label), ICON_NONE);
layout = uiPupMenuLayout(pup);
menu.layout = layout;
diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt
index eb0286716f3..8eab2fda545 100644
--- a/source/blender/editors/util/CMakeLists.txt
+++ b/source/blender/editors/util/CMakeLists.txt
@@ -20,6 +20,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript
index 16501c59551..0a49c9c24a6 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 ../../bmesh'
incs += ' ../../blenloader'
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index ac264c1a6af..5f0fc9d105c 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -44,6 +44,8 @@
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
+#include "BLF_translation.h"
+
#include "BKE_blender.h"
#include "BKE_context.h"
#include "BKE_global.h"
@@ -456,7 +458,9 @@ static EnumPropertyItem *rna_undo_itemf(bContext *C, int undosys, int *totitem)
}
if (name) {
- item_tmp.identifier = item_tmp.name = name;
+ item_tmp.identifier = name;
+ /* XXX This won’t work with non-default contexts (e.g. operators) :/ */
+ item_tmp.name = IFACE_(name);
if (active)
item_tmp.icon = ICON_RESTRICT_VIEW_OFF;
else
@@ -484,7 +488,7 @@ static int undo_history_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
EnumPropertyItem *item = rna_undo_itemf(C, undosys, &totitem);
if (totitem > 0) {
- uiPopupMenu *pup = uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ uiPopupMenu *pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
uiLayout *layout = uiPupMenuLayout(pup);
uiLayout *split = uiLayoutSplit(layout, 0, 0), *column = NULL;
int i, c;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 4bc510ef54b..be7913b9181 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -666,7 +666,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
return retval;
}
else {
- pup = uiPupMenuBegin(C, IFACE_(op->type->name), ICON_NONE);
+ pup = uiPupMenuBegin(C, RNA_struct_ui_name(op->type->srna), ICON_NONE);
layout = uiPupMenuLayout(pup);
uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);
@@ -700,7 +700,7 @@ static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, cons
RNA_property_enum_items((bContext *)C, &ptr, prop, &item_array, NULL, &do_free);
for (item = item_array; item->identifier; item++) {
- /* note: need to give the intex rather than the dientifier because the enum can be freed */
+ /* note: need to give the index rather than the identifier because the enum can be freed */
if (BLI_strcasestr(item->name, str))
if (0 == uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0))
break;
@@ -741,7 +741,9 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op)
block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS);
uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT);
- //uiDefBut(block, LABEL, 0, op->type->name, 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); // ok, this isn't so easy...
+#if 0 /* ok, this isn't so easy... */
+ uiDefBut(block, LABEL, 0, RNA_struct_ui_name(op->type->srna), 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
+#endif
but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9 * UI_UNIT_X, UI_UNIT_Y, 0, 0, "");
uiButSetSearchFunc(but, operator_enum_search_cb, op->type, operator_enum_call_cb, NULL);
@@ -961,7 +963,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op)
if (op->type->flag & OPTYPE_MACRO) {
for (op = op->macro.first; op; op = op->next) {
- uiItemL(layout, op->type->name, ICON_NONE);
+ uiItemL(layout, RNA_struct_ui_name(op->type->srna), ICON_NONE);
uiLayoutOperatorButs(C, layout, op, NULL, 'H', UI_LAYOUT_OP_SHOW_TITLE);
}
}