RimWorldCCLTeam / CommunityCoreLibrary

For full details see the official Ludeon Forums thread.
https://ludeon.com/forums/index.php?topic=16599.0
The Unlicense
60 stars 27 forks source link

Fixed Learn to play translation error #182

Closed Kelnor277 closed 7 years ago

Kelnor277 commented 7 years ago

The text showed a garbled "LearnToPlay" for the tutorial button. It looks like A15 uses "Tutorial" as the English translate key, not "LearnToPlay". However, it still uses "LearnToPlay" for other languages.

French XML from my Core/Languages/French/Keyed/Menus_Main.xml

<LearnToPlay>Apprendre à jouer</LearnToPlay>

English XML from my Core/Languages/English/Keyed/Menus_Main.xml

<Tutorial>Tutorial</Tutorial>

Looks like base game fixes it with this: (Decompiled Code) string label = "Tutorial".CanTranslate() ? "Tutorial".Translate() : "LearnToPlay".Translate(); optList.Add(new ListableOption(label, (Action) (() => MainMenuDrawer.InitLearnToPlay()), (string) null)); optList.Add(new ListableOption("NewColony".Translate(), (Action) (() => Find.WindowStack.Add((Window) new Page_SelectScenario())), (string) null));

So, I added code to find the menu item, test if "Tutorial" is translatable, and change it to "Tutorial" before it gets passed to the CCL menu drawer.

ForsakenShell commented 7 years ago

Wrong place and way to implement this fix.

ForsakenShell commented 7 years ago

Implemented "labelKeyAlt" in def to handle possible translation key differences.

https://github.com/RimWorldCCLTeam/CommunityCoreLibrary/commit/b21f81da8744d3aafd091171ddd1dff671b61956

Kelnor277 commented 7 years ago

That seems like a better idea. I've pull that code to my fork. If you want any help getting the repo up to Alpha 15 let me know.

ForsakenShell commented 7 years ago

The alpha15 branch is done, it just needs the final once-over to make sure detours are correct and all the xml is up to date with core (for xml overrides of things like the ThinkTreeDefs).

skyarkhangel commented 7 years ago

Cool