Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation system config reading fix #476

Conversation

MahBoiDeveloper
Copy link
Contributor

During the porting of the Twisted Insurrection russifier to the new client version, I was surprised that the key reading algorithm for copying the game files was hardcoded to the key number after GameFile. Thanks to Kerbiter, I was able to quickly find the place where those keys were read and processed. Now to make this feature work, you don't need to a specific number in keys. You can use any set of letters in the keys, as long as the keys starts with GameFile.

Example [Translations] section keys in ClientDefinitions.ini with old reading algorithm:

[Translations]
; Localized in-game fonts
GameFile0=MIX/ecache98.mix,MIX/ecache98.mix

; In-game menu text
GameFile1=Resources/language_800x600.dll,Resources/language_800x600.dll
GameFile2=Resources/language_1024x720.dll,Resources/language_1024x720.dll

; In-game mission text and units naming
GameFile3=INI/LangFS.ini,INI/LangFS.ini
GameFile4=INI/Tutorial.ini,INI/Tutorial.ini

; Missions with localized briefings
GameFile5=Missions/g0.map,Maps/Missions/g0.map
GameFile6=Missions/g1.map,Maps/Missions/g1.map
GameFile7=Missions/g10.map,Maps/Missions/g10.map
GameFile8=Missions/g11.map,Maps/Missions/g11.map
GameFile9=Missions/g12.map,Maps/Missions/g12.map
GameFile10=Missions/g13.map,Maps/Missions/g13.map

Example [Translations] section keys in ClientDefinitions.ini with new reading algorithm:

; Localized in-game fonts
GameFileFonts=MIX/ecache98.mix,MIX/ecache98.mix

; In-game menu text
GameFile01=Resources/language_800x600.dll,Resources/language_800x600.dll
GameFile0000002=Resources/language_1024x720.dll,Resources/language_1024x720.dll

; In-game mission text and units naming
GameFileUnitNames=INI/LangFS.ini,INI/LangFS.ini
GameFileMissionText=INI/Tutorial.ini,INI/Tutorial.ini

; Missions with localized briefings
GameFileMissionG00=Missions/g0.map,Maps/Missions/g0.map
GameFileMissionG01=Missions/g1.map,Maps/Missions/g1.map
GameFileMissionG10=Missions/g10.map,Maps/Missions/g10.map
GameFileMissionG11=Missions/g11.map,Maps/Missions/g11.map
GameFileMissionG12=Missions/g12.map,Maps/Missions/g12.map
GameFileMissionG13=Missions/g13.map,Maps/Missions/g13.map

@github-actions
Copy link

github-actions bot commented Jun 19, 2023

Nightly build for this pull request:

Copy link
Member

@Metadorius Metadorius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could you update to the newest develop (we switched back to net48 as the main target) and verify everything works under net48?

@MahBoiDeveloper
Copy link
Contributor Author

MahBoiDeveloper commented Mar 3, 2024

PR has been updated to the newest develop changes and tested. My custom TI client works fine. Documentation has been updated too.

ClientCore/ClientConfiguration.cs Outdated Show resolved Hide resolved
ClientCore/ClientConfiguration.cs Outdated Show resolved Hide resolved
@Metadorius Metadorius merged commit e6f3f68 into CnCNet:develop Mar 3, 2024
3 checks passed
@MahBoiDeveloper MahBoiDeveloper deleted the Enhancements/TranslationSystemKeyNamingFix branch March 7, 2024 17:23
SadPencil pushed a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
* Fix logic for using any number and letters after GameFile keys

* Fix typo

* Fix syntax error and add info to the docs

* Apply suggestions from code review

---------

Co-authored-by: Kerbiter <crabiter@vivaldi.net>
SadPencil pushed a commit to SadPencil/xna-cncnet-client that referenced this pull request Oct 4, 2024
* Fix logic for using any number and letters after GameFile keys

* Fix typo

* Fix syntax error and add info to the docs

* Apply suggestions from code review

---------

Co-authored-by: Kerbiter <crabiter@vivaldi.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants