1 # How to compile lang files (OpenTTD and strgen)
3 Last updated: 2009-06-30
7 This guide is only interesting for people who want to alter something
8 themselves without access to [translator.openttd.org](https://translator.openttd.org/).
10 Please note that your compiled language file will only be compatible with the OpenTTD version
11 you have downloaded `english.txt`, the master language file, for. While this is
12 not always true, namely when changes in the code have not touched language
13 files, your safest bet is to assume this 'limitation'.
15 As a first step you need to compile strgen. This is as easy as typing
16 `'make strgen'`. You can download the precompile strgen from:
17 [http://www.openttd.org/download-strgen](http://www.openttd.org/download-strgen)
19 strgen takes as argument a txt file and translates it to a lng file, allowing
20 it to be used inside OpenTTD. strgen needs the master language file
21 `english.txt` to work. Below are some examples of strgen usage.
27 If you are in the root of your working copy (git repository), you should type
28 `./strgen/strgen -s lang lang/english.txt`
29 to compile `english.txt` into `english.lng`. It will be placed in the lang dir.
33 You only have the strgen executable (no working copy) and you want to compile
34 a txt file in the same directory. You should type
35 `./strgen english.txt`
36 and you will get and `english.lng` in the same dir.
40 You have strgen somewhere, `english.txt` in `/usr/openttd/lang` and you want the
41 resulting language file to go to /tmp. Use
42 `./strgen -s /usr/openttd/lang -d /tmp english.txt`
44 You can interchange `english.txt` to whichever language you want to generate a
47 ## strgen command switches
50 strgen will tell what git revision it was last modified
53 strgen will add <TODO> to any untranslated/missing strings and use the english
54 strings while compiling the language file
57 strgen will print any missing strings or wrongly translated (bad format)
58 to standard error output(stderr)
61 Print out a summarized help message explaining these switches
64 strgen will search for the master file english.txt in the directory specified
65 by this switch instead of the current directory
68 strgen will put <language>.lng in the directory specified by this switch; if
69 no dest_dir is given, output is the same as source_dir