How to mod the translation of an existing Building ?

Started by Jensen, June 30, 2018, 01:51:56 AM

Previous topic - Next topic

Jensen

Hello,

I am seeking help, because I am trying to do this for a while, and didn't find how to.

I would like to change the name of the sandbag in german in my mod.

So i created this file at the root of my mod :
Languages\German\DefInjected\ThingDef\Buildings_Security.xml

I tried the following and none of them work, sadly :
<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Sandbags.label>NewName</Sandbags.label><!-- as found in core mod -->
</LanguageData>

<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
<Sandbags.degreeDatas.0.label>NewName</Sandbags.degreeDatas.0.label><!-- as found in mod adding things to the game -->
</LanguageData>

<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
  <rep>
    <path>Sandbags.degreeDatas[0].label</path><!-- as found in the example in the english folder in core -->
    <trans>NewName</trans>
  </rep>
</LanguageData>


I didn't find the right way to do it, any help is welcome !
Thanks

Haplo

The first one should normally work just fine.
All you have to do is change your folder ThingDefs to ThingDef. 8)

Jensen

@Haplo, it was a typo in the forum, so sadly it still didn't work, thanks for your help.

In english, I just add a patch file like this in a patch directory :

<Patch>
  <Operation Class="PatchOperationReplace">
    <xpath>*/ThingDef[defName="Sandbags"]/degreeDatas/li/label</xpath>
    <value>
      <label>NewName</label>
    </value>
  </Operation>
</Patch>


And it work. So i tried to add one in the German directory but it doesn't seem to register.

Any help still welcome thanks