feat(text): item, piece and creature names come from translation files

The mod's own items, build pieces and summoned creatures now carry
$rov_item_, $rov_piece_ and $rov_creature_ tokens for their names and
descriptions, and items.json holds the texts in English and Italian.
Valheim localizes these fields wherever it shows them: tooltips, hover
texts, messages, the build menu.

Where a name doubles as an identifier, both sides use the same constant,
so the comparisons still hold. The Aswid foods keep their prefix as a
constant for the refinery's check and now name the creature with its
vanilla token, so "Boar" translates too. The Furling crops get one whole
description per crop instead of an English sentence with the metal dropped
in. The Race Menu Ward's panel title is a mod UI Text, so it reads the
translation directly.

Saves are unaffected: items and eaten foods are stored by prefab name.
The Sverm hive's goods stay for the merchant step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kanym 2026-09-26 19:58:53 +02:00
commit b177c89c71
34 changed files with 405 additions and 142 deletions

View file

@ -25,17 +25,17 @@ namespace RacesOfValheim
{
// ─── Names ───────────────────────────────────────────────────────────
public const string PieceName = "DraughBodyPile";
public const string PieceDisplayName = "Cursed Body Pile";
public const string PieceDisplayName = "$rov_piece_draugh_bodypile_name";
public const string BoneName = "CursedBone";
public const string BoneDisplayName = "Cursed Bone";
public const string BoneDisplayName = "$rov_item_draugh_cursedbone_name";
public const string GreaterBoneName = "GreaterCursedBone";
public const string GreaterBoneDisplayName = "Greater Cursed Bone";
public const string GreaterBoneDisplayName = "$rov_item_draugh_greatercursedbone_name";
public const string ThrallName = "DraughThrall_Draugr";
public const string ThrallEliteName = "DraughThrall_DraugrElite";
public const string ThrallDisplayName = "Draugr Thrall";
public const string ThrallEliteDisplayName = "Draugr Elite Thrall";
public const string ThrallDisplayName = "$rov_creature_draugh_thrall_name";
public const string ThrallEliteDisplayName = "$rov_creature_draugh_thrallelite_name";
// RaisedThrall groups by kind for follower caps and for the roster, so these are the strings
// that decide "is this one an officer" - no longer a display-name comparison.
@ -118,9 +118,9 @@ namespace RacesOfValheim
public static void Register()
{
RegisterBone(BoneName, BoneDisplayName, BoneTint,
"A bone that will not stay quiet. The dead sell them; the dead do not say why.");
"$rov_item_draugh_cursedbone_desc");
RegisterBone(GreaterBoneName, GreaterBoneDisplayName, GreaterBoneTint,
"The same bone, older, and louder. A pile fed one of these starts keeping officers.");
"$rov_item_draugh_greatercursedbone_desc");
RegisterThrall(ThrallName, "Draugr", ThrallDisplayName, KindNormal, MaxFollowers);
RegisterThrall(ThrallEliteName, "Draugr_Elite", ThrallEliteDisplayName, KindElite, MaxEliteFollowers);
@ -263,7 +263,7 @@ namespace RacesOfValheim
PieceManager.Instance.AddPiece(new CustomPiece(prefab, fixReference: false, new PieceConfig
{
Name = PieceDisplayName,
Description = "Feed it and it answers. The dead here are yours, if you are dead enough to ask.",
Description = "$rov_piece_draugh_bodypile_desc",
PieceTable = PieceTables.Hammer,
Category = PieceCategories.Crafting,
Icon = BorrowIcon(TrophyDraugr),