I18n: Remove extraction macros from the node socket declarations #107258

Merged
Bastien Montagne merged 3 commits from pioverfour/blender:dp_geo_nodes_remove_extraction_macros into main 2023-05-16 14:13:01 +02:00

3 Commits

Author SHA1 Message Date
Damien Picard 9b313102bb Cleanup: I18n: Remove extraction macros from node socket declarations
The previous two commits introduced new regexes to extract node socket
names and descriptions automatically from the i18n Python module,
including socket labels.

This commit removes the extraction macros from all node files since
they are now redundant.
2023-05-15 22:33:09 +02:00
Damien Picard c3a44183b1 I18n: Add message extraction regexes for node socket labels
Some node sockets get their names from a "label", instead of the
declaration. These labels are not necessarily the same as the
declaration, so they need to be extracted to the translation files.

They are always in a `node_sock_label()` function. It has two args,
the second of which is the string we want to extract.
2023-05-15 22:24:37 +02:00
Damien Picard 38aa537c02 I18n: Add message extraction regexes for node socket declarations
The node socket declarations use the `N_()` macro to extract the name
and description of the socket.

This is quite redundant because since the syntax is always the same,
the extraction can be done automatically from the Python translation
module using regexes.

Four new regexes are introduced in bl_i18n_utils.settings:
- one extracts contextless messages from `add_input()` and
  `add_output()`, the basic socket declarations with the names;
- one does the same, but for those sockets which declare a context
  through `.translation_context()`;
- one extracts descriptions and error messages;
- one extracts geometry nodes field inputs.

In addition to making the code simpler and more legible, this change
extracts a few dozen messages which were not tagged with the proper
macro.
2023-05-15 22:24:37 +02:00