Simplify calls to CalcClosestTownFromTile
[openttd/fttd.git] / docs / HOWTO_compile_lang_files.txt
blobc56f97a621dd88f32827acc02f470a0636d86b29
1 OpenTTD and strgen
2 Last updated:    2009-06-30
3 ------------------------------------------------------------------------
6 Table of contents
7 -----------------
8 1.0) strgen usage
9  * 1.1) Examples
10  * 1.2) strgen command switches
13 1.0) strgen usage
14 ---- ------------
15 This guide is only interesting for people who want to alter something
16 themselves without access to translator.openttd.org. Please note that
17 your compiled language file will only be compatible with the OpenTTD version
18 you have downloaded english.txt, the master language file, for. While this is
19 not always true, namely when changes in the code have not touched language
20 files, your safest bet is to assume this 'limitation'.
21 As a first step you need to compile strgen. This is as easy as typing
22 'make strgen'. You can download the precompile strgen from:
23 http://www.openttd.org/download-strgen
25 strgen takes as argument a txt file and translates it to a lng file, allowing
26 it to be used inside OpenTTD. strgen needs the master language file
27 english.txt to work. Below are some examples of strgen usage.
29 1.1) Examples
30 ---- --------
31 Example 1:
32 if you are in the root of your working copy (svn code), you should type
33 strgen/strgen -s lang lang/english.txt
34 to compile englist.txt into english.lng. It will be placed in the lang dir
36 Example 2:
37 you only have the strgen executable (no working copy) and you want to compile
38 a txt file in the same directory. You should type
39 ./strgen english.txt
40 and you will get and english.lng in the same dir
42 Example 3:
43 you have strgen somewhere, english.txt in /usr/openttd/lang and you want the
44 resulting language file to go to /tmp. Use
45 ./strgen -s /usr/openttd/lang -d /tmp english.txt
47 You can interchange english.txt to whichever language you want to generate a
48 .lng file for.
50 1.2) strgen command switches
51 ---- -----------------------
52 -v | --version
53 strgen will tell what svn revision it was last modified
55 -t | --todo
56 strgen will add <TODO> to any untranslated/missing strings and use the english
57 strings while compiling the language file
59 -w | --warning
60 strgen will print any missing strings or wrongly translated (bad format)
61 to standard error output(stderr)
63 -h | --help | -?
64 Print out a summarized help message explaining these switches
66 -s | --source_dir
67 strgen will search for the master file english.txt in the directory specified
68 by this switch instead of the current directory
70 -d | --dest_dir
71 strgen will put <language>.lng in the directory specified by this switch; if
72 no dest_dir is given, output is the same as source_dir