Fix incorrect i18n behavior for automation macros
There are currently some issues with how i18n is applied to automation script macros:
- Some macro names in the menu are being translated even though they were not marked with
aegisub.gettext. - The macro names used as hotkey commands should not be translated.
I believe this is opt-in on the script side: macros must call aegisub.gettext to (possibly) localize their strings. Can you provide examples of this happening or not happening, or some more details?
Sure. I wrote a sample script. (Aegisub 3.4.2 portable)
local tr = aegisub.gettext
script_name = "TEST"
function n() end
aegisub.register_macro(script_name .. "/Revert", "", n)
aegisub.register_macro(tr(script_name .. "/Style"), "", n)
I've reconsidered the issue. Translation of automation scripts might be useful in some cases, so I've updated the title and description.
It looks like the issue is in the automation menu generator, where it runs the display name through the translation function. Removing the translation call from there (and leaving it to the script author to do, as in your example), is probably the most sane option.