I18n: Translate dynamic operator descriptions

The descriptions for `POSELIB_OT_asset_modify` and
`GEOMETRY_OT_execute_node_group` are dynamic. They were already
extracted, but the translation did not happen in the description
function.

This commit adds the appropriate `TIP_` translation macro.

Reported by Ye Gui in #43295.
This commit is contained in:
Damien Picard
2025-10-14 17:12:42 +02:00
committed by Bastien Montagne
parent c36c103389
commit 90e2dfd2e3
2 changed files with 5 additions and 3 deletions

View File

@@ -708,7 +708,7 @@ static std::string pose_asset_modify_description(bContext * /* C */,
PointerRNA *ptr)
{
const int mode = RNA_enum_get(ptr, "mode");
return std::string(prop_asset_overwrite_modes[mode].description);
return TIP_(std::string(prop_asset_overwrite_modes[mode].description));
}
/* Calling it overwrite instead of save because we aren't actually saving an opened asset. */

View File

@@ -18,6 +18,8 @@
#include "BKE_node_runtime.hh"
#include "BKE_node_tree_update.hh"
#include "BLT_translation.hh"
#include "ED_node.hh"
#include "ED_screen.hh"
@@ -80,12 +82,12 @@ static std::string sockets_sync_get_description(bContext *C, wmOperatorType *ot,
{
Vector<bNode *> nodes_to_sync = get_nodes_to_sync(*C, ptr);
if (nodes_to_sync.size() != 1) {
return ot->description;
return TIP_(ot->description);
}
const bNode &node = *nodes_to_sync.first();
std::string description = nodes::sync_node_description_get(*C, node);
if (description.empty()) {
return ot->description;
return TIP_(ot->description);
}
return description;
}