Language files

Language files are usually found in the lang sub-folder of the project, but the place NML looks for the language files can be changed via command line parameter to any directory desired:
nmlc -l path/to/lang-dir path/to/nml-source-file.nml
nmlc --lang-dir=path/to/lang-dir path/to/nml-source-file.nml
Language files MUST have the extension .lng
The language files themselves follow a certain structure:
##grflangid <number>
<string-name>                                                   :<text>
<string-name>                                                   :<text>
...
where the first line must give the language code for the language this file describes (see below). The following lines each describe a string. The translated string follows immediately the colon. An NML project has exactly one fallback language, by default this is english.lng. You can change this with the command line parameter --default-lang. Example for a valid language file:
##grflangid 0x01
STR_GRF_NAME                                                    :{TITLE} 0.1.0 - {VERSION}
STR_GRF_DESCRIPTION                                             :{TITLE} contains pimped ground tiles.
STR_NAME_MYVEHICLE                                              :General Robotics Anti-Grav UFO Mark X
Strings may contain a number of special string codes which control how the string is being printed or which values to insert into the string. Custom replacements can be stored in the plain text file custom_tags.txt (for example a newgrf version which is written by your build script). In the case above the custom_tags.txt could, for example read
VERSION  :alpha-r88
TITLE    :Example NewGRF
Valid language IDs are
ID language
00American
01English
02German
03French
04Spanish
05Esperanto
06Ido
07Russian
08Irish
09Maltese
0ATamil
0BChuvash
0CChinese (Traditional)
0DSerbian
0ENorwegian (Nynorsk)
0FWelsh
10Belarusian
11Marathi
12Faroese
14Arabic (Egypt)
15Czech
16Slovak
18Bulgarian
1BAfrikaans
1EGreek
1FDutch
21Basque
22Catalan
23Luxembourgish
24Hungarian
26Macedonian
27Italian
28Romanian
29Icelandic
2ALatvian
2BLithuanian
2CSlovenian
2DDanish
2ESwedish
2FNorwegian (Bokmal)
30Polish
31Galician
32Frisian
33Ukrainian
34Estonian
35Finnish
36Portuguese
37Brazilian Portuguese
38Croatian
39Japanese
3AKorean
3CMalay
3ETurkish
42Thai
54Vietnamese
56Chinese (Simplified)
5AIndonesian
5CUrdu
61Hebrew
62Persian