feat(text): on-screen messages come from translation files
Every message the mod puts in the middle or corner of the screen now reads its text through ModText.Get, and messages.json holds 191 texts in English and Italian. Values computed in code become $1, $2 in the text, so a translator can put them wherever the sentence needs them. Branching messages get one key per branch. A few messages travel through a field before they are shown: thralls' refusals and the building limits now hold a token or key there. Boss and form names inside messages use tokens too, the bosses the game's own, so "The Elder" arrives translated. ModText.Get now localizes each argument before inserting it. A token argument left for a later pass ran into the text after it: "$1's power" became the unknown token "enemy_eikthyr's". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b3641e5bf4
commit
b0d18b0654
61 changed files with 606 additions and 200 deletions
|
|
@ -94,7 +94,7 @@ namespace RacesOfValheim
|
|||
"Coal");
|
||||
|
||||
PieceDensityLimit.Register(SmithTableName, TableSpacing, 1,
|
||||
"Another smith's table stands within forty paces. One smith to a yard.");
|
||||
"rov_msg_build_limit_smithtable");
|
||||
|
||||
// Two races, and it is the wider of the two locks: the Skeleton raises the dead to work
|
||||
// for it, and Skadi's hold is a forge under ice.
|
||||
|
|
@ -105,7 +105,7 @@ namespace RacesOfValheim
|
|||
if (player != null)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center,
|
||||
"The bones do not answer to your blood.");
|
||||
ModText.Get("rov_msg_butler_bones_do_not_answer_blood"));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
|
@ -118,7 +118,7 @@ namespace RacesOfValheim
|
|||
"CookedMeat");
|
||||
|
||||
PieceDensityLimit.Register(CookTableName, TableSpacing, 1,
|
||||
"Another cook's table stands within forty paces. One cook to a yard.");
|
||||
"rov_msg_build_limit_cooktable");
|
||||
|
||||
// Skadi alone. A hearth kept by something dead is hers, not the Skeleton's.
|
||||
PieceDensityLimit.RegisterGate(CookTableName, (player, position) =>
|
||||
|
|
@ -128,7 +128,7 @@ namespace RacesOfValheim
|
|||
if (player != null)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center,
|
||||
"Only Skadi's hearth is kept by the dead.");
|
||||
ModText.Get("rov_msg_butler_only_skadi_s_hearth_kept"));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace RacesOfValheim
|
|||
|
||||
if (Servant() != null)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center, "It is already at work.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_butler_already_at_work"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ namespace RacesOfValheim
|
|||
if (wait > 0f)
|
||||
{
|
||||
player.Message(MessageHud.MessageType.Center,
|
||||
$"The bones are not ready. {Mathf.CeilToInt(wait)}s.");
|
||||
ModText.Get("rov_msg_butler_bones_are_not_ready_s", Mathf.CeilToInt(wait)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ namespace RacesOfValheim
|
|||
if (prefab == null)
|
||||
{
|
||||
Jotunn.Logger.LogWarning($"[Butler] No '{m_servantPrefab}' in ZNetScene; nothing was raised.");
|
||||
player.Message(MessageHud.MessageType.Center, "Nothing answers.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_butler_nothing_answers"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ namespace RacesOfValheim
|
|||
|
||||
if (ZNet.instance != null) m_nview.GetZDO().Set(KeyLastRaise, ZNet.instance.GetTime().Ticks);
|
||||
|
||||
player.Message(MessageHud.MessageType.Center, "The servant rises.");
|
||||
player.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_butler_servant_rises"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue