true-community / true-localisation

0 stars 1 forks source link

true-localisation | True Stalker

alt text

Ready-to-use language packs for True Stalker can be found in [RELEASES](https://github.com/true-community/true-artifacts/tree/releases/localisation/staging)

Current repository has source code for True Stalker localisation.

To suggest your own changes you can do one of the following:

Translation flow

  1. Make edits in text strings
  2. Test changes in game
  3. Submit your changes via pull request
About XML file encoding... [!] The game engine is hardcoded to work with single-byte character sets (= does not support UTF-8 encoding)!
Although, basic latin letters are displayed identically for either one, accents and other non-[ASCII](https://en.wikipedia.org/wiki/ASCII) characters are not. Every XML file must start with declaration tag `

[!] If you use ampersands, make sure to replace & with &

Changing language

  • If your language is already officially in the game, just switch to it from the menu.

  • If not — set language code in your userdata/user.ltx file: g_language rus (replace "rus" with your language code as per gamedata/config/text/? directory's name)




[ EXTRAS / for developers ] #### Requirements: - [bun](https://bun.sh/docs/installation) ### Structure of the project | Directrory | Content description | ----------- | - | unpacked | all the archive files extracted; you likely do not need all of them, since that would load some resources twice | gamedata | the actual overrides you need ... ### Extract DB archives yourself 0. Make sure you have a suitable converter tool at hand (ex: [CoC DB converter](https://www.moddb.com/mods/call-of-chernobyl/downloads/cop-coc-db-converter)), place `converter.exe`1 in this directory next to _README.md_ file 1. Find localisation DB file from content/resources directory 2. Run the `./run.ts unpack` to automagically extract from _db_ files ### Create DB archives yourself (WIP) 0. Make sure you have a suitable converter tool at hand (ex: [CoC DB converter](https://www.moddb.com/mods/call-of-chernobyl/downloads/cop-coc-db-converter)), place `converter.exe`1 in this directory next to _README.md_ file 1. Create the DB files via `./run.ts pack` ### Settings Here are [the default values](./settings.default.json) that you can change to suit your needs: ```json { "content_order": [ // 1 "resources", "language", "patches" ], "converter": "./converter.exe", // 2 "converter_command_templates": { // 3 "unpack": [ "-unpack", "-xdb", "**PATH_INPUT**", "-dir", "**PATH_OUTPUT**" ], "pack": [ "-pack", "-xdb", "**PATH_INPUT**", "-out", "**PATH_OUTPUT**" ] }, "launcher": "./PlayGame.exe", // 4 "launcher_arguments": "", // 5 "xml_options": { // 6 "prettify_unpacked": true, "minify_repacked": true }, "i_verified_settings": false // 7 } ``` 1. Lower override higher, if files with same name are present in multiple archives (newer patches replace older files). 2. Executable that is used for conversion. __NOT__ provided here. 3. When my script invokes the converter call, this is the command 4. Executable that launcher the game. 5. CLI arguments to start launcher with. 6. Whether you want to process XML files or not (WIP) 7. A safety measure for you to check the settings once at least :) ---
Where I got the language strings from
I own the copy of S.T.A.L.K.E.R.: Call of Pripyat on Steam and it has `localization` directory in game files. In that directory you can find x{language}.db file (for language you chose for the game on Steam). So, in order to get all the official locales I switched between the languages and extracted the archives via converter. I used the same converter to extract language strings from True Stalker's `content/resources/xlocalization.db` file. --- (i) Alternative approach to extracting game files is by replacing `bin/xrAPI.dll` with modified library that dumps the game content while the game is running (Lua script injection).
### Help me improve the CLI extractor tool Any [suggestion](https://github.com/true-community/true-localisation/issues) is welcome, if you want to help me with the toolkit.