Adding a new language as a MOD

From Frozenbyte Wiki
Revision as of 10:15, 15 June 2018 by AnteroFB (talk | contribs) (Created page with "Trine 3: The Artifacts of Power includes a bunch of official localizations, but it is also reasonably easy to create a language mod to enable a custom language, such as your o...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Trine 3: The Artifacts of Power includes a bunch of official localizations, but it is also reasonably easy to create a language mod to enable a custom language, such as your own translation.


Recommended tools

- Any text editor (even Notepad, although its feature set will be lacking for a full language translation)

- Poedit - creating the Launcher translations (.po/.mo)


File structure and rough steps

- Launch the game from Steam but choose "Start Editor" instead of Start game. It will ask you for a folder name etc. Then go to that folder in Windows.

- Create a new folder for your language under these two folders:

data/locale/gui/$$

data/locale/subtitles/$$


You can find out the official standardized language 2-letter name at Wikipedia. So for Esperanto you'd create:

data/locale/gui/eo

data/locale/subtitles/eo

Alternatively, and recommended, it might be easier to copy e.g. "en", and then modify those files. You can open the .lua files in any text editor, even Notepad.

(Audio is to delay audio file/subtitle lengths etc, not very important generally.)

Then edit

data/script/misc/locale_settings.lua and add the language there (in multiple places, just follow the same syntax).


Launcher

If you want to edit the Launcher too:

data/launcher/locale/$$ - You'll need to edit the .po and .mo files with e.g. Poedit.


Creating the mod

And now create a mod:

Start the Editor (from the game launcher again), choose File -> Export (you don't need to save anything so choose "No" for the map changes), and then choose "Mission changes" (locale files are here) AND "Script changes" (script) and export and save the folder. You may get some messages about local changes, that's ok (you should get one for each new file in fact, so that's plenty of OKs to press at this point). By default it saves to the "custom" folder under the Editor file tree.

Close the Editor (again, just click "No" a few times) and start the game launcher again, and in the Mods dropdown menu you should see your new .fbq mod file (it won't be listed in the Mods sub-popup, so just choose it from the dropdown menu).


Testing

Choose the MOD from the dropdown menu and launch the game. In the game, remember to turn on Subtitles of course, and also remember to change the Language to your new language!


Distributing the language

Distributing the language is the same as for any MOD, please see the general MOD sections.


Notes and issues

The loading screens in Trine 3: The Artifacts of Power (official languages) are images now, so changing those texts won't have effect. There might be a failsafe option using text.


Keeping up to date with English

Frozenbyte continually updates the game, and sometimes the updates may include new texts. If you want to keep your MOD language 100% perfect, you could keep some kind of a log of the changes by using text compare tools.



Becoming an official translation/localization

At the moment Frozenbyte gives no guarantee that we will include, or try to include, any unofficial translations into the game as official translations... So even if you do an unofficial translation, we retain the right to do a separate official translation and not use yours. It would of course make sense to try to get the unofficial ones, but there can be various reasons why we would want to do otherwise.

If you wish to discuss this, please get in touch.


Languages and font issues

Some languages will not render properly using the default font (Argos). Typically these include all Asian languages and many smaller European languages. For these languages it's best to use "compatibilityFont" in data\script\misc\locale_settings.lua, for example for Turkish:

, { id = "tr", nativeName = "Türkçe", englishName = "Turkish", audioName = "turkish/", useCompatibilityFont = true, useCompatibilityFont2 = false }

CompatibilityFont1 is Cambria.

CompatibilityFont2 is ???


Trine Enchanted Edition & Trine 2: Complete Story

These instructions were made for Trine 3: The Artifacts of Power, however they should work in a similar manner Trine Enchanted Edition and Trine 2: Complete Story as well. There might be some minor differences, and at least you'll have to export all files instead of choosing separate categories (Types/Mission/Resources etc).