Ludeon Forums

RimWorld => Mods => Translations => Topic started by: lmgginspace on April 25, 2021, 10:05:03 AM

Title: How to translate damage done by body parts
Post by: lmgginspace on April 25, 2021, 10:05:03 AM
Hi, I'm trying to translate these string that say the body part that was used to cause the injury to spanish, I'm attaching an image of an example.
It needs to say "zarpa de yorkshire terrier", instead of "yorkshire terrier zarpa".
Is there any way to do it? Thanks
Title: Re: How to translate damage done by body parts
Post by: nomius on July 18, 2021, 07:42:04 AM
Hi,

I have the same issue with the Romanian translation, and at least so do the French, Italian and Japanese ones.
It seems like it's not solvable as it's something hardcoded into the game. I've looked through the decompiled code and I suspect this is the problematic function (from Hediff_Injury.cs):
public override string LabelInBrackets
{
get
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append(base.LabelInBrackets);
if (sourceHediffDef != null)
{
if (stringBuilder.Length != 0)
{
stringBuilder.Append(", ");
}
stringBuilder.Append(sourceHediffDef.label);
}
else if (source != null)
{
if (stringBuilder.Length != 0)
{
stringBuilder.Append(", ");
}
stringBuilder.Append(source.label);
if (sourceBodyPartGroup != null)
{
stringBuilder.Append(" ");
stringBuilder.Append(sourceBodyPartGroup.LabelShort);
}
}
HediffComp_GetsPermanent hediffComp_GetsPermanent = this.TryGetComp<HediffComp_GetsPermanent>();
if (hediffComp_GetsPermanent != null && hediffComp_GetsPermanent.IsPermanent && hediffComp_GetsPermanent.PainCategory != 0)
{
if (stringBuilder.Length != 0)
{
stringBuilder.Append(", ");
}
stringBuilder.Append(("PainCategory_" + hediffComp_GetsPermanent.PainCategory).Translate());
}
return stringBuilder.ToString();
}
}


The second if statement contains the hardcoded part. Code is from version 1.2.3005

Edit: I've created a bug report regarding this