RimWorld 1.0 Translation Improvements

Started by ison, June 22, 2018, 08:52:20 AM

Previous topic - Next topic

ison

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:


  • General load errors: XML parsing errors, incorrectly named files, duplicate keyed translations, and other unexpected errors.
  • Def-injected translations load errors: all errors caused by def-injections like using non-existent defs, using a field which doesn't exist, duplicate def-injections, def-injections parsing errors, and more.
  • Backstories load errors: all errors caused by invalid backstories data.
  • Missing keyed translations
  • Missing def-injections
  • Missing backstory translations
  • Unnecessary def-injections
  • Def-injected translations using old, renamed defs: this section reports all def-injections which use obsolete def names
  • Argument count mismatches: warning when the number of arguments in English is different (e.g. English text uses {0}, {1} but the translation only has {0}). In some cases it's not an error - translations are free to omit some of the arguments if they don't need it.
  • Unnecessary keyed translations
  • Keyed translations matching English: these are not necessarily errors, sometimes translated text can be the same in English.
  • Backstories matching english: most likely an error.
  • Def-injections syntax suggestions: suggestions to use named list indexes (see feature number 3).

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:

  • Translators don't know what exactly they're translating. Translating comps.0 or comps.1 doesn't say much about the component and it's unintuitive.
  • All translations break when a new element is added, especially at the beginning of the list. And what's worse is that there's no way to tell if the translation is still correct or if it's now invalid because it refers to a completely different element.

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
New keyed translations format
New translation cleaner tool
More minor 1.0 changes + info about LanguageWorkers
Request: Help check the language workers for accuracy

[attachment deleted due to age]

pluhi

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.

ison

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.

capiqua

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.

Haplo

Take a look into the file: RulePackDef -> RulePacks_Namers_WorldFeatures.xml

capiqua

#5
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.

pluhi

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.