Ludeon Forums

RimWorld => Mods => Translations => Topic started by: Kenneth on May 12, 2020, 11:27:24 AM

Title: To all translators: TKeys
Post by: Kenneth on May 12, 2020, 11:27:24 AM
Hey,

We've just implemented a new feature called "TKey".
With TKeys we and modders are able to attribute XML elements with a key that can be used to address them directly in translations.

Currently, when translating a quest text you have to access paths like "<PawnLend.root.nodes.RandomNode.nodes.Sequence-0.nodes.Set.value.slateRef>".
This makes translations XML hard to understand and it's very likely that this string will break as soon as we change something on this quest.

With TKey's you can now address the same data using a much shorter and less likely to break path like this "<PawnLend.LetterTextReturnAfterHelping.slateRef>".
The translation report generator will suggest using the TKey paths and the translation files cleaner will even automatically update your already existing language data for you to use TKeys!

Any XML element in the game data can be attributed with TKey="[TKEY]", which will make it addressable using "[DefName].[TKey]".
We've added TKey's to all quest script and tip set defs, and will possibly expand this in the future.

A  build with the TKey system included will go live today (on unstable branch).
In case you got questions or have issues with it, please join our public testing discord (https://discord.gg/FYBsdNX) - feel free to tell us in #translations channel and ping me (@Kenneth).
You can also send me a direct message on the forums or discuss in this thread.
Title: Re: To all translators: TKeys
Post by: Ragnar-F on May 19, 2020, 09:18:59 AM
When generating a translation report, following TKey system errors are included:
========== TKey system errors (2) ==========
Duplicate TKey: Hospitality_Util_Worker.LetterLabelQuestCompleted -> NEW=Hospitality_Util_Worker.root.nodes.32.node.node.nodes.2.node.nodes.0.label | OLDHospitality_Util_Worker.root.nodes.32.node.node.nodes.1.node.nodes.0.label - Ignoring old
Duplicate TKey: Hospitality_Util_Worker.LetterLabelQuestFailed -> NEW=Hospitality_Util_Worker.root.nodes.33.node.nodes.0.label | OLDHospitality_Util_Worker.root.nodes.30.elseNode.node.nodes.0.label - Ignoring old
Title: Re: To all translators: TKeys
Post by: Kenneth on May 21, 2020, 08:10:43 AM
Quote from: Ragnar-F on May 19, 2020, 09:18:59 AM
When generating a translation report, following TKey system errors are included:
========== TKey system errors (2) ==========
Duplicate TKey: Hospitality_Util_Worker.LetterLabelQuestCompleted -> NEW=Hospitality_Util_Worker.root.nodes.32.node.node.nodes.2.node.nodes.0.label | OLDHospitality_Util_Worker.root.nodes.32.node.node.nodes.1.node.nodes.0.label - Ignoring old
Duplicate TKey: Hospitality_Util_Worker.LetterLabelQuestFailed -> NEW=Hospitality_Util_Worker.root.nodes.33.node.nodes.0.label | OLDHospitality_Util_Worker.root.nodes.30.elseNode.node.nodes.0.label - Ignoring old


Thanks for reporting, the next unstable build should fix this. We've changed some TKeys in Hospitality_Util_Worker.