How to Create a Translation Script

Started by _Hark_green, May 27, 2024, 04:39:54 PM

Previous topic - Next topic

_Hark_green

I am currently working on a translation for a mod, but the def files in this mod are not very standard. I am unsure how to structure the translation script.

Here is a typical example of one of its def files:
<HediffDef ParentName="AddedBodyPartBase">
  <defName>AdvancedArchotechLeg</defName>
  <label>advanced archotech leg</label>
  <labelNoun>an advanced archotech leg</labelNoun>
  <description>An installed advanced archotech leg.</description>
  <descriptionHyperlinks><ThingDef>AdvancedArchotechLeg</ThingDef></descriptionHyperlinks>
  <spawnThingOnRemoved>AdvancedArchotechLeg</spawnThingOnRemoved>
  <addedPartProps>
    <solid>true</solid>
    <partEfficiency>4</partEfficiency>
  </addedPartProps>
</HediffDef>

<ThingDef ParentName="ArchoPartAdvanced">
  <defName>AdvancedArchotechLeg</defName>
  <label>advanced archotech leg</label>
  <description>An advanced version of the archotech's artificial leg. It looks the same as a regular leg, but allows you much faster movement. Its internal workings are a mystery to all human minds.</description>
  <descriptionHyperlinks><RecipeDef>InstallAdvancedArchotechLeg</RecipeDef></descriptionHyperlinks>
  <costList>
    <Attomachinery>12</Attomachinery>
    <Picomachinery>25</Picomachinery>
    <ComponentSpacer>1</ComponentSpacer>
  </costList>
  <statBases>
    <MarketValue>20000</MarketValue>
    <Mass>4</Mass>
    <ArmorRating_Sharp>1</ArmorRating_Sharp>
    <ArmorRating_Blunt>1</ArmorRating_Blunt>
  </statBases>
  <techHediffsTags>
    <li>Archotech</li>
  </techHediffsTags>
</ThingDef>

<RecipeDef ParentName="SurgeryInstallBodyPartProstheticBase">
  <defName>InstallAdvancedArchotechLeg</defName>
  <label>install advanced archotech leg</label>
  <description>Install an advanced archotech leg.</description>
  <descriptionHyperlinks><ThingDef>AdvancedArchotechLeg</ThingDef></descriptionHyperlinks>
  <jobString>Installing advanced archotech leg.</jobString>
  <ingredients>
    <li>
      <filter>
        <thingDefs>
          <li>AdvancedArchotechLeg</li>
        </thingDefs>
      </filter>
      <count>1</count>
    </li>
  </ingredients>
  <fixedIngredientFilter>
    <thingDefs>
      <li>AdvancedArchotechLeg</li>
    </thingDefs>
  </fixedIngredientFilter>
  <appliedOnFixedBodyParts>
    <li>Leg</li>
  </appliedOnFixedBodyParts>
  <addsHediff>AdvancedArchotechLeg</addsHediff>
</RecipeDef>
Should I extract each object separately and write them into their respective HediffDef, ThingDef, or RecipeDef? Or is there another way?