Ludeon Forums

Ludeon Forums

  • March 29, 2020, 02:41:32 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Note on translating for Royalty  (Read 426 times)

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12429
    • View Profile
    • Tynan's Blog
Note on translating for Royalty
« on: February 25, 2020, 09:15:24 PM »

Hi all, just a quick note on translating for Royalty.

You can do it in the same repo as the base language, just by making a folder for Core and one for Royalty.

The German translation has an example. See here: https://github.com/Ludeon/RimWorld-de

As always, thank you deeply to all translators.
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #1 on: March 25, 2020, 06:54:10 AM »

Hi Tynan,

Can you please give more information about the gender constant system. The release note is not enough informative :
In which files are they active ?

So far I identified some QuestScript (not in : PrisonerWillingToJoin and DownedRefugee, not for manhunter animal) and RulePacks.

A bit desappointed it is not in TaleDef (I already had my gender commits waiting for months  :( ), I would like to know whether it is active in ThoughtDef and TraitDef.

Also, in some QuestScript we have {SUBJECT_definite}, can we use {SUBJECT_gender ? : :} there?
Logged

ison

  • Developer
  • Planetologist
  • *****
  • Posts: 2217
    • View Profile
Re: Note on translating for Royalty
« Reply #2 on: March 25, 2020, 10:29:58 AM »

Can you please give more information about the gender constant system. The release note is not enough informative :
In which files are they active ?
They should be available everywhere. For texts which use {} the syntax is as follows: {PAWN_gender ? male : female}. For texts which use [] you need to add new conditional rules like so:
Code: [Select]
<li>questDescription->Some text. [mysymbol]</li>
<li>mysymbol(asker_gender==Male)->the asker is male</li>
<li>mysymbol(asker_gender==Female)->the asker is female</li>
(where "asker" is the pawn symbol, it could be PAWN in some cases)
If it doesn't work, could you please copy-paste the generation error here?

Also, in some QuestScript we have {SUBJECT_definite}, can we use {SUBJECT_gender ? : :} there?
Yes, you can.
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #3 on: March 25, 2020, 01:48:28 PM »

Hi Ison,

Thank you very much for the information. I used as much as I could the conditional rules in the RulePacks. I shall re-test again for PrisonerWillingToJoin and DownedRefugee (may be I didn't do it right last time) and shall provide more info about how it worked.
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #4 on: March 25, 2020, 05:45:32 PM »

Here is the excerpt from Core/DefInjected/QuestScriptDef/Script_DownedRefugee.xml where I attempted to use refugee_gender in conditional rule (see last rules), resulting in questDescription → UNRESOLVABLE. Similar situation PrisonerWillingToJoin with prisoner_gender.

Code: [Select]
  <OpportunitySite_DownedRefugee.questDescriptionRules.rulesStrings>
    <li>questDescription(askerIsNull==true)->[refugee_nameDef] vous contacte par radio et vous supplie de l'aider. [refugee_pronoun] est [refugee_wounded] et incapable de bouger.\n\n[refugee_nameDef] est [refugee_titleIndef] [refugee_has_age] de [refugee_age] ans. [refugee_pronoun] promet de vous rejoindre si vous lui portez secours.\n\n[refugee_nameDef] dit que [allSitePartsDescriptionsExceptFirst][pawnInvolvedInQuestInfo]</li>
    <li>questDescription(asker_factionLeader==True)->[asker_nameDef], [asker_faction_leaderTitle] de [asker_faction_name], dit que son [asker_friend] a été [refugee_wounded] pendant un voyage. La victime est [refugee_nameIndef], [refugee_titleIndef] [refugee_has_age] de [refugee_age] ans.\n\n[asker_nameDef] n'a personne de disponible pour sauver [refugee_nameDef], mais dit que si vous arrivez à la position de [refugee_nameDef] et à lui porter secours, [refugee_pronoun] rejoindra votre colonie.\n\n[asker_nameDef] dit aussi que [allSitePartsDescriptionsExceptFirst][pawnInvolvedInQuestInfo]</li>
    <!-- NOTE: What is refugee_pawnInvolvedInQuestInfo for? -->
    <li>pawnInvolvedInQuestInfo(priority=1)->[refugee_pawnInvolvedInQuestInfo]</li>
    <li>pawnInvolvedInQuestInfo-></li>
    <!-- BUG: refugee_gender not defined -->
    <li>asker_friend(refugee_gender==Male)->ami</li>
    <li>asker_friend(refugee_gender==Female)->amie</li>
    <li>refugee_wounded(refugee_gender==Male)->blessé</li>
    <li>refugee_wounded(refugee_gender==Female)->blessée</li>
    <li>refugee_has_age(refugee_gender==Male)->âgé</li>
    <li>refugee_has_age(refugee_gender==Female)->âgée</li>
    <li>refugee_rescued(refugee_gender==Male)->sauvé</li>
    <li>refugee_rescued(refugee_gender==Female)->sauvée</li>
  </OpportunitySite_DownedRefugee.questDescriptionRules.rulesStrings>
Logged

Tynan

  • Developer
  • Administrator
  • Transcendent
  • *****
  • Posts: 12429
    • View Profile
    • Tynan's Blog
Re: Note on translating for Royalty
« Reply #5 on: March 25, 2020, 09:52:41 PM »

Ison can you comment on the above?

But b606, the log you posted has no mention of gender at all.
Logged
Tynan Sylvester - @TynanSylvester - Tynan's Blog

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #6 on: March 26, 2020, 02:36:23 AM »

The gender conditional rules are UNRESOLVABLE

Code: [Select]
refugee_wounded → UNRESOLVABLE
refugee_has_age → UNRESOLVABLE

The french (and latin) language is so heavily gendered that x_gender is needed everywhere, for each pawn and animal in the texts.
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #7 on: March 26, 2020, 05:08:00 AM »

Tested CaravanFled in Core/../Tales_Caravan.xml with tale_noun reduced to the only one needing gender.

The conditional rule tale_noun(PAWN_gender==Male)->... is UNRESOLVABLE

Since {PAWN_gender ? i : ie : i(e)} is not interpreted here, using it would just generate texts such as
Code: [Select]
Beau-fils de Orange
Cette sculpture ressemble à Carbra Orange repli{PAWN_gender ? É : Ée : É(e)}
derrière un arbre, se cachant d'un imposant bandit. Les poursuivants de
Orange sont auréolés de fumée bleue. L'œuvre a une touche de «graffiti»
et a une structure concentrée. Cette gravure raconte l'histoire de Orange
poursuiv{PAWN_gender ? I : Ie : I(e)} par des ennemis, le 1er septobre
5476.

Excerpt of Tales_Caravan.xml
Code: [Select]
  <CaravanFled.rulePack.rulesStrings>
    <li>tale_noun(PAWN_gender==Male)->[PAWN_nameDef] poursuivi par des ennemis</li>
    <li>tale_noun(PAWN_gender==Female)->[PAWN_nameDef] poursuivie par des ennemis</li>
    <li>image->[PAWN_nameFull] courant frénétiquement [circumstance_group]</li>
    <li>image->[PAWN_nameFull] courant très vite [circumstance_group]</li>
    <li>image(PAWN_gender==Male)->[PAWN_nameFull] replié derrière [TerrainFeatureAny_indef], se cachant [circumstance_group]</li>
    <li>image(PAWN_gender==Female)->[PAWN_nameFull] repliée derrière [TerrainFeatureAny_indef], se cachant [circumstance_group]</li>
    <li>image->[PAWN_nameFull] tentant de battre en retraite [circumstance_group]</li>
    <li>image->[PAWN_nameFull] s'éloignant tranquillement [circumstance_group]</li>
    <li>circumstance_phrase->tandis que [Quantity_adjphrase] [Enemy_AnyPlural] se lancent à sa poursuite</li>
    <li>circumstance_phrase->tandis que [Quantity_adjphrase] [Enemy_AnyPlural] son à sa recherche</li>
    <li>circumstance_phrase->de [Quantity_adjphrase] [Enemy_AnyPlural]</li>
    <li>circumstance_phrase->de [Quantity_adjphrase] [Animal_Plural] ennemis</li>
    <li>circumstance_phrase->de [Quantity_adjphrase] [Animal_FemPlural] ennemies</li>
    <li>circumstance_phrase->d'un [AdjectiveLarge] [Enemy]</li>
    <li>circumstance_phrase->d'une [AdjectiveLarge_Feminine] [Enemy_Feminine]</li>
    <li>desc_sentence->les poursuivants de [PAWN_nameDef] brandissent des [Weapon_AnyPlural].</li>
    <li>desc_sentence->les poursuivants de [PAWN_nameDef] sont auréolés de fumée [Color_Feminine].</li>
    <li>desc_sentence->les poursuivants de [PAWN_nameDef] affichent des visages [AdjectiveAngsty_Plural].</li>
    <li>desc_sentence->les poursuivants de [PAWN_nameDef] brandissent des [Weapon_AnyPlural].</li>
    <li>desc_sentence->[PAWN_nameDef] est en sueur.</li>
    <li>desc_sentence->[PAWN_nameDef] est hors d'haleine.</li>
  </CaravanFled.rulePack.rulesStrings>

« Last Edit: March 26, 2020, 05:09:36 AM by b606 »
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #8 on: March 26, 2020, 05:39:28 AM »

For ThreatReward_Manhunters_ItemPod in Royalty/DefInjected/QuestScriptDef/Scripts_ItemPodThreat.xml, we need the tags below especially for manhunterArrivalLetterEnd rules (Same case anywhere involving animals).

Ex: Ce/tte [animalKind_label] a été relâché(e) par [asker_nameFull] (This [animalKind_label] was released by [asker_nameFull]).

Code: [Select]
[animalKind_gender]
[animalKind_definite]
[animalKind_indefinite]
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #9 on: March 26, 2020, 06:02:01 AM »

In Core/DefInjected/RulePackDef/* (see for example Combat_MeleeIncludes.rulePack.rulesStrings), we need [recipient_part{0..3}_definite] and [TOOL_definite], avoiding "le/la" everywhere in the combat log.

These words come mainly from customLabel in BodyDef that we can classify easily in WordInfo/Gender/{Male,Female}.txt.

It would also be really nice if X_possessive uses <her and <his from grammar.xml not <its, when a gender!=Neuter is defined for the object. Using neuter <its will not make sense in that case. Ex. of use is [TOOL_possessive] and [WEAPON_possessive] in these RulePacks_Combat*. This would also clean up the combat log.
Logged

Ragnar-F

  • Muffalo
  • *
  • Posts: 13
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #10 on: March 26, 2020, 06:34:46 AM »

Indeed, WordInfo/Gender/* seems to be completely ignored for RulePackDef, TaleDef and possibly other similar concepts. Conditions like WEAPON_gender==Female or WEAPON_projectile_gender==Male do not work. This alone would already improve the quality of the sentences significantly.

The other suggestions of b606 are also a nice-to-have.
Logged

ison

  • Developer
  • Planetologist
  • *****
  • Posts: 2217
    • View Profile
Re: Note on translating for Royalty
« Reply #11 on: March 27, 2020, 12:47:06 PM »

Fixed:
Downed refugee and prisoner quests indeed handled gender constants incorrectly. This should be fixed once the next hotfix is released.
Added TOOL_definite, TOOL_indefinite, and TOOL_gender.
Added recipient_part_definite, indefinite, gender

Not fixed yet:
Symbols like animalKind still don't have their gender constants added. Unfortunately this would require some API breaking changes for 1.1. We'll have to fix it in the next major version.
Tales don't support gender constants. This would require API breaking changes as well. So some mods could break.
WEAPON and WEAPON_projectile don't support gender constants yet
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #12 on: March 27, 2020, 01:45:48 PM »

Hi Ison,

Thanks for the changes !

I knew there were some technical difficulties when the sublimissimo {x_gender ? :: } could not be generalized.

We will do with what we have now, and waiting for the new API impatiently.
Logged

b606

  • Drifter
  • **
  • Posts: 68
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #13 on: March 28, 2020, 12:28:17 PM »

All modifications have been applied and the french combat log is much cleaner now.

Still, there is a regression from version 1.0 where animal pawns do not use their <XXX.labelFemale>, giving very odd sentences. See screenshots below where "la dinde" (female turkey) is referred to "la dindon", and "la rate" (female) to "la rat", which are just plain wrong. More info here https://github.com/Ludeon/RimWorld-fr/issues/283

With 1.1.2586 rev1246, I still also have the issue https://ludeon.com/forums/index.php?topic=51260.0 where choosing a specific word as seed for world generation will bug the game (absolutely reproducible, use for example "ruisseau" or "jack-pot", other seeds will run fine). The Polish translation also runs into that issue. And I suppose that any translation may runs into that with some unlucky random seed.

The log I submitted there is not informative enough to determine where the problem originates.
Logged

morticinus

  • Muffalo
  • *
  • Posts: 13
  • Refugee
    • View Profile
Re: Note on translating for Royalty
« Reply #14 on: March 28, 2020, 12:38:31 PM »

Hi

I have a problem with translating all "questnames", is forcibly replacing the first capital letters. I have no idea how I can solve it.

Examples:
Code: [Select]
  <!-- EN:
    <li>questName->monument decree</li>
  -->
  <Decree_BuildMonument.questNameRules.rulesStrings>
    <li>questName->Nařízení výstavby monumentu</li>
  </Decree_BuildMonument.questNameRules.rulesStrings>

Code: [Select]
  <!-- EN:
    <li>questName->[defToProduce_label] production decree</li>
  -->
  <Decree_ProduceItem.questNameRules.rulesStrings>
    <li>questName->Nařízení výroby ([defToProduce_label])</li>
  </Decree_ProduceItem.questNameRules.rulesStrings>

Ingame:
« Last Edit: March 28, 2020, 12:48:07 PM by morticinus »
Logged