annotate docs/HOWTO_compile_lang_files.txt @ 8786:e2d4956b7251 draft

(svn r12490) -Codechange: rename engine.h to engine_func.h and remove unneeded inclusions of engine.h and/or replace them with engine_type.h.
author rubidium <rubidium@openttd.org>
date Mon, 31 Mar 2008 00:17:39 +0000
parents 90d844532d8d
children 119424494408
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5408
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
1 STRGEN USAGE
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
2 ------------
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
3 This guide is only interesting for people who want to alter something
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
4 themselves without access to WT2 (translator2.openttd.org). Please note that
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
5 your compiled language file will only be compatible with the OpenTTD version
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
6 you have downloaded english.txt, the master language file, for. While this is
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
7 not always true, namely when changes in the code have not touched language
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
8 files, your safest bet is to assume this 'limitation'.
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
9 As a first step you need to compile strgen. This is as easy as typing
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
10 'make strgen'. You can also download a precompiled binary from a release,
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
11 nightly, etc.
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
12 strgen takes as argument a txt file and translates it to a lng file, allowing
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
13 it to be used inside OpenTTD. strgen needs the master language file
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
14 english.txt to work. Below are some examples of strgen usage.
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
15
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
16 EXAMPLES
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
17 --------
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
18 Example 1:
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
19 if you are in the root of your working copy (svn code), you should type
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
20 strgen/strgen -s lang lang/english.txt
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
21 to compile englist.txt into english.lng. It will be placed in the lang dir
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
22
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
23 Example 2:
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
24 you only have the strgen executable (no working copy) and you want to compile
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
25 a txt file in the same directory. You should type
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
26 ./strgen english.txt
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
27 and you will get and english.lng in the same dir
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
28
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
29 Example 3:
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
30 you have strgen somewhere, english.txt in /usr/openttd/lang and you want the
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
31 resulting language file to go to /tmp. Use
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
32 ./strgen -s /usr/openttd/lang -d /tmp english.txt
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
33
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
34 You can interchange english.txt to whichever language you want to generate a
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
35 .lng file for.
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
36
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
37 STRGEN COMMAND SWITCHES
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
38 -----------------------
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
39 -v | --version
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
40 strgen will tell what svn revision it was last modified
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
41
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
42 -t | --todo
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
43 strgen will add <TODO> to any untranslated/missing strings and use the english
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
44 strings while compiling the language file
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
45
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
46 -w | --warning
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
47 strgen will print any missing strings or wrongly translated (bad format)
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
48 to standard error output(stderr)
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
49
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
50 -h | --help | -?
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
51 Print out a summarized help message explaining these switches
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
52
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
53 -s | --source_dir
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
54 strgen will search for the master file english.txt in the directory specified
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
55 by this switch instead of the current directory
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
56
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
57 -d | --dest_dir
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
58 strgen will put <language>.lng in the directory specified by this switch; if
90d844532d8d (svn r7605) -Update documentation of MSVC and strgen in docs/ dir and remove directmusic.txt
Darkvater <Darkvater@openttd.org>
parents:
diff changeset
59 no dest_dir is given, output is the same as source_dir