I18n: add per-socket translation contexts for nodes #105195

Merged
Hans Goudey merged 3 commits from pioverfour/blender:dp_per_node_socket_translation_context into main 2023-03-06 14:24:49 +01:00

3 Commits

Author SHA1 Message Date
Damien Picard 22d36554b6 Address review for #105195
Use a `StringRefNull` to store the translation context instead of
passing it through `BLI_strdup()`.
2023-02-28 19:54:24 +01:00
Damien Picard ddc864b09c Address review for #105195
- Check for node runtime declaration, return early if null pointer.
- Return translation_context.data() directly instead of using a
  temporary std:stringstream.
2023-02-27 16:17:13 +01:00
Damien Picard ba4f86720a I18n: add per-socket translation contexts for nodes
In order to properly translate UI messages, they sometimes need to be
disambiguated using translation contexts. Until now, node sockets had
no way to specify contexts and collisions occurred.

This commit adds a way to declare contexts for each socket using:
.translation_context()

If no context is specified, the default null context is used.
2023-02-27 16:17:13 +01:00