I18N: Add comment about required manual sync in nodes code.

Nodes code uses direct access to enum property values definition
(outside of the RNA API) to generate UI (translated) messages, this is
risky/messy since the i18n context potentailly defined for the actual
RNA property is not available in these cases.
This commit is contained in:
Bastien Montagne
2025-06-16 12:41:20 +02:00
parent 00d9d58d77
commit 6ccdb8c06e

View File

@@ -121,6 +121,8 @@ static void node_label(const bNodeTree * /*ntree*/, const bNode *node, char *lab
{
char name[64] = {0};
const char *operation_name = IFACE_("Unknown");
/* NOTE: This assumes that the matching RNA enum property also uses the default i18n context, and
* needs to be kept manually in sync. */
RNA_enum_name_gettexted(
bit_math_operation_items.data(), node->custom1, BLT_I18NCONTEXT_DEFAULT, &operation_name);
SNPRINTF(name, IFACE_("Bitwise %s"), operation_name);