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
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-02-04 16:31:53 +0300
committerHans Goudey <h.goudey@me.com>2022-02-04 16:31:53 +0300
commit7099d5b66129deba2d28102ea339b1d5339233fe (patch)
tree7c0c4c8839c522632f41c96c57a2316b385c5a0d
parent623ff64a278924af57d7e1ec7e7bdb8792a560f8 (diff)
Fix: Missing translations from operator descriptions
The strings in the `get_description` functions for operators need translation, they are not found by the translation system automatically, and there is no translation applied afterwards either (as far as I could tell). Some used `N_` before, but most did nothing. Differential Revision: https://developer.blender.org/D14011
-rw-r--r--source/blender/editors/asset/CMakeLists.txt1
-rw-r--r--source/blender/editors/asset/intern/asset_ops.cc10
-rw-r--r--source/blender/editors/mesh/editmesh_select.c10
-rw-r--r--source/blender/editors/object/object_data_transfer.c6
-rw-r--r--source/blender/editors/object/object_modifier.c4
-rw-r--r--source/blender/editors/object/object_vgroup.c26
-rw-r--r--source/blender/editors/render/render_opengl.cc9
-rw-r--r--source/blender/editors/space_action/action_edit.c2
-rw-r--r--source/blender/editors/space_graph/graph_edit.c2
-rw-r--r--source/blender/editors/space_graph/graph_slider_ops.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files.c10
11 files changed, 47 insertions, 35 deletions
diff --git a/source/blender/editors/asset/CMakeLists.txt b/source/blender/editors/asset/CMakeLists.txt
index 086fab4ab47..d91102528e5 100644
--- a/source/blender/editors/asset/CMakeLists.txt
+++ b/source/blender/editors/asset/CMakeLists.txt
@@ -21,6 +21,7 @@ set(INC
../../blenkernel
../../blenlib
../../blenloader
+ ../../blentranslation
../../makesdna
../../makesrna
../../windowmanager
diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc
index f7755aa9fea..0469f14487d 100644
--- a/source/blender/editors/asset/intern/asset_ops.cc
+++ b/source/blender/editors/asset/intern/asset_ops.cc
@@ -39,6 +39,8 @@
/* XXX needs access to the file list, should all be done via the asset system in future. */
#include "ED_fileselect.h"
+#include "BLT_translation.h"
+
#include "RNA_access.h"
#include "RNA_define.h"
@@ -342,8 +344,8 @@ static bool asset_clear_poll(bContext *C)
IDVecStats ctx_stats = asset_operation_get_id_vec_stats_from_context(C);
if (!ctx_stats.has_asset) {
- const char *msg_single = "Data-block is not marked as asset";
- const char *msg_multiple = "No data-block selected that is marked as asset";
+ const char *msg_single = TIP_("Data-block is not marked as asset");
+ const char *msg_multiple = TIP_("No data-block selected that is marked as asset");
CTX_wm_operator_poll_msg_set(C, ctx_stats.is_single ? msg_single : msg_multiple);
return false;
}
@@ -365,8 +367,8 @@ static char *asset_clear_get_description(struct bContext *UNUSED(C),
}
return BLI_strdup(
- "Delete all asset metadata, turning the selected asset data-blocks back into normal "
- "data-blocks, and set Fake User to ensure the data-blocks will still be saved");
+ TIP_("Delete all asset metadata, turning the selected asset data-blocks back into normal "
+ "data-blocks, and set Fake User to ensure the data-blocks will still be saved"));
}
static void ASSET_OT_clear(wmOperatorType *ot)
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 9396c9e53ea..8383492e459 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -1408,15 +1408,15 @@ static char *edbm_select_mode_get_description(struct bContext *UNUSED(C),
!RNA_struct_property_is_set(values, "action")) {
switch (type) {
case SCE_SELECT_VERTEX:
- return BLI_strdup(
- N_("Vertex select - Shift-Click for multiple modes, Ctrl-Click contracts selection"));
+ return BLI_strdup(TIP_(
+ "Vertex select - Shift-Click for multiple modes, Ctrl-Click contracts selection"));
case SCE_SELECT_EDGE:
return BLI_strdup(
- N_("Edge select - Shift-Click for multiple modes, "
- "Ctrl-Click expands/contracts selection depending on the current mode"));
+ TIP_("Edge select - Shift-Click for multiple modes, "
+ "Ctrl-Click expands/contracts selection depending on the current mode"));
case SCE_SELECT_FACE:
return BLI_strdup(
- N_("Face select - Shift-Click for multiple modes, Ctrl-Click expands selection"));
+ TIP_("Face select - Shift-Click for multiple modes, Ctrl-Click expands selection"));
}
}
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c
index 595822de1e7..3744cbee3a4 100644
--- a/source/blender/editors/object/object_data_transfer.c
+++ b/source/blender/editors/object/object_data_transfer.c
@@ -43,6 +43,8 @@
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
+#include "BLT_translation.h"
+
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -610,8 +612,8 @@ static char *data_transfer_get_description(bContext *UNUSED(C),
const bool reverse_transfer = RNA_boolean_get(ptr, "use_reverse_transfer");
if (reverse_transfer) {
- return BLI_strdup(
- "Transfer data layer(s) (weights, edge sharp, etc.) from selected meshes to active one");
+ return BLI_strdup(TIP_(
+ "Transfer data layer(s) (weights, edge sharp, etc.) from selected meshes to active one"));
}
return NULL;
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 4ac2a9dca62..775fac96d57 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -84,6 +84,8 @@
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
+#include "BLT_translation.h"
+
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
@@ -1521,7 +1523,7 @@ static char *modifier_apply_as_shapekey_get_description(struct bContext *UNUSED(
bool keep = RNA_boolean_get(values, "keep_modifier");
if (keep) {
- return BLI_strdup("Apply modifier as a new shapekey and keep it in the stack");
+ return BLI_strdup(TIP_("Apply modifier as a new shapekey and keep it in the stack"));
}
return NULL;
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index e21e815b56f..ed0f7b2fad0 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -64,6 +64,8 @@
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.h"
+#include "BLT_translation.h"
+
#include "DNA_armature_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -3427,16 +3429,16 @@ static char *vertex_group_lock_description(struct bContext *UNUSED(C),
switch (action) {
case VGROUP_LOCK:
- action_str = "Lock";
+ action_str = TIP_("Lock");
break;
case VGROUP_UNLOCK:
- action_str = "Unlock";
+ action_str = TIP_("Unlock");
break;
case VGROUP_TOGGLE:
- action_str = "Toggle locks of";
+ action_str = TIP_("Toggle locks of");
break;
case VGROUP_INVERT:
- action_str = "Invert locks of";
+ action_str = TIP_("Invert locks of");
break;
default:
return NULL;
@@ -3444,34 +3446,34 @@ static char *vertex_group_lock_description(struct bContext *UNUSED(C),
switch (mask) {
case VGROUP_MASK_ALL:
- target_str = "all";
+ target_str = TIP_("all");
break;
case VGROUP_MASK_SELECTED:
- target_str = "selected";
+ target_str = TIP_("selected");
break;
case VGROUP_MASK_UNSELECTED:
- target_str = "unselected";
+ target_str = TIP_("unselected");
break;
case VGROUP_MASK_INVERT_UNSELECTED:
switch (action) {
case VGROUP_INVERT:
- target_str = "selected";
+ target_str = TIP_("selected");
break;
case VGROUP_LOCK:
- target_str = "selected and unlock unselected";
+ target_str = TIP_("selected and unlock unselected");
break;
case VGROUP_UNLOCK:
- target_str = "selected and lock unselected";
+ target_str = TIP_("selected and lock unselected");
break;
default:
- target_str = "all and invert unselected";
+ target_str = TIP_("all and invert unselected");
}
break;
default:
return NULL;
}
- return BLI_sprintfN("%s %s vertex groups of the active object", action_str, target_str);
+ return BLI_sprintfN(TIP_("%s %s vertex groups of the active object"), action_str, target_str);
}
void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc
index 8bd0244c899..c4ce8bac126 100644
--- a/source/blender/editors/render/render_opengl.cc
+++ b/source/blender/editors/render/render_opengl.cc
@@ -72,8 +72,11 @@
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+
#include "RE_pipeline.h"
+#include "BLT_translation.h"
+
#include "RNA_access.h"
#include "RNA_define.h"
@@ -1326,12 +1329,12 @@ static char *screen_opengl_render_description(struct bContext *UNUSED(C),
}
if (RNA_boolean_get(ptr, "render_keyed_only")) {
- return BLI_strdup(
+ return BLI_strdup(TIP_(
"Render the viewport for the animation range of this scene, but only render keyframes of "
- "selected objects");
+ "selected objects"));
}
- return BLI_strdup("Render the viewport for the animation range of this scene");
+ return BLI_strdup(TIP_("Render the viewport for the animation range of this scene"));
}
void RENDER_OT_opengl(wmOperatorType *ot)
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 184d715a347..ba4ba04d548 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -658,7 +658,7 @@ static char *actkeys_paste_description(bContext *UNUSED(C),
{
/* Custom description if the 'flipped' option is used. */
if (RNA_boolean_get(ptr, "flipped")) {
- return BLI_strdup("Paste keyframes from mirrored bones if they exist");
+ return BLI_strdup(TIP_("Paste keyframes from mirrored bones if they exist"));
}
/* Use the default description in the other cases. */
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 9675901ead3..63de7fb570e 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -586,7 +586,7 @@ static char *graphkeys_paste_description(bContext *UNUSED(C),
{
/* Custom description if the 'flipped' option is used. */
if (RNA_boolean_get(ptr, "flipped")) {
- return BLI_strdup("Paste keyframes from mirrored bones if they exist");
+ return BLI_strdup(TIP_("Paste keyframes from mirrored bones if they exist"));
}
/* Use the default description in the other cases. */
diff --git a/source/blender/editors/space_graph/graph_slider_ops.c b/source/blender/editors/space_graph/graph_slider_ops.c
index 4b8c983a761..44a8817fe7c 100644
--- a/source/blender/editors/space_graph/graph_slider_ops.c
+++ b/source/blender/editors/space_graph/graph_slider_ops.c
@@ -483,7 +483,7 @@ static char *decimate_desc(bContext *UNUSED(C), wmOperatorType *UNUSED(op), Poin
if (RNA_enum_get(ptr, "mode") == DECIM_ERROR) {
return BLI_strdup(
- "Decimate F-Curves by specifying how much it can deviate from the original curve");
+ TIP_("Decimate F-Curves by specifying how much it can deviate from the original curve"));
}
/* Use default description. */
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 723c572c4da..9b9aa37a251 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -2704,7 +2704,7 @@ static char *wm_open_mainfile_description(struct bContext *UNUSED(C),
BLI_stat_t stats;
if (BLI_stat(path, &stats) == -1) {
- return BLI_sprintfN("%s\n\n%s", path, N_("File Not Found"));
+ return BLI_sprintfN("%s\n\n%s", path, TIP_("File Not Found"));
}
/* Date. */
@@ -2714,7 +2714,7 @@ static char *wm_open_mainfile_description(struct bContext *UNUSED(C),
BLI_filelist_entry_datetime_to_string(
NULL, (int64_t)stats.st_mtime, false, time_st, date_st, &is_today, &is_yesterday);
if (is_today || is_yesterday) {
- BLI_strncpy(date_st, is_today ? N_("Today") : N_("Yesterday"), sizeof(date_st));
+ BLI_strncpy(date_st, is_today ? TIP_("Today") : TIP_("Yesterday"), sizeof(date_st));
}
/* Size. */
@@ -2722,7 +2722,7 @@ static char *wm_open_mainfile_description(struct bContext *UNUSED(C),
BLI_filelist_entry_size_to_string(NULL, (uint64_t)stats.st_size, false, size_str);
return BLI_sprintfN(
- "%s\n\n%s: %s %s\n%s: %s", path, N_("Modified"), date_st, time_st, N_("Size"), size_str);
+ "%s\n\n%s: %s %s\n%s: %s", path, TIP_("Modified"), date_st, time_st, TIP_("Size"), size_str);
}
/* currently fits in a pointer */
@@ -3169,8 +3169,8 @@ static char *wm_save_as_mainfile_get_description(bContext *UNUSED(C),
PointerRNA *ptr)
{
if (RNA_boolean_get(ptr, "copy")) {
- return BLI_strdup(
- "Save the current file in the desired location but do not make the saved file active");
+ return BLI_strdup(TIP_(
+ "Save the current file in the desired location but do not make the saved file active"));
}
return NULL;
}