Aegisub icon indicating copy to clipboard operation
Aegisub copied to clipboard

Fix incorrect i18n behavior for automation macros

Open oborozuk1 opened this issue 7 months ago • 4 comments

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.

oborozuk1 avatar Jun 26 '25 11:06 oborozuk1

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?

petzku avatar Jun 26 '25 11:06 petzku

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)

oborozuk1 avatar Jun 26 '25 11:06 oborozuk1

I've reconsidered the issue. Translation of automation scripts might be useful in some cases, so I've updated the title and description.

oborozuk1 avatar Jun 27 '25 01:06 oborozuk1

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.

9vult avatar Jun 27 '25 01:06 9vult