- en
- pl
OpenTTD GitHub
Contributing to OpenTTD - guidelines
OpenTTD Doxygen
Coding style
Compiling OpenTTD
Debugging
Add a setting
Add a squirrel function
Understanding the SaveGame handler
Bumping the savegame version
Doing an OpenTTD release
Manual of style
Format of langfiles
Using OpenTTD strings
List of special strings
Using the window system
Colour codes that exist in OpenTTD
Adding a text box
Understanding the widget focus system
GUI style guide
The OpenTTD TCP protocol
The OpenTTD UDP protocol
Debugging desyncs
Server Admin Port development
The console window
Console commands
Console variables
Using console scripting
Adding functions/commands to the console
Adding variables to the console
Console development history
Graphics and similar (NewGRF)
AI framework (NoAI)
GameScript framework (NoGO)
Social Integration
Map array (landscape grid)
Vehicles
Pathfinding
Train acceleration
Sound IDs
End-user available texts allow to make use of special strings which allow to deal as placeholders and symbols, adjustments due to inflection, or change the formatting.
Contents |
General
Special Strings are always enclosed in curly brackets. Depending on the content within these curly brackets a certain command is triggered. These commands can be grouped as follows:
- Replacement for symbols such as a train symbol, a bus symbol, or the "X" symbol at the top of a window to close it,
- Change formatting such as making text colour look green/red/..., or changing the font size,
- Placeholders such as another string, a value for a cargo that is waiting at a station, or a vehicle's number,
- Inflection such as adjustments to other words to allow context-aware translation.
See below for a complete list of commands currently available:
Special characters and symbols
Command | Description |
{} | Go to the next line |
{NBSP} | non-breaking space |
{{} | { |
{CENT} | ¢ |
{EURO} | € |
{POUNDSIGN} | £ |
{YENSIGN} | ¥ |
{UPARROW} | ↑ |
{DOWNARROW} | ↓ |
{RIGHTARROW} | → |
{SMALLUPARROW} | small ↑ |
{SMALLDOWNARROW} | small ↓ |
{COPYRIGHT} | © |
{REGISTERED} | ® |
{CHECKMARK} | (a checkmark) |
{CROSS} | (an X, used for closing windows) |
{TRAIN} | icon of a train |
{LORRY} | icon of a lorry / truck |
{BUS} | icon of a bus |
{PLANE} | icon of a plane |
{SHIP} | icon of a ship |
{STATIONFEATURES} | small icons of the supported vehicle types of a specific station |
Formatting
Command | Description |
{TINYFONT} | switch to tiny font |
{BIGFONT} | switch to big font |
{BLACK} {WHITE} {RED} {GREEN} {BLUE} {YELLOW} {ORANGE} {PURPLE} {GRAY} {BROWN} {SILVER} {GOLD} {CREAM} {LTBLUE} {DKBLUE} {DKGREEN} {LTBROWN} |
Change the colour of the string, or the part of string until overridden by another colour to this colour. |
Placeholders
Formatted Numbers | |||
---|---|---|---|
Command | Number of Params used | Description | Example (using EN-UK locale) |
{NUM} | 1 | show a 32-bit signed integer number | 1600 |
{COMMA} | 1 | show a 32-bit signed integer number with a thousands separator | 14,000 |
{CURRENCY} | 1 | number as a currency (with maximal value of approx. 4 billion) | € 230,000 |
{CURRENCY64} | 1 | a 64-bit number extended with currency symbols | € 10,000,000,00 |
{CURRCOMPACT}
|
1 | short version of currency (used in graphs) | |
{CURRCOMPACT64}
|
1 | a compacted 64-bit number extended by currency symbols | |
{DATE_TINY} | 1 | tiny date version | 01-07-2004 |
{DATE_SHORT} | 1 | short date version | February 2004 |
{DATE_LONG} | 1 | long date version | 25th February 2004 |
{FORCE} | 1 | show number as force | 1500kN |
{POWER} | 1 | show number as power | 6000HP |
{VELOCITY} | 1 | show number as speed | 120km/h or 195mph |
{VOLUME} | 1 | show number as volume | 1,000 litres |
{VOLUME_S} | 1 | show number as volume | 1,000L |
{WEIGHT} | 1 | show number as weight | 1,000 tonnes |
{WEIGHT_S} | 1 | show number as weight | 1,000T |
{CARGO} | 2 | show number as cargo | 950 tonnes of Coal |
{SHORTCARGO} | 2 | number with cargo units | 950 tonnes |
Plain String Replacements | |||
---|---|---|---|
Command | Number of Params used | Description | Comment |
{STRING}
|
1 | get a string without parameters from an index | |
{STRING1} | 2 | get a string with 1 parameter |
Use in english.txt only; in other language files use {STRING} instead. Note that these commands may lead to a nested resolution of commands. For details, refer to here. |
{STRING2} | 3 | get a string with 2 parameters | |
{STRING3} | 4 | get a string with 3 parameters | |
{STRING4} | 5 | get a string with 4 parameters | |
{STRING5} | 6 | get a string with 5 parameters | |
{STRING6} | 7 | get a string with 6 parameters | |
{STRING7} | 8 | get a string with 7 parameters | |
{RAW_STRING} | 1 | get a verbatim string |
Use in english.txt only; in other language files use {STRING} instead. Additional information on how RAW_STRINGs are being used can be found here. |
String Replacements with semantics | ||
---|---|---|
Command | Number of Params used | Description |
{COMPANY} | 1 | get the company name pointed to by this index |
{PLAYERNAME} | 1 | get the player name pointed to by this index |
{STATION} | 1 | get the station name pointed to by this index |
{TOWN} | 1 | get the town name pointed to by this index |
{INDUSTRY} | 1 | get the industry name pointed to by this index |
{WAYPOINT} | 1 | get the waypoint name pointed to by this index |
{VEHICLE} | 1 | get the vehicle name pointed to by this index |
{GROUP} | 1 | get the vehicle group name pointed to by this index |
{ENGINE} | 1 | get the engine name pointed to by this index |
{SIGN} | 1 | get the sign name pointed to by this index |
Miscellaneous other Placeholders | ||
---|---|---|
Command | Number of Params used | Description |
{REV} | 0 | OpenTTD revision string |
Inflection
Command | Number of Params used | Description | References |
{P} | 0 | Plural modifier | Further information on using plural special strings in strings |
{G} | 0 | Gender modifier | Further information on using genders in strings |