Need help with coding in translation

Started by deeperman, January 27, 2017, 08:58:18 AM

Previous topic - Next topic

deeperman

Sorry that appeal to you.
Thanks in advance for your answer.
I'm with friends is almost completely transferred to Clutter mod into Russian.
But faced with a problem in the Books.xml file
in particular how to translate text books
<BookText>
   <li>Why i dont eat black jelly beans </li>
   <li> i just haven't liked them</li>
   <li>ever since the accident</li>
   <li>not since the accident </li>
   <li>i will tell you</li>
   <li>once upon a time</li>
   <li>in a far away land</li>
   <li>there lived a small child</li>
   <li>by the name of Parallel_Parkour</li>
   <li>he loved jelly beans</li>
   <li>even the black ones</li>
   <li>but everything changed when the fire nation attacked</li>
   </BookText>

Full file code, it is not clear how to translate the text in books
<?xml version="1.0" encoding="utf-8" ?>
<GameData>


  <ThingDef Name="BookBase" Abstract="True">
    <thingClass>ThingWithComps</thingClass>
    <label>unspecified resource</label>
    <category>Item</category>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <useHitPoints>true</useHitPoints>
    <statBases>
  <MaxHitPoints>80</MaxHitPoints>
      <Flammability>1.0</Flammability>
    </statBases>
    <selectable>true</selectable>
    <altitudeLayer>Item</altitudeLayer>
<tickerType>Normal</tickerType>
    <stackLimit>75</stackLimit>
    <comps>
      <li>
        <compClass>CompForbiddable</compClass>
      </li>
    </comps>
    <alwaysHaulable>false</alwaysHaulable>
    <drawGUIOverlay>true</drawGUIOverlay>
    <rotatable>true</rotatable>
    <pathCost>15</pathCost>
  </ThingDef>




  <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>ParallelBook</defName>
<label>Black jelly beans </label>
<Description>Book writed by author know only under his pen name as Parallel_Parkour
</Description>
<graphicData>
<texPath>Clutter/Books/BookBlue</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>Why i dont eat black jelly beans </li>
<li> i just haven't liked them</li>
<li>ever since the accident</li>
<li>not since the accident </li>
<li>i will tell you</li>
<li>once upon a time</li>
<li>in a far away land</li>
<li>there lived a small child</li>
<li>by the name of Parallel_Parkour</li>
<li>he loved jelly beans</li>
<li>even the black ones</li>
<li>but everything changed when the fire nation attacked</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Blue</CloseTexture>
  </ThingDef>

    <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>MaidenWine</defName>
<label>Maiden Wine</label>
<Description>Ballad of unkown author.</Description>
<graphicData>
<texPath>Clutter/Books/BookGreen</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>Take care, young ladies, and value your wine.</li>
<li> Be watchful of young men in their velvet prime.</li>
<li>Deeply they'll swallow from your finest kegs,</li>
<li>Then swiftly be gone, leaving bitter dregs.</li>
<li>Ahh-ah-ah-ah, bitter dregs.</li>
<li>With smiling words and tender touch,</li>
<li>Man offers little and asks for so much</li>
<li>He loves in the breathless excitement of night,</li>
<li>Then leaves with your treasure in cold morning light.</li>
<li>Ahh-ah-ah-ah, in cold morning light.</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Green</CloseTexture>
  </ThingDef>
 
      <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>StormyNight</defName>
<label>It was a Dark and Stormy Night</label>
<Description>Novel writen by Snoppy</Description>
<graphicData>
<texPath>Clutter/Books/BookViolet</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>It was a dark and stormy night.</li>
<li> Suddenly, a shot rang out!</li>
<li>A door slammed.</li>
<li>The maid screamed.</li>
<li>Suddenly, a pirate ship appeared on the horizon!</li>
<li>While millions of people were starving, the king lived in luxury.</li>
<li>Meanwhile, on a small farm in Kansas, a boy was growing up.</li>
<li>A light snow was falling....</li>
<li>and the little girl with the tattered shawl had not sold a violet all day.</li>
<li>At that very moment...</li>
<li>a young intern at City Hospital was making an important discovery.</li>
<li>The mysterious patient in Room 213 had finally awakened</li>
<li>She moaned softly</li>
<li>Could it be that she was the sister of the boy in Kansas...</li>
<li>who loved the girl with the tattered shawl</li>
<li>who was the daughter of the maid who had escaped from the pirates?</li>
<li>The intern frowned.</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Purple</CloseTexture>
  </ThingDef>
 
    <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>BookOfAncientChineseWisdoms</defName>
<label>Ancient Wisdom</label>
<Description>A book full of ancient chinese wisdom quotes.
</Description>
<graphicData>
<texPath>Clutter/Books/BookBlue</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>A person who says 'it cannot be done' </li>
<li>should not interrupt the man doing it.</li>
<li>Be not afraid of growing slowly,</li>
<li>be afraid only of standing still.</li>
<li>Seeing it once is better than being told 100 times.</li>
<li>He who asks is a fool for five minutes,</li>
<li>but he who does not ask remains a fool forever.</li>
<li>A journey of a thousand miles</li>
<li>must begin with a single step.</li>
<li>The man who carried away pebbles,</li>
<li>was the man who moved the mountain.</li>
<li>A wise man makes his own decisions,</li>
<li>an ignorant man follows public oppinion.</li>
<li>If you are patient in one moment of anger,</li>
<li>you escape a hundred days of sorrow.</li>
<li>Life is really simple, but we insist</li>
<li>on making it complicated.</li>
<li>What you do not wish upon yourself,</li>
<li>extend not to others.</li>
<li>Tell me and I will forget,</li>
<li>show me and I may remember,</li>
<li>involve me and I'll understand.</li>
<li>Failure is not falling down,</li>
<li>but refusing to get up.</li>
<li>If you love something, set it free.</li>
<li>If it comes back to you, it is yours.</li>
<li>If it doesn't, it never was.</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Blue</CloseTexture>
  </ThingDef>

  <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>DiaryOfTheFirstMAI</defName>
<label>Unknown Diary</label>
<Description>This book is the work diary of an unknown author.
</Description>
<graphicData>
<texPath>Clutter/Books/BookBlue</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>Day 1: Finally I know!</li>
<li>Finally I understand what I need to do!</li>
<li>I'll start on it right this minute!</li>
<li>Day 48: This works better than I thought.</li>
<li>I have finished a good amount of work.</li>
<li>Day 94: There was a massive roadblock.</li>
<li>Someone (something?) stole all my plasteel.</li>
<li>I have to use simple steel for the chasis,</li>
<li>but it will have to be enough. It just has to.</li>
<li>Day 143: I am so close. The chassis is finished.</li>
<li>Now I need to work on the AI. It needs some reprogramming.</li>
<li>This looks really good, I'm just so happy.</li>
<li>Day 181: Today is the day, I just know it!</li>
<li>Day 187: Something went wrong.</li>
<li>I don't know what, but something went really wrong.</li>
<li>There shouldn't be such an aggression.</li>
<li>What did I do wrong? This is a nightmare.</li>
<li>Day 201: She is free! God help us, she is free!!</li>
<li>Day 205: Everyone is dead. There are no survivors anymore.</li>
<li>I am the last one alife and it is only a question of time</li>
<li>until she'll find me too. I created her</li>
<li>and today is the day I'll die.</li>
<li>To whoever receives this message:</li>
<li>Stay as far away from Old-Riverton as you can.</li>
<li>She'll be waiting, she'll **Aaaarrgh**</li>
<li>(Transmission terminated)</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Blue</CloseTexture>
  </ThingDef>
 
    <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>ThreeLittleBoars</defName>
<label>Three little boar`s</label>
<Description>This book is contains a short story of DDawgSierra
</Description>
<graphicData>
<texPath>Clutter/Books/BookGreen</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>Once upon a time,</li>
<li>there lived three little boar,</li>
<li>and a hungry centipede.</li>
<li>The centipede wanted to eat the boar</li>
<li>But the boar built a home made of granite blocks,</li>
<li>and the centipede's inferno cannon was no match at all.</li>
<li>And the centipede fled, huffing and puffing at his failed efforts...</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Green</CloseTexture>
  </ThingDef>
 
      <ThingDef ParentName="BookBase" Class="Clutter_Furniture.ClutterThingDefsFurniture">
<defName>ElerdStory</defName>
<label>MAD BOOMRAT</label>
<Description>Based on real events, writen by Elerd
</Description>
<graphicData>
<texPath>Clutter/Books/BookGreen</texPath>
<graphicClass>Graphic_Multi</graphicClass>
</graphicData>
    <resourceReadoutPriority>Middle</resourceReadoutPriority>
    <thingClass>Clutter_Furniture.ReadableBooks</thingClass>
    <stackLimit>1</stackLimit>
    <useHitPoints>false</useHitPoints>
    <thingCategories>
      <li>Items</li>
    </thingCategories>
<IsABook>true</IsABook>
<BookText>
<li>It was the third day of a long and painfull siege,</li>
<li>James and Rookie were dead and burried, and I had my right ear blown off.</li>
<li>David, our sniper, decided to take it upon himself to free us from this nightmare.</li>
<li>As he stealthly sneaked about the grass, looking for the raiders' base,</li>
<li>he suddenly wispered urgently at the coms.</li>
<li>With my one ear I could make out that one distress signal we never want to hear;</li>
<li>"MAD BOOMRAT!"</li>
<li>A loud bang sounded far off.</li>
<li>with my pistol in hand, and the coms eerily silent, I opened the colony door.</li>
<li>The entire plain was on fire.</li>
<li>Looking far away, I saw the fire slowly crawling towards the raiders' base.</li>
<li>As the fires reached their cannons, 2 horrible explosions burned at my eyes</li>
<li>I was never as happy to feel the rain pour, as that night.</li>
<li>I never did find David's body, </li>
<li>but as soon as I could, I built a statue in his honour.</li>
</BookText>
<CloseTexture>Clutter/Books/CBook_Green</CloseTexture>
  </ThingDef>

</GameData>


how to arrange inside of the form

<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
????????????
</LanguageData>

deeperman

It is clear that the name of the books and their description is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<LanguageData>
     <ParallelBook.label>Black jelly beans </ParallelBook.label>
   <ParallelBook.description>Book writed by author know only under his pen name as Parallel_Parkour
   </ParallelBook.description>
</LanguageData>

We do not understand how to implement the translation of the text books themselves
<li> ?

Haplo

Try it with:
<ParallelBook.BookText.0>
for the first li, 1 for the second li and so on.

duduluu

Quote from: Haplo on January 28, 2017, 03:44:22 PM
Try it with:
<ParallelBook.BookText.0>
for the first li, 1 for the second li and so on.

The first is 0, not 1.

The <li> means list item, a item of the C# class List<T>, just like the array.
RimTrans translation tool for RimWorld
RimWorld-English original text for translating RimWorld
RimWorld-zh.com my translation team website

Haplo