-
Notifications
You must be signed in to change notification settings - Fork 207
Language files
This article focuses on topic from translator's point of view.
Note: this article focuses on .txt language files, which are just one part of localisation of the game into any given language. Second part, objects files, are described separately
In a playable copy of OpenRCT2, language .txt files reside in data/language directory, depending on platform and packaging variant used, location may vary:
Installed by installer: drive_c\Program Files\OpenRCT2\data\language
Althought Appimage is observably one single file that can be run and seems hard to modify, for purposes of translation it is sufficient to extract it using it's own hidden extraction mechanism.
If downloaded AppImage was not yet made executable:
$ chmod +x OpenRCT2.AppImage
Extraction:
$ ./OpenRCT2.AppImage --appimage-extract
which will create new sub-directory squashfs-root in which we can find usr/share/openrct2/language
It is of course possible to simply open preferred GUI file browser over that directory, eg:
$ nautilus squashfs-root/usr/share/openrct2/language/
Example of language file:
STR_1402 :Build or move entrance to ride/attraction
STR_1403 :Build or move exit from ride/attraction
STR_1404 :Rotate 90°
STR_1405 :Mirror image
STR_1406 :Toggle scenery on/off (if available for this design)
# some comment commenting something
STR_1407 :{WINDOW_COLOUR_2}Build this…
STR_1408 :{WINDOW_COLOUR_2}Cost: {BLACK}{CURRENCY}
STR_1409 :Entry/Exit Platform
STR_1410 :Vertical Tower
STR_1411 :{STRINGID} in the way
STR_1412 :{WINDOW_COLOUR_3}Data logging not available for this type of ride
STR_1413 :{WINDOW_COLOUR_3}Data logging will start when next {STRINGID} leaves {STRINGID}
STR_1414 :{BLACK}{DURATION}
The strings are prefixed with STR__nnnn_ : where nnnn denotes number of string. The part to translate is after the colon :. The part on left side of : colon is exactly 8 characters long and it's length needs to remain the same. On the right side, there is a text, in technical terminology called a string
Parts in curly brackets {} denote formatting or expansion of variables. They are used in places where it is necessary to change a text format, eg. colour or break a line, or in second case substitute expressions with something meaningful on the run, such as number stating current amount of guest cash. Translation is not supposed to change anything inside {} however localisation can place them anywhere in the sentence where its appropriate.
As it's text suggests, {NEWLINE} formater forces line break - in other words, a new line.
Some strings are made only of {} expressions, most likely there is no need to translate those. Once changes to translation are submitted via PR to Localisation repository, an automated action is performed to check these technical strings. List of strings that are not supposed to be translated can be found inside translation_check.py , while there exist a list of exceptions , since a few localisations (mostly using something other than latin letters for writing) need to alter these.
The strings are used everywhere where game displays a text - theoretically, there should be no untranslatable texts. It is important to bear in mind that some strings can be reused, meaning the game utilises them in more than one place. This wiki offers an What goes where exhaustive list that can be used to get idea.
It is possible to search thru source code to determine usage of given string. Transformation of string numbers into c constants are defined in enum in .h (header) files StringIds.h, UiStringIds.h and RideStringIds.h in source code. Some of the string numbers are not directly assigned, but rather computed via addition, thus plain text searching these for number of might be insufficient.