diff options
author | Bastien Montagne <bastien@blender.org> | 2021-11-02 19:50:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-11-02 19:50:18 +0300 |
commit | 29dff8f84423852f01570334abf08fb922ffb51e (patch) | |
tree | 0ace98fe2d22cca12052350e861006c6b2486a7b /source/blender/editors | |
parent | 20b163b53309fb6fbbb5aab78cde0d14e163e3b4 (diff) |
Fix lots of missing messages i18n handling in `uiItemL` calls.
Also fix several wrong usages of `IFACE_` (as a reminder, error/info
messages should use `TIP_`, not `IFACE_`).
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/fmodifier_ui.c | 12 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 17 | ||||
-rw-r--r-- | source/blender/editors/interface/tree_view.cc | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_user_menu.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 26 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 2 |
9 files changed, 39 insertions, 34 deletions
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 105bb54cee3..b94ee68e276 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -403,10 +403,10 @@ static void generator_panel_draw(const bContext *C, Panel *panel) char xval[32]; /* The first value gets a "Coefficient" label. */ - BLI_strncpy(xval, "Coefficient", sizeof(xval)); + BLI_strncpy(xval, N_("Coefficient"), sizeof(xval)); for (int i = 0; i < data->arraysize; i++) { - uiItemFullR(col, ptr, prop, i, 0, 0, N_(xval), ICON_NONE); + uiItemFullR(col, ptr, prop, i, 0, 0, IFACE_(xval), ICON_NONE); BLI_snprintf(xval, sizeof(xval), "x^%d", i + 1); } break; @@ -420,17 +420,17 @@ static void generator_panel_draw(const bContext *C, Panel *panel) uiLayoutColumn(split, false); uiLayout *title_col = uiLayoutColumn(split, false); uiLayout *title_row = uiLayoutRow(title_col, true); - uiItemL(title_row, N_("A"), ICON_NONE); - uiItemL(title_row, N_("B"), ICON_NONE); + uiItemL(title_row, IFACE_("A"), ICON_NONE); + uiItemL(title_row, IFACE_("B"), ICON_NONE); } uiLayout *first_row = uiLayoutRow(col, true); - uiItemFullR(first_row, ptr, prop, 0, 0, 0, N_("y = (Ax + B)"), ICON_NONE); + uiItemFullR(first_row, ptr, prop, 0, 0, 0, IFACE_("y = (Ax + B)"), ICON_NONE); uiItemFullR(first_row, ptr, prop, 1, 0, 0, "", ICON_NONE); for (int i = 2; i < data->arraysize - 1; i++) { /* \u2715 is the multiplication symbol. */ uiLayout *row = uiLayoutRow(col, true); - uiItemFullR(row, ptr, prop, i, 0, 0, N_("\u2715 (Ax + B)"), ICON_NONE); + uiItemFullR(row, ptr, prop, i, 0, 0, IFACE_("\u2715 (Ax + B)"), ICON_NONE); uiItemFullR(row, ptr, prop, i + 1, 0, 0, "", ICON_NONE); } break; diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 62c84ed38ff..dc9eaed5731 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -4450,7 +4450,7 @@ static void ui_def_but_rna__panel_type(bContext *C, uiLayout *layout, void *but_ } else { char msg[256]; - SNPRINTF(msg, "Missing Panel: %s", panel_type); + SNPRINTF(msg, TIP_("Missing Panel: %s"), panel_type); uiItemL(layout, msg, ICON_NONE); } } @@ -4479,7 +4479,7 @@ static void ui_def_but_rna__menu_type(bContext *C, uiLayout *layout, void *but_p } else { char msg[256]; - SNPRINTF(msg, "Missing Menu: %s", menu_type); + SNPRINTF(msg, TIP_("Missing Menu: %s"), menu_type); uiItemL(layout, msg, ICON_NONE); } } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 25ba0e13487..20e95ef4e9c 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1339,7 +1339,7 @@ static void ui_item_menu_hold(struct bContext *C, ARegion *butregion, uiBut *but UI_menutype_draw(C, mt, layout); } else { - uiItemL(layout, "Menu Missing:", ICON_NONE); + uiItemL(layout, TIP_("Menu Missing:"), ICON_NONE); uiItemL(layout, menu_id, ICON_NONE); } UI_popup_menu_end(C, pup); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 755a0fce7bc..1d349aa0596 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2743,7 +2743,7 @@ static void draw_constraint_header(uiLayout *layout, Object *ob, bConstraint *co uiItemR(row, &ptr, "name", 0, "", ICON_NONE); } else { - uiItemL(row, con->name, ICON_NONE); + uiItemL(row, IFACE_(con->name), ICON_NONE); } /* proxy-protected constraints cannot be edited, so hide up/down + close buttons */ @@ -6142,8 +6142,8 @@ void uiTemplateInputStatus(uiLayout *layout, struct bContext *C) uiLayout *row = uiLayoutRow(col, true); uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT); - const char *msg = WM_window_cursor_keymap_status_get(win, i, 0); - const char *msg_drag = WM_window_cursor_keymap_status_get(win, i, 1); + const char *msg = TIP_(WM_window_cursor_keymap_status_get(win, i, 0)); + const char *msg_drag = TIP_(WM_window_cursor_keymap_status_get(win, i, 1)); if (msg || (msg_drag == NULL)) { uiItemL(row, msg ? msg : "", (ICON_MOUSE_LMB + i)); @@ -6498,12 +6498,15 @@ void uiTemplateCacheFile(uiLayout *layout, row = uiLayoutRow(layout, false); /* For Cycles, verify that experimental features are enabled. */ if (BKE_scene_uses_cycles(scene) && !BKE_scene_uses_cycles_experimental_features(scene)) { - uiItemL(row, - "The Cycles Alembic Procedural is only available with the experimental feature set", - ICON_INFO); + uiItemL( + row, + TIP_( + "The Cycles Alembic Procedural is only available with the experimental feature set"), + ICON_INFO); } else { - uiItemL(row, "The active render engine does not have an Alembic Procedural", ICON_INFO); + uiItemL( + row, TIP_("The active render engine does not have an Alembic Procedural"), ICON_INFO); } } diff --git a/source/blender/editors/interface/tree_view.cc b/source/blender/editors/interface/tree_view.cc index c08fa51d5a5..fcc878c440c 100644 --- a/source/blender/editors/interface/tree_view.cc +++ b/source/blender/editors/interface/tree_view.cc @@ -660,7 +660,7 @@ void BasicTreeViewItem::add_label(uiLayout &layout, StringRefNull label_override if (icon == ICON_NONE && !is_collapsible()) { uiItemS_ex(&layout, 0.8f); } - uiItemL(&layout, label.c_str(), icon); + uiItemL(&layout, IFACE_(label.c_str()), icon); } void BasicTreeViewItem::on_activate() diff --git a/source/blender/editors/screen/screen_user_menu.c b/source/blender/editors/screen/screen_user_menu.c index 733e8b694a6..bc370c64b0c 100644 --- a/source/blender/editors/screen/screen_user_menu.c +++ b/source/blender/editors/screen/screen_user_menu.c @@ -234,7 +234,7 @@ static void screen_user_menu_draw(const bContext *C, Menu *menu) } else { if (show_missing) { - SNPRINTF(label, "Missing: %s", umi_op->op_idname); + SNPRINTF(label, TIP_("Missing: %s"), umi_op->op_idname); uiItemL(menu->layout, label, ICON_NONE); } } @@ -248,7 +248,7 @@ static void screen_user_menu_draw(const bContext *C, Menu *menu) } else { if (show_missing) { - SNPRINTF(label, "Missing: %s", umi_mt->mt_idname); + SNPRINTF(label, TIP_("Missing: %s"), umi_mt->mt_idname); uiItemL(menu->layout, label, ICON_NONE); } } @@ -290,7 +290,7 @@ static void screen_user_menu_draw(const bContext *C, Menu *menu) } if (!ok) { if (show_missing) { - SNPRINTF(label, "Missing: %s.%s", umi_pr->context_data_path, umi_pr->prop_id); + SNPRINTF(label, TIP_("Missing: %s.%s"), umi_pr->context_data_path, umi_pr->prop_id); uiItemL(menu->layout, label, ICON_NONE); } } diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index f4c4b6cafcd..275616f3bcb 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -593,17 +593,17 @@ static void graph_panel_key_properties(const bContext *C, Panel *panel) else { if ((fcu->bezt == NULL) && (fcu->modifiers.first)) { /* modifiers only - so no keyframes to be active */ - uiItemL(layout, IFACE_("F-Curve only has F-Modifiers"), ICON_NONE); - uiItemL(layout, IFACE_("See Modifiers panel below"), ICON_INFO); + uiItemL(layout, TIP_("F-Curve only has F-Modifiers"), ICON_NONE); + uiItemL(layout, TIP_("See Modifiers panel below"), ICON_INFO); } else if (fcu->fpt) { /* samples only */ uiItemL(layout, - IFACE_("F-Curve doesn't have any keyframes as it only contains sampled points"), + TIP_("F-Curve doesn't have any keyframes as it only contains sampled points"), ICON_NONE); } else { - uiItemL(layout, IFACE_("No active keyframe on F-Curve"), ICON_NONE); + uiItemL(layout, TIP_("No active keyframe on F-Curve"), ICON_NONE); } } @@ -688,28 +688,30 @@ static void driver_dvar_invalid_name_query_cb(bContext *C, void *dvar_v, void *U DriverVar *dvar = (DriverVar *)dvar_v; if (dvar->flag & DVAR_FLAG_INVALID_EMPTY) { - uiItemL(layout, "It cannot be left blank", ICON_ERROR); + uiItemL(layout, TIP_("It cannot be left blank"), ICON_ERROR); } if (dvar->flag & DVAR_FLAG_INVALID_START_NUM) { - uiItemL(layout, "It cannot start with a number", ICON_ERROR); + uiItemL(layout, TIP_("It cannot start with a number"), ICON_ERROR); } if (dvar->flag & DVAR_FLAG_INVALID_START_CHAR) { uiItemL(layout, - "It cannot start with a special character," - " including '$', '@', '!', '~', '+', '-', '_', '.', or ' '", + TIP_("It cannot start with a special character," + " including '$', '@', '!', '~', '+', '-', '_', '.', or ' '"), ICON_NONE); } if (dvar->flag & DVAR_FLAG_INVALID_HAS_SPACE) { - uiItemL(layout, "It cannot contain spaces (e.g. 'a space')", ICON_ERROR); + uiItemL(layout, TIP_("It cannot contain spaces (e.g. 'a space')"), ICON_ERROR); } if (dvar->flag & DVAR_FLAG_INVALID_HAS_DOT) { - uiItemL(layout, "It cannot contain dots (e.g. 'a.dot')", ICON_ERROR); + uiItemL(layout, TIP_("It cannot contain dots (e.g. 'a.dot')"), ICON_ERROR); } if (dvar->flag & DVAR_FLAG_INVALID_HAS_SPECIAL) { - uiItemL(layout, "It cannot contain special (non-alphabetical/numeric) characters", ICON_ERROR); + uiItemL(layout, + TIP_("It cannot contain special (non-alphabetical/numeric) characters"), + ICON_ERROR); } if (dvar->flag & DVAR_FLAG_INVALID_PY_KEYWORD) { - uiItemL(layout, "It cannot be a reserved keyword in Python", ICON_INFO); + uiItemL(layout, TIP_("It cannot be a reserved keyword in Python"), ICON_INFO); } UI_popup_menu_end(C, pup); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 5b83f681d17..6a50f6d42e8 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1056,7 +1056,7 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, bool color_ma if (imf->imtype == R_IMF_IMTYPE_CINEON) { #if 1 - uiItemL(col, IFACE_("Hard coded Non-Linear, Gamma:1.7"), ICON_NONE); + uiItemL(col, TIP_("Hard coded Non-Linear, Gamma:1.7"), ICON_NONE); #else uiItemR(col, imfptr, "use_cineon_log", 0, NULL, ICON_NONE); uiItemR(col, imfptr, "cineon_black", 0, NULL, ICON_NONE); diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 83b7c119b62..a6ee7d1e5b6 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -993,7 +993,7 @@ static void node_shader_buts_vertex_color(uiLayout *layout, bContext *C, Pointer } } else { - uiItemL(layout, "No mesh in active object.", ICON_ERROR); + uiItemL(layout, TIP_("No mesh in active object"), ICON_ERROR); } } |