VScode extension adding support for IE and Fallout syntaxes.
Post Reply
User avatar
Magus
Site Admin
Posts: 440
Joined: Mon Nov 21, 2016 9:13 am
Contact:

Translation hints

Post by Magus » Mon Jan 23, 2023 9:24 am

Translation hints come in form of hover tooltips
weidu-tra-tooltip.png
weidu-tra-tooltip.png (53.8 KiB) Viewed 3400 times
fallout-tra-tooltip.png
fallout-tra-tooltip.png (68.81 KiB) Viewed 3400 times

And inlay hints.
fallout-inlay-hints.gif
fallout-inlay-hints.gif (69.2 KiB) Viewed 3400 times
weidu-inlay-hints.gif
weidu-inlay-hints.gif (85.31 KiB) Viewed 3400 times

To allow hints to work, you need to tell MLS where to find the translation. It's done in .bgforge.yml file, which you should place into root of your project.

Code: Select all

mls:
  translation:
    directory: data/text/english/dialog
    auto_tra: true                         # optional, if not specified defaults to true
Virtually everyone will only need the directory setting.
The system works similarly to WeiDU's AUTO_TRA. You specify the directory, and the files are matched by their basename.
So, "smarter_familiars.d" file will be matched with "smarter_familiars.tra".
For Fallout, that's pretty much how it always worked, script names match their msg names.

However, any file may be directed to get the translation elsewhere explicitly. This is done with a special @tra tag, which must be on the very first line, like so (see first screenshot).

Code: Select all

/** @tra smarter_familiars.tra */
Filename specified here is relative to the translation directory specified in .bgforge.yml.
It's also possible to use a subdirectory:

Code: Select all

/** @tra mycomponent/smarter_familiars.tra */
Note that using the tag requires lowercased filenames. (Although in general, your whole mod directory should be lowercased anyway.)


Hover tooltips are normal hovers. Hotkey for inlay hints is Alt-Ctrl.
Please do not PM or email me about my mods and projects. Use forums. Also, see our talk channels.

Post Reply