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

@ -35,12 +35,12 @@ namespace RacesOfValheim
{
// ─── Names ───────────────────────────────────────────────────────────
public const string PieceName = "FenrirPackTrough";
public const string PieceDisplayName = "Pack Trough";
public const string PieceDisplayName = "$rov_piece_fenrir_packtrough_name";
public const string UlvsblodName = "Ulvsblod";
public const string UlvsblodDisplayName = "Ulvsblod";
public const string UlvsblodDisplayName = "$rov_item_fenrir_ulvsblod_name";
public const string GreaterUlvsblodName = "GreaterUlvsblod";
public const string GreaterUlvsblodDisplayName = "Greater Ulvsblod";
public const string GreaterUlvsblodDisplayName = "$rov_item_fenrir_greaterulvsblod_name";
public const int UlvsblodPrice = 500;
public const int GreaterUlvsblodPrice = 1500;
@ -49,9 +49,9 @@ namespace RacesOfValheim
public const string UlvName = "FenrirPack_Ulv";
public const string FenrirName = "FenrirPack_Fenrir";
public const string WolfDisplayName = "Pack Wolf";
public const string UlvDisplayName = "Ulv";
public const string FenrirDisplayName = "Fenrir";
public const string WolfDisplayName = "$rov_creature_fenrir_packwolf_name";
public const string UlvDisplayName = "$rov_creature_fenrir_packulv_name";
public const string FenrirDisplayName = "$rov_creature_fenrir_packfenrir_name";
public const string KindWolf = "FenrirPackWolf";
public const string KindUlv = "FenrirPackUlv";
@ -140,18 +140,16 @@ namespace RacesOfValheim
public static void Register()
{
RegisterUlvsblod(UlvsblodName, UlvsblodDisplayName, UlvsblodTint,
"Wolf blood, kept warm by something that should not be able to keep anything warm. " +
"The Fenring sell it and do not explain it.");
"$rov_item_fenrir_ulvsblod_desc");
RegisterUlvsblod(GreaterUlvsblodName, GreaterUlvsblodDisplayName, GreaterUlvsblodTint,
"Older blood, and further down the line. A trough given one of these starts raising " +
"something worse than ulv.");
"$rov_item_fenrir_greaterulvsblod_desc");
RegisterPackAnimal(WolfName, "Wolf", WolfDisplayName, KindWolf,
"It answers to the blood of the wolf, not to you.", 1f);
"$rov_creature_fenrir_pack_desc", 1f);
RegisterPackAnimal(UlvName, "Ulv", UlvDisplayName, KindUlv,
"It answers to the blood of the wolf, not to you.", 1f);
"$rov_creature_fenrir_pack_desc", 1f);
RegisterPackAnimal(FenrirName, "Fenring", FenrirDisplayName, KindFenrir,
"Only the blood of the wolf commands this one.", FenrirScale);
"$rov_creature_fenrir_packfenrir_desc", FenrirScale);
RegisterPiece();
@ -338,7 +336,7 @@ namespace RacesOfValheim
PieceManager.Instance.AddPiece(new CustomPiece(prefab, fixReference: false, new PieceConfig
{
Name = PieceDisplayName,
Description = "Fill it with meat and the pack comes. One at a time, and it remembers its dead.",
Description = "$rov_piece_fenrir_packtrough_desc",
PieceTable = PieceTables.Hammer,
Category = PieceCategories.Crafting,
Icon = BorrowIcon("TrophyFenring"),