Translating ET:L

ET:Legacy now uses the Transifex platform for easier translating.

A new localization system was introduced in version 2.71 which uses the standard gettext library.

Using Transifex

We use the Transifex system for the localization. It’s really simple to use, so anyone can start translating and you don’t have to worry about learning git or how to make pull requests.

Using POedit

Even though we use Transifex that doesn’t mean you can’t use POedit if you are used to it. Simply upload the po file to Transifex when you are done.
There are many tools for translating gettext files and POedit seems the easiest one to use. You can download it from the official website poedit.net

Translating mods

Simply launch POedit and open your target language PO file in etmain/locale/mod/
Then update the string list by going to Catalog -> Update from POT file and selecting etmain/locale/legacy/legacy.pot file.
First thing to do before you start translating is to make sure that you have the most recent translation template. This can be done by opening terminal in the topmost source directory and executing ./misc/pot_generator.sh bash script (obviously works only on Unix-like systems, i.e. not Windows).
You are now ready to start translating!

Translating maps

Map translation is currently not implemented. POT files will be stored in maps/mapname/locale/en.pot

Translating game: installing language pack to test for errors

ONLY for Transifex members who use POEdit instead!

This short guide will follow the basics of running the language with the game for testing purposes. Windows 7 was used to demonstrate the process. Proceed to read only if you know what you are doing. This is not an ultimate guide to becoming a translator, rather an insight into questions you might have.

NOTE: Bear in mind. Method works only for offline and to help you maximize the time as translator, understand how changes are seen in the game and apply further editing to parts you suppose won’t fit the game interface. No text scaling supported yet. In order to have your language added for translation, you should first contact one of developers ((Discord))


Step 1: Importing necessary files with own pk3 file.
Part I: PREPARATION

Have you finished translating the files of your language you have downloaded from Transifex and edited with POEdit, two are to be edited right now: client and mod, locate where you saved them on your hard disk.
Next, copy them to another directory in your workplace folder, say you have the game in D:\Games\ETLegacy and the workplace folder D:\Games\ETLegacy\Translating_Legacy.
We will have a copy of the mentioned files to a temporary folder in case something bad happens, one named Translating_Legacy\test, but before all.

NOTE: Aargh! Dont mind the filenames, these should say only language id. Keep reading, soldier. Los, los!

Hold your horses!
First: We need to recreate the same directory layout the game uses to reach the string containers (language files). To do so, open newly created Translating_Legacy\test and create a these folders inside (keep folder names lowercase):

locale
locale > mod (new)
locale > client (new)

Then on, copy each file in its corresponding folder, filename has to be the same as language id game uses, e.g. en.po, sr.po, cs.po, it.po (English, Serbian, Czech, Italian...).
So far you should have the same thing:


Part II: CREATING PK3 BUNDLE

NOTE: For the purposes of this step, I’ll use 7zip 18.05 64bit. Any other program works.

Now you have the files and directories set, go one step back so you see the contents of Translating_Legacy\test.
You would select folder locale we just made - this one has client & mod inside, and bring up the Windows Explorer contextual menu (right click on the selection like you do when copying files).
Next you should click on 7zip (or whatever else program you use, WinRar, FreeZip) > Add to archive....

A new window will show. In order the game to work, you will now select Store for "Compression level" and zip for "Archive format".
Once proper settings are checked, click on "OK" button.

A new file will appear next to locale, called "z_langname(en, sr, pl)_ui.pk3" or whatever you name it, remember it has to have "z_" in front.
Take that one and copy it to your ETLegacy main folder - legacy. Already having it there, start the game executable (etl.exe). Move on to next step.


Part III: LOADING SAID PK3 BUNDLE

Good. you now have everything else done. Except choosing your language. In order to change from English to whatever you want, provided it is available, console should be used.
Open console with tilde (~) on the keyboard, in the text field type \set cl_lang language-code - say, \set cl_lang pl for Polish (same language code used in filenames!!).
Of course, check back if console says language will be loaded upon next restart.

Lastly. Quit game and launch again. If you done everything right up until reading these lines, you are good to go.


This guide was provided by the community member N3rwitZ a.k.a. Nerwitz.
You can find me on ETLegacy Discord channel if you notice something like a typo: N3rwitZ/Nerwitz#8444

- Witzy Witz

poedit.png (63.7 KB) Radegast, 10.04.2013 10:43

Poedit