[Bf-blender-cvs] [29dff8f8442] blender-v3.0-release: Fix lots of missing messages i18n handling in `uiItemL` calls.

Bastien Montagne noreply at git.blender.org
Tue Nov 2 17:51:50 CET 2021


Commit: 29dff8f84423852f01570334abf08fb922ffb51e
Author: Bastien Montagne
Date:   Tue Nov 2 17:50:18 2021 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB29dff8f84423852f01570334abf08fb922ffb51e

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_`).

===================================================================

M	source/blender/editors/animation/fmodifier_ui.c
M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/interface/tree_view.cc
M	source/blender/editors/screen/screen_user_menu.c
M	source/blender/editors/space_graph/graph_buttons.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/editors/space_node/drawnode.cc
M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/modifiers/intern/MOD_cloth.c
M	source/blender/modifiers/intern/MOD_collision.c
M	source/blender/modifiers/intern/MOD_decimate.c
M	source/blender/modifiers/intern/MOD_dynamicpaint.c
M	source/blender/modifiers/intern/MOD_fluid.c
M	source/blender/modifiers/intern/MOD_ocean.c
M	source/blender/modifiers/intern/MOD_particlesystem.c
M	source/blender/modifiers/intern/MOD_remesh.c
M	source/blender/modifiers/intern/MOD_softbody.c
M	source/blender/modifiers/intern/MOD_subsurf.c
M	source/blender/modifiers/intern/MOD_surface.c
M	source/blender/modifiers/intern/MOD_ui_common.c
M	source/blender/shader_fx/intern/FX_ui_common.c
M	source/blender/windowmanager/intern/wm_splash_screen.c

===================================================================

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 cont

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list