Page 1 of 1

Translation hints

Posted: Mon Jan 23, 2023 9:24 am
by Magus
Translation hints come in form of hover tooltips
weidu-tra-tooltip.png
weidu-tra-tooltip.png (53.8 KiB) Viewed 23275 times
fallout-tra-tooltip.png
fallout-tra-tooltip.png (68.81 KiB) Viewed 23275 times

And inlay hints.
fallout-inlay-hints.gif
fallout-inlay-hints.gif (69.2 KiB) Viewed 23275 times
weidu-inlay-hints.gif
weidu-inlay-hints.gif (85.31 KiB) Viewed 23275 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.

Re: Translation hints

Posted: Sat Jun 10, 2023 11:36 pm
by QuantumApprentice
Just wanted to drop this on ya in case you weren't aware already:
Inlay hints is cool, works for the most part, but I discovered today it doesn't seem to work for gSay_message() for some reason:
Image

Re: Translation hints

Posted: Sun Jun 11, 2023 9:29 am
by Magus
Correct.
But if you check the original scripts, you'll see that gSay_Message is pretty much never used directly, only in GMessage/NMessage/BMessage macros. It's probably a better practice to follow that convention.
These macros also don't show hints now, but I added the capability, and they will in the next version.