-
Notifications
You must be signed in to change notification settings - Fork 92
Contributing
Assuming you're here because you're interested in contributing to Long War of the Chosen, that's great news! There are many tasks that folks can help with, not just coding. We'll detail some of them here. If you have any further questions, please don't hesitate to drop in the Discord server for LWOTC and ask there.
Most forms of contribution involve modifying, adding or removing files in the mod. We use GitHub to manage that process. So if you're planning to touch the mod files at all, you'll need to follow these steps:
-
Fork the repository
This basically creates a copy of the LWOTC repository that you can change to your heart's content without affecting the LWOTC project itself. See the GitHub Help page for information on how to do this.
-
Submit changes as pull requests
When you make changes to your fork (copy of the LWOTC repository) and you want us to include them in LWOTC itself, then you send us what's known as a pull request. You're basically asking us to "pull" your changes into the LWOTC repository. See the GitHub Help page for instructions on creating pull requests in the GitHub UI.
With your new fork of LWOTC, it's possible to submit configuration and localization changes entirely through browser. No local copy needed.
- Navigate to
https://github.com/<your-github-username>/lwotc/branches
- Select "New branch".
- As the branch name, select something descriptive for the change you're making. It doesn't need to be 100% perfect and can change if the scope of the change evolves.
- As the source, select the upstream repository
long-war-2/lwotc
and the appropriate branch:master
if your change applies to stable, orbeta
if it applies to beta. - Edit the files as you see appropriate.
- Start a pull request. Target the branch you based yours on.
A practical way to make these edits are to modify the files of your Steam Workshop files of LWOTC using a proper text editor, then copy-pasting the contents into GitHub's text editor in browser.
The second easiest task on a technical front is translating the English language text from the mod into another language.
All the in-game text that has translations is contained in UTF-8 text files in the LongWarOfTheChosen/Localization directory. Some of the text files are in subdirectories that correspond to these things called packages in the mod. They're just a way of grouping related code and configuration together. You typically won't need to worry about the directory structure at all.
Note however that XCOM 2 consumes localization files as UTF-16 LE. If you are building the mod locally, the build process takes care of correct encodings, but otherwise you'll have to manage those yourself.
Apart from encoding, you'll only really need to know that each language has its own extension for each base filename:
-
.int
- English language (short for "international") -
.chn
- Simplified Chinese -
.cht
- Traditional Chinese -
.deu
- German -
.esn
- Spanish -
.fra
- French -
.ita
- Italian -
.jpn
- Japanese -
.kor
- Korean -
.pol
- Polish -
.rus
- Russian
The .int
files are the source of truth when it comes to text in the game, so if there's a discrepancy between it and another language file, assume that the .int
file is correct (and if it seems wrong, raise it on Discord).
The following rule has been ignored for a long time. It would be good to consider a solution that combines git blame with ini scraping. --copyrite
So how do you know what needs translating? As far as LWOTC is concerned, we're marking blocks of text that we change in the .int
files with:
; LWOTC Needs Translation
...
; End Translation
Anything within those blocks needs translating if it hasn't been already. We recommend that you load all the localization files into a text editor with a good Find in Files feature. Notepad++ and Visual Studio Code both allow you to open a directory (like Localization) and search all files in that directory. You can then double-click on the results to open the corresponding file in the editor. Many other text editors have the same feature.
Once you've translated a block like this, it's probably worth tracking that you've done so in the translation file. Just put the modified text within a similar block to the one above:
; LWOTC Translated
...
; End Translated
What happens if some text is changed after you've translated it, maybe a few weeks or months later? In that case, we'll attach a counter to the marker text, like this:
; LWOTC Needs Translation (2)
Once you've translated it again, just append the counter to your own marker:
; LWOTC Translated (2)
You may also encounter translated text that hasn't been explicitly marked as requiring translation but is woefully wrong. Feel free to fix any and all text that you want to! We would like good translations of the whole mod, not just the LWOTC changes.
Now explained in readme. Cloning the repo and building it locally is practically required if you're going to contribute anything larger than what was described under the previous subtitles. This option has you maintaining your local copy of LWOTC, which you can use for testing your own bugfixes and enhancements.