I18n: remove context translation from node title

The node title was translated in two steps: first using the
BLT_I18NCONTEXT_ID_NODETREE context, and if that failed, using the
default context.

As far as I could find, the only node using this intentionally is the
Frame node, but its title is only displayed in the Add Menu.

However, at least one node has a bad translation because its name was
extracted independently with the NodeTree context: the compositing
Scale node uses a translation which is only appropriate in a vector
math context.

This commit removes the double translation step. If needed by
translators, a translation context in the node RNA could be introduced
at a later time.

Pull Request: https://projects.blender.org/blender/blender/pulls/108241
This commit is contained in:
Damien Picard 2023-05-24 20:27:10 +02:00 committed by Gitea
parent e9eb8b3cc4
commit 58c6a278d3
1 changed files with 1 additions and 6 deletions

View File

@ -4439,12 +4439,7 @@ void nodeLabel(const bNodeTree *ntree, const bNode *node, char *label, const int
return;
}
/* Kind of hacky and weak... Ideally would be better to use RNA here. :| */
const char *tmp = CTX_IFACE_(BLT_I18NCONTEXT_ID_NODETREE, node->typeinfo->ui_name);
if (tmp == node->typeinfo->ui_name) {
tmp = IFACE_(node->typeinfo->ui_name);
}
BLI_strncpy(label, tmp, label_maxncpy);
BLI_strncpy(label, IFACE_(node->typeinfo->ui_name), label_maxncpy);
}
const char *nodeSocketLabel(const bNodeSocket *sock)