Ludeon Forums

RimWorld => Mods => Translations => Topic started by: ison on June 22, 2018, 08:52:20 AM

Title: RimWorld 1.0 Translation Improvements
Post by: ison on June 22, 2018, 08:52:20 AM
RimWorld 1.0 Translation Improvements

In this thread we'd like to explain three new important features which have been added to the translation system in RimWorld 1.0 and which will hopefully make translating RimWorld easier.

1. Translation report

It's now possible to generate a translation report for the currently selected, non-English language. All you need to do is press the "Generate translation report" button in the main menu.

Translation report generator analyzes the translation files for the currently selected language and reports all missing translations, unnecessary translations, XML parsing errors, def-injection errors, and more. In previous versions some of those errors used to be shown in the message log, but due to poor formatting it was much more difficult to read and then fix the problem.

Translation report consists of 13 sections:


2. Full-list translations

We realize that automatically generated text is one of the most difficult things to translate. In our case such text is generated by RulePackDefs. Before 1.0 translating them was cumbersome because all lists had to have exactly the same number of elements as in English (and some RulePackDefs have 30 or even more items!). The problem with automatically generated text is that different languages have different number of synonyms and, in general, different ways to express the same meaning. This means that translations should be able to add or remove items from RulePackDefs. Different languages can have completely different RulePackDefs.

From now on it's possible to use a so called full-list translation. This means that instead of this:
<TalelessImages.rulePack.rulesStrings.0>image->einem [outlander] der von [quantity_adjphrase] [outlander]n umstellt ist</TalelessImages.rulePack.rulesStrings.0>
<TalelessImages.rulePack.rulesStrings.1>image->einem [outlander] der mit mehreren [outlander]n eine Partie [game] spielt</TalelessImages.rulePack.rulesStrings.1>
<TalelessImages.rulePack.rulesStrings.2>image->einem [outlander] mit [weapon] [subject_desc]</TalelessImages.rulePack.rulesStrings.2>
<TalelessImages.rulePack.rulesStrings.3>image->einem einsamen [outlander]</TalelessImages.rulePack.rulesStrings.3>


It's now possible to do this:
<TalelessImages.rulePack.rulesStrings>
  <li>image->einem [outlander] der von [quantity_adjphrase] [outlander]n umstellt ist</li>
  <li>image->einem [outlander] der mit mehreren [outlander]n eine Partie [game] spielt</li>
  <li>image->einem [outlander] mit [weapon] [subject_desc]</li>
  <li>image->einem einsamen [outlander]</li>
</TalelessImages.rulePack.rulesStrings>


with as many <li> nodes as needed.

This conversion was done automatically. We've run a script to update all translations and make them use this new syntax, so you don't have to worry about it.

We've also added a new variable to rulePack called rulesFiles. You can now add more file rules like this:
<TalelessImages.rulePack.rulesFiles>
  <li>mynewkeyword->Words/Nouns/MyNewKeyword</li>
  <li>somethingelse->Words/Nouns/Something</li>
</TalelessImages.rulePack.rulesFiles>


Please note that it will override all file rules defined in the English language!

3. Named indexes for lists

It's now possible to refer to the elements of a list by using their unique name instead of their index in def-injections.

A few examples:
instead of:
<NaturalMood.degreeDatas.2.label>translation</NaturalMood.degreeDatas.2.label>
it's now possible to do this:
<NaturalMood.degreeDatas.pessimist.label>translation</NaturalMood.degreeDatas.pessimist.label>

instead of:
<NeedFood.stages.5.description>translation</NeedFood.stages.5.description>
it's now possible to do this:
<NeedFood.stages.advanced_starvation.description>translation</NeedFood.stages.advanced_starvation.description>

instead of:
<Turret_MiniTurret.comps.5.fuelLabel>translation</Turret_MiniTurret.comps.5.fuelLabel>
it's now possible to do this:
<Turret_MiniTurret.comps.CompRefuelable.fuelLabel>translation</Turret_MiniTurret.comps.CompRefuelable.fuelLabel>

This solves 2 problems:

The second problem is the reason why we didn't convert all files automatically. We realize that updating all list elements will be a difficult task, so it's completely optional - using indexes is still valid. It's a good opportunity to recheck all list translations and make sure they're correct while making translations use this new syntax. The "Def-injections syntax suggestions" section in the translation report may be particularly helpful here.

4. Translation cleaner tool

We've added a very useful tool which cleanes up all translation files, adds missing translations, and more.
More info here: https://ludeon.com/forums/index.php?topic=42587.0


And that's it. We hope this will make translating RimWorld easier.

How to contribute (https://ludeon.com/forums/index.php?topic=2933.0)
New keyed translations format (https://ludeon.com/forums/index.php?topic=43979.0)
New translation cleaner tool (https://ludeon.com/forums/index.php?topic=42587.0)
More minor 1.0 changes + info about LanguageWorkers (https://ludeon.com/forums/index.php?topic=42601.0)
Request: Help check the language workers for accuracy (https://ludeon.com/forums/index.php?topic=44000.0)

[attachment deleted due to age]
Title: Re: RimWorld 1.0 Translation Improvements
Post by: pluhi on July 12, 2018, 12:57:05 PM
Hi!

Thanks a lot! Helps immensely.

It seems build 1962 killed the named indexes.
========== Def-injected translations load errors (468) ==========
Couldn't inject ThrumboHorn.tools.point.label into Verse.ThingDef (Items_Exotic.xml): None of the list elements have a handle named point.
========== Def-injected translations missing (237) ==========
ThingDef: ThrumboHorn.tools.0.label 'point'

Also the Def-injected load errors part double reports everything, no big deal.

Another issue I found is an apostrophe here:
GotSomeLovin.stages.got_some_lovin'.label
Seems the XML loader does not like it. I tried to escape it but failed. Using the number format here at the moment.
Title: Re: RimWorld 1.0 Translation Improvements
Post by: ison on July 13, 2018, 08:24:14 AM
You're right, named indexes for Tools don't work in 1.0.1962. They were removed accidentally. Fixed, thanks.

The apostrophe bug is also fixed.
Title: Re: RimWorld 1.0 Translation Improvements
Post by: capiqua on July 16, 2018, 12:10:33 PM
How can appear the geographical names on the globe?. I only get mountain x, ocean x, ect.
But I can not get it to appear in my language. Is this through rulepack?

Thanks.
Title: Re: RimWorld 1.0 Translation Improvements
Post by: Haplo on July 16, 2018, 04:54:59 PM
Take a look into the file: RulePackDef -> RulePacks_Namers_WorldFeatures.xml
Title: Re: RimWorld 1.0 Translation Improvements
Post by: capiqua on July 16, 2018, 05:32:50 PM
I have been looking at some translations and the same thing happens to them. the name geographical names appears in English.

edit:
[terrain_word]: is the one in Rulepack and can be edited.

[narrative_name]: is the one that appears in English.
Title: Re: RimWorld 1.0 Translation Improvements
Post by: pluhi on July 17, 2018, 03:09:43 AM
You have to translate the strings too. Some of these words ([WordTribal], [PlaceOutlander], etc) are put together using syllables, these are also defined in strings folder.