[Question] How to mod an existing translation?

Started by Protok, December 06, 2019, 09:42:15 AM

Previous topic - Next topic

Protok

So, I have new defs and translation for them worked properly.
But, when I try to change translation of existing defs it's not working.

What should I do to change original translation in my mod?

LWM

Broader context?

You have a mod that is translated, that you have added new things to?
You have a mod that is not translated, that you have translations for?
You have vanilla defs you want to change the translation for?

Protok

Quote from: LWM on December 06, 2019, 10:50:30 AM
You have vanilla defs you want to change the translation for?
Third. My mod need another description for vanilla def.

LWM

Here's the general directory setup and contents of an XML file I use to change the label of Caribou in a mod I'm working on:

$ ls Languages/English/DefInjected/
PawnKindDef/  ThingDef/
$ ls Languages/English/DefInjected/ThingDef/
Races_Animal_Temperate.xml
$ cat Languages/English/DefInjected/ThingDef/Races_Animal_Temperate.xml
<?xml version="1.0" encoding="UTF-8"?>
<LanguageData>
  <!-- EN: caribou -->
  <Caribou.description>A large member of the deer family, well-adapted to life in cold climates. Caribou on the
Rim usually descend from a mix of Old Earth stocks, including "reindeer" whose ancestors helped humans
cross icy wastes in the legendary pre-space-age days. All "caribou" can be milked, but only some can be
trained to accept reins and carry packs.</Caribou.description>
</LanguageData>


I hope that gives you an idea of how you can do what you want?
--LWM
(edit b/c I slipped and hit post before I finished typing)

Protok

I expect that's will not heavier then do the next patching:
Mods\HybridForest\Languages\Russian\PatchingCore.xml
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationReplace">
   <xpath>/Defs/BiomeDef[1]/description</xpath>
   <value>
               <description>Густая смешанная растительность с обилием озёр и болот. Множество диковинных цветов и трав. Изредка попадаются снежные возвышенности окружённые ледяными грунтовыми водами. Низинами проходят мшистые дороги. Обилие влаги приводит к высокой степени распространения инфекций, как в тропиках. Большое разнообразие растительности привлекает множество видов травоядных, а за ними и хищников всех мастей. Иногда сюда забредают отбившиеся от улья насекомые, которых можно приручить. Говорят гибридный лес ещё опаснее тропического.</description>
   </value>
</Operation>

<Operation Class="PatchOperationReplace">
   <xpath>/Defs/BiomeDef[1]/label</xpath>
   <value>
               <label>гибридный лес</label>
   </value>
</Operation>
</Patch>


But thats do nothing...

LWM

Quote from: Protok on December 17, 2019, 06:43:31 AM
I expect that's will not heavier then do the next patching:

Ah?

Yes, patching description directly also works - quite well.  I offered it as an example of how to translate the description, and it works even into the original language.

PS:
<xpath>/Defs/BiomeDef[1]/description</xpath>
I would always be wary of this, because some other modder might have deleted a biome or somehow added one in the beginning.  I personally would prefer <xpath>/Defs/BiomeDef[defName=etc]/description</xpath> or some unique identifier that is not order dependent.