-
Notifications
You must be signed in to change notification settings - Fork 16
Client Text Internationalization
This page will go over how the client reads the text files and how that text is used by the client.
The client loads two files based on the configured locale (See 3. Locale Configuration), the files are read from the .\locale\ folder in the following format <locale>_data.dir / <locale>_data.dat.
Eg:
en_gb_data.dir/en_gb_data.dat
The .dir file is what the game reads first because it contains the necessary info within it to then read the .dat file. The .dir file is read line by line and there are around 10 metadata lines at the start which are prefixed with ##, after the metadata lines the file is read like the following;
Hash Offset Size Format
42093 3 37 d
...
Hash - This is the hash. (See 3. Hash)
Offset - This is the offset of the text (inside the .dat).
Length - This is the length of the text (inside the .dat).
The .dat file is also line based and consists of the following;
Hash Format Text
42093 ugdt Level 15 Brawler Test Misc
Note: The .dat file starts with a Byte Order Mark (BOM).
Eg: Offset
3is the start of the first line (because of the BOM) and37is the length of42093 ugdt Level 15 Brawler Test Misc.
The locale can be configured in two ways, via the Command Line or Configuration File. Both options use the same section Internationalization and key Locale and the value can either be an Id or Code. (See 4. Supported Locales)
Configuration File - Reading the ClientConfig.ini or ClientConfigOverride.ini by default unless you specify another configuration file using the inifile command line argument.
[Internationalization]
Locale=4
or
Locale=en_gbCommand Line - Reading the Internationalization:Locale command line argument.
FreeRealms.exe ... Internationalization:Locale=4 ...
or
FreeRealms.exe ... Internationalization:Locale=en_gb ...
| Id | Code | Name |
|---|---|---|
| 1 | zh_CN | Chinese - Simplified |
| 2 | de_DE | German |
| 3 | fr_FR | French |
| 4 | en_GB | English (United Kingdom) |
| 5 | ja_JP | Japanese |
| 6 | ko_KR | Korean |
| 7 | zh_TW | Chinese - Traditional |
| 8 | en_US | English |
| 9 | es_ES | Spanish |
| 10 | it_IT | Italian |
| 11 | pt_PT | Portuguese (Portugal) |
| 12 | ru_RU | Russian |
| 13 | sv_SE | Swedish |
| 14 | pt_BR | Portuguese (Brazil) |
| 15 | es_MX | Spanish (Mexico) |
| 16 | nl_NL | Dutch |
| 17 | pl_PL | Polish |
| 18 | fi_FL | Finnish (Finland) |
| 19 | da_DK | Danish |
| 20 | nn_NO | Norwegian Nynorsk (Norway) |
The hash used in the .dir and .dat is generated using the Jenkins lookup2 algorithm.
The hash comes from hashing the following Global.Text.<id>, the Id is used throughout the client for things like Item Names.
Here is a .NET C# example on hashing the Id 423614 returning hash 3916023129 which is the text I'm a noob. using the en_us locale.