From 99a1817eb0c59e933a5dc19b5d9db33e9b98eaeb Mon Sep 17 00:00:00 2001 From: kanym Date: Mon, 28 Sep 2026 13:55:14 +0200 Subject: [PATCH] feat(text): hover texts come from translation files What the stations, thralls, the ward and the hive show under the crosshair now reads its text through ModText.Get, and hover.json holds 50 texts in English and Italian. The Aswid thralls and the Race Menu Ward wrote the use key as a literal E; they now use $KEY_Use, which shows the key the player actually bound. For that to work, ModText.Get runs a second localization pass when a $ is left in the result: Valheim resolves tokens once and never looks inside what it inserted, and hover texts go to the HUD without another pass. The Sverm hive stage names stay English for now: the compendium and the hive's goods show them too, and those come with the merchants step. Co-Authored-By: Claude Opus 5.5 --- JotunnModStub/Aswid/AswidThrall.cs | 6 +-- JotunnModStub/Butler/ServantTableBehaviour.cs | 5 +- .../Draugh/DraughSpawnerBehaviour.cs | 9 ++-- .../Dvergar/DvergarBancoBehaviour.cs | 8 +-- .../Dvergar/DvergarBotteBehaviour.cs | 6 +-- .../Fenrir/FenrirMangiatoiaBehaviour.cs | 15 ++---- JotunnModStub/ModText.cs | 9 +++- JotunnModStub/RaceMenuWard.cs | 8 ++- .../Skeleton/SkeletonBonePileBehaviour.cs | 14 ++--- JotunnModStub/Sverm/SvermHive.cs | 6 +-- JotunnModStub/Sverm/SvermHiveStore.cs | 23 ++++---- JotunnModStub/Translations/English/hover.json | 52 +++++++++++++++++++ JotunnModStub/Translations/Italian/hover.json | 52 +++++++++++++++++++ JotunnModStub/Trenta/ComposterBehaviour.cs | 8 ++- JotunnModStub/Trenta/GroveBehaviour.cs | 16 +++--- JotunnModStub/Trol/TrolTotemBehaviour.cs | 6 +-- 16 files changed, 164 insertions(+), 79 deletions(-) create mode 100644 JotunnModStub/Translations/English/hover.json create mode 100644 JotunnModStub/Translations/Italian/hover.json diff --git a/JotunnModStub/Aswid/AswidThrall.cs b/JotunnModStub/Aswid/AswidThrall.cs index 638ce4e..9566bd9 100644 --- a/JotunnModStub/Aswid/AswidThrall.cs +++ b/JotunnModStub/Aswid/AswidThrall.cs @@ -142,15 +142,15 @@ namespace RacesOfValheim if (isEnslaved) { bool following = m_ai != null && m_ai.GetFollowTarget() != null; - return following ? "[E] Stay" : "[E] Follow"; + return (following ? ModText.Get("rov_hover_aswid_stay") : ModText.Get("rov_hover_aswid_follow")); } else { if (BossProgressionManager.GetCurrentProgressionState() < 6) return ""; float cd = AswidRace.GetEnslaveCooldown(); - if (cd > 0) return $"[E] Dominate (Cooldown: {Mathf.CeilToInt(cd / 60f)}m)"; - return "[E] Dominate"; + if (cd > 0) return ModText.Get("rov_hover_aswid_dominate_cooldown_m", Mathf.CeilToInt(cd / 60f)); + return ModText.Get("rov_hover_aswid_dominate"); } } diff --git a/JotunnModStub/Butler/ServantTableBehaviour.cs b/JotunnModStub/Butler/ServantTableBehaviour.cs index bac4a73..e4964e6 100644 --- a/JotunnModStub/Butler/ServantTableBehaviour.cs +++ b/JotunnModStub/Butler/ServantTableBehaviour.cs @@ -137,12 +137,11 @@ namespace RacesOfValheim if (servant == null) { - return m_title + "\nNo servant stands here.\n" + - "[$KEY_Use] Raise one"; + return ModText.Get("rov_hover_butler_no_servant_stands_here_raise", m_title); } string status = servant.Status; - if (string.IsNullOrEmpty(status)) status = "Waiting."; + if (string.IsNullOrEmpty(status)) status = ModText.Get("rov_hover_butler_waiting"); return m_title + "\n" + status; } diff --git a/JotunnModStub/Draugh/DraughSpawnerBehaviour.cs b/JotunnModStub/Draugh/DraughSpawnerBehaviour.cs index 39b1dd7..e7a6a10 100644 --- a/JotunnModStub/Draugh/DraughSpawnerBehaviour.cs +++ b/JotunnModStub/Draugh/DraughSpawnerBehaviour.cs @@ -328,21 +328,20 @@ namespace RacesOfValheim if (thrall.Kind == DraughSpawner.KindElite) aliveElite++; else aliveNormal++; } - string body = $"flesh {Mathf.Floor(GetFlesh())}/{DraughSpawner.FleshPerThrall}, " + - $"risen {aliveNormal}/{AliveCap()}, waiting {GetReserve()}/{DraughSpawner.ReserveCap}"; + string body = ModText.Get("rov_hover_draugh_flesh_risen_waiting", Mathf.Floor(GetFlesh()), DraughSpawner.FleshPerThrall, aliveNormal, AliveCap(), GetReserve(), DraughSpawner.ReserveCap); if (IsUpgraded()) { - body += $"\nofficers {aliveElite}/{EliteCap()}, waiting {GetReserveElite()}/{DraughSpawner.ReserveCapElite}"; + body += ModText.Get("rov_hover_draugh_officers_waiting", aliveElite, EliteCap(), GetReserveElite(), DraughSpawner.ReserveCapElite); } if (m_respawnTimer > 0f) { int left = Mathf.Max(1, Mathf.CeilToInt(DraughSpawner.RespawnSeconds - m_respawnTimer)); - body += $"\nnext rises in {left}s"; + body += ModText.Get("rov_hover_draugh_next_rises_s", left); } - body += "\n[$KEY_Use] Feed it flesh, or a draugr's head"; + body += ModText.Get("rov_hover_draugh_feed_flesh_or_draugr_s"); return Localization.instance.Localize($"{DraughSpawner.PieceDisplayName} ({body})"); } diff --git a/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs b/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs index cb381e0..444b065 100644 --- a/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs +++ b/JotunnModStub/Dvergar/DvergarBancoBehaviour.cs @@ -277,16 +277,16 @@ namespace RacesOfValheim private string Hover() { - string body = $"contracts {CountGroups()}/{DvergarBanco.MaxTroops}"; + string body = ModText.Get("rov_hover_dvergar_contracts", CountGroups(), DvergarBanco.MaxTroops); // Said in as many words: a player who cannot see their own discount will read the lower // number in the window as a mistake. float discount = Mathf.Clamp01(DvergarProgression.Current.TraderBuyDiscount); - if (discount > 0f) body += $"\nyour seal is worth {Mathf.RoundToInt(discount * 100f)}% off"; + if (discount > 0f) body += ModText.Get("rov_hover_dvergar_seal_worth_off", Mathf.RoundToInt(discount * 100f)); - if (!IsUpgraded()) body += "\n(what the Queen left behind buys two more crews)"; + if (!IsUpgraded()) body += ModText.Get("rov_hover_dvergar_what_queen_left_behind_buys"); - body += "\n[$KEY_Use] Read the ledger"; + body += ModText.Get("rov_hover_dvergar_read_ledger"); return Localization.instance.Localize($"{DvergarBanco.PieceDisplayName} ({body})"); } diff --git a/JotunnModStub/Dvergar/DvergarBotteBehaviour.cs b/JotunnModStub/Dvergar/DvergarBotteBehaviour.cs index 32d4a82..de506db 100644 --- a/JotunnModStub/Dvergar/DvergarBotteBehaviour.cs +++ b/JotunnModStub/Dvergar/DvergarBotteBehaviour.cs @@ -252,14 +252,12 @@ namespace RacesOfValheim string body; if (doses <= 0 || string.IsNullOrEmpty(brew)) { - body = "empty\n[$KEY_Use] Pour a brew in"; + body = ModText.Get("rov_hover_dvergar_empty_pour_brew"); } else { int waiting = InRange().Count; - body = $"{DvergarBotte.BrewDisplayName(brew)} {doses}/{DvergarBotte.MaxDoses}" + - $"\n{waiting} at the barrel" + - $"\n[$KEY_Use] Pour a round"; + body = ModText.Get("rov_hover_dvergar_at_barrel_pour_round", DvergarBotte.BrewDisplayName(brew), doses, DvergarBotte.MaxDoses, waiting); } return Localization.instance.Localize($"{DvergarBotte.PieceDisplayName} ({body})"); diff --git a/JotunnModStub/Fenrir/FenrirMangiatoiaBehaviour.cs b/JotunnModStub/Fenrir/FenrirMangiatoiaBehaviour.cs index 8a54e0f..94fce8c 100644 --- a/JotunnModStub/Fenrir/FenrirMangiatoiaBehaviour.cs +++ b/JotunnModStub/Fenrir/FenrirMangiatoiaBehaviour.cs @@ -440,13 +440,10 @@ namespace RacesOfValheim { Count(out int wolves, out int ulv, out int fenrir); - string body = $"meat {Mathf.Floor(GetFeed())}/{FenrirMangiatoia.TankCap}" + - $"\nwolves {wolves}/{WolfCap()}, ulv {ulv}/{UlvCap()}"; + string body = ModText.Get("rov_hover_fenrir_meat_wolves_ulv", Mathf.Floor(GetFeed()), FenrirMangiatoia.TankCap, wolves, WolfCap(), ulv, UlvCap()); // Said in as many words, because the upgrade is deliberately invisible on the model. - body += IsUpgraded() - ? $", fenrir {fenrir}/{FenrirCap()}" - : "\nthe blood is thin here - it raises no fenrir yet"; + body += (IsUpgraded() ? ModText.Get("rov_hover_fenrir_fenrir", fenrir, FenrirCap()) : ModText.Get("rov_hover_fenrir_blood_thin_here_raises_no")); if (m_waitingFor != null) { @@ -458,16 +455,14 @@ namespace RacesOfValheim : m_waitingFor == FenrirMangiatoia.KindUlv ? FenrirMangiatoia.UlvCost : FenrirMangiatoia.FenrirCost; - body += GetFeed() < cost - ? $"\nnot enough meat for the next one ({cost} needed)" - : $"\nnext in {Mathf.Max(1, Mathf.CeilToInt(wait - m_timer))}s"; + body += (GetFeed() < cost ? ModText.Get("rov_hover_fenrir_not_enough_meat_next_one", cost) : ModText.Get("rov_hover_fenrir_next_s", Mathf.Max(1, Mathf.CeilToInt(wait - m_timer)))); } else { - body += "\nthe pack is whole"; + body += ModText.Get("rov_hover_fenrir_pack_whole"); } - body += "\n[$KEY_Use] Fill it with meat"; + body += ModText.Get("rov_hover_fenrir_fill_with_meat"); return Localization.instance.Localize($"{FenrirMangiatoia.PieceDisplayName} ({body})"); } diff --git a/JotunnModStub/ModText.cs b/JotunnModStub/ModText.cs index b5bb3e9..a60f631 100644 --- a/JotunnModStub/ModText.cs +++ b/JotunnModStub/ModText.cs @@ -28,7 +28,14 @@ namespace RacesOfValheim string[] words = args .Select(a => Localization.instance.Localize(a?.ToString() ?? "")) .ToArray(); - return Localization.instance.Localize("$" + key, words); + string text = Localization.instance.Localize("$" + key, words); + + // Valheim resolves tokens in one pass and never looks inside what it put in, so a + // "$KEY_Use" written in a translation came out as it was. Places that localize the + // result again (MessageHud, the stations' own Localize) hid that; hover texts returned + // straight to the HUD did not. A second pass costs nothing when there is no $ left. + if (text.IndexOf('$') >= 0) text = Localization.instance.Localize(text); + return text; } /// diff --git a/JotunnModStub/RaceMenuWard.cs b/JotunnModStub/RaceMenuWard.cs index 94ef37a..e59b237 100644 --- a/JotunnModStub/RaceMenuWard.cs +++ b/JotunnModStub/RaceMenuWard.cs @@ -171,13 +171,11 @@ namespace RacesOfValheim public string GetHoverText() { - string mode = BossProgressionManager.UsePersonalProgression ? "Personal" : "World"; + string mode = (BossProgressionManager.UsePersonalProgression ? ModText.Get("rov_hover_ward_personal") : ModText.Get("rov_hover_ward_world")); int state = BossProgressionManager.GetCurrentProgressionState(); - string boss = BossProgressionManager.GetBossNameForState(state); + string boss = BossProgressionManager.GetBossTokenForState(state); - return $"Race Menu Ward\n{mode} progression - {boss} ({state}/{BossProgressionManager.MaxState})\n" + - "[E] Open\n" + - "[Use item] Offer a boss relic"; + return ModText.Get("rov_hover_ward_race_menu_ward_progression_open", mode, boss, state, BossProgressionManager.MaxState); } public bool Interact(Humanoid user, bool hold, bool alt) diff --git a/JotunnModStub/Skeleton/SkeletonBonePileBehaviour.cs b/JotunnModStub/Skeleton/SkeletonBonePileBehaviour.cs index f65e631..aaa454f 100644 --- a/JotunnModStub/Skeleton/SkeletonBonePileBehaviour.cs +++ b/JotunnModStub/Skeleton/SkeletonBonePileBehaviour.cs @@ -362,25 +362,21 @@ namespace RacesOfValheim // upgraded, so there was no way to know the cap was two until ten trophies had gone in. // Every shelf is now visible whether or not it can be used yet, and says why when it cannot. string body = - $"\nmelee {alive[SkeletonBonePile.KindMelee]}/{GetSlots(SkeletonBonePile.KindMelee)} of {MeleeCap()}" + - $"\narchers {alive[SkeletonBonePile.KindRanged]}/{GetSlots(SkeletonBonePile.KindRanged)} of {RangedCap()}" + - $"\nrotten {alive[SkeletonBonePile.KindRancid]}/{GetSlots(SkeletonBonePile.KindRancid)} of {RancidCap()}"; + ModText.Get("rov_hover_skeleton_melee_archers_rotten", alive[SkeletonBonePile.KindMelee], GetSlots(SkeletonBonePile.KindMelee), MeleeCap(), alive[SkeletonBonePile.KindRanged], GetSlots(SkeletonBonePile.KindRanged), RangedCap(), alive[SkeletonBonePile.KindRancid], GetSlots(SkeletonBonePile.KindRancid), RancidCap()); - if (!IsUpgraded()) body += " (needs a Greater Cursed Skull)"; + if (!IsUpgraded()) body += ModText.Get("rov_hover_skeleton_needs_greater_cursed_skull"); int bonesToward = m_nview.GetZDO().GetInt(KeyBones); int placesLeft = TotalCap() - PaidSlots(); - body += placesLeft > 0 - ? $"\nbone {bonesToward}/{SkeletonBonePile.BonesPerSlot} toward the next of {placesLeft} places" - : "\nevery place is bought"; + body += (placesLeft > 0 ? ModText.Get("rov_hover_skeleton_bone_toward_next_places", bonesToward, SkeletonBonePile.BonesPerSlot, placesLeft) : ModText.Get("rov_hover_skeleton_every_place_bought")); if (m_respawnTimer > 0f) { int left = Mathf.Max(1, Mathf.CeilToInt(RespawnSeconds() - m_respawnTimer)); - body += $"\nnext rises in {left}s"; + body += ModText.Get("rov_hover_skeleton_next_rises_s", left); } - body += "\n[$KEY_Use] Bone in hand to buy a place, empty hands to move the line"; + body += ModText.Get("rov_hover_skeleton_bone_hand_buy_place_empty"); return Localization.instance.Localize($"{SkeletonBonePile.PieceDisplayName} ({body})"); } diff --git a/JotunnModStub/Sverm/SvermHive.cs b/JotunnModStub/Sverm/SvermHive.cs index 468846b..5470162 100644 --- a/JotunnModStub/Sverm/SvermHive.cs +++ b/JotunnModStub/Sverm/SvermHive.cs @@ -461,11 +461,7 @@ namespace RacesOfValheim // Both numbers, always, even when nothing is going down. A line that appears and // disappears is one the player has to notice twice before they believe it. - return $"{SvermHiveStage.NameOf(SvermHiveStage.Of(transform))}\n" + - SvermHiveReadout.Tank(transform) + - $"Beehives {infected} taken of {SvermConfigManagement.Beehives} allowed, {beehives} in range\n" + - SvermWorker.Readout(transform.position) + - "[$KEY_Use] Feed it a stack"; + return ModText.Get("rov_hover_sverm_beehives_taken_allowed_range_feed", SvermHiveStage.NameOf(SvermHiveStage.Of(transform)), SvermHiveReadout.Tank(transform), infected, SvermConfigManagement.Beehives, beehives, SvermWorker.Readout(transform.position)); } // New in Valheim 1.0: Hoverable gained this. Every vanilla implementation returns a diff --git a/JotunnModStub/Sverm/SvermHiveStore.cs b/JotunnModStub/Sverm/SvermHiveStore.cs index fe7a064..ef96cc7 100644 --- a/JotunnModStub/Sverm/SvermHiveStore.cs +++ b/JotunnModStub/Sverm/SvermHiveStore.cs @@ -222,17 +222,15 @@ namespace RacesOfValheim SvermHiveBehaviour hive = Hive; if (hive == null) return Title; - return $"{Title}\n" + - SvermHiveReadout.Tank(hive.transform) + - $"[$KEY_Use] {Prompt}"; + return ModText.Get("rov_hover_sverm_msg", Title, SvermHiveReadout.Tank(hive.transform), Prompt); } } /// The hive at the foot of the nest. Press E, a stack goes in. public class SvermHiveStomach : SvermHiveMouth { - protected override string Title => "Hive Stomach"; - protected override string Prompt => "Feed it a stack"; + protected override string Title => "$rov_hover_sverm_stomach_title"; + protected override string Prompt => "$rov_hover_sverm_stomach_prompt"; protected override bool Use(SvermHiveBehaviour hive, Player player) { @@ -459,13 +457,11 @@ namespace RacesOfValheim SvermHiveBehaviour nest = Nest; if (nest == null) { - return $"{SvermHiveMarketPiece.DisplayName}\n" + - $"No hive within {SvermConfigManagement.AuraRadius:0} metres."; + return ModText.Get("rov_hover_sverm_market_no_hive", SvermHiveMarketPiece.DisplayName, + SvermConfigManagement.AuraRadius.ToString("0")); } - return $"{SvermHiveMarketPiece.DisplayName}\n" + - SvermHiveReadout.Tank(nest.transform) + - "[$KEY_Use] Trade with the hive"; + return ModText.Get("rov_hover_sverm_trade_with_hive", SvermHiveMarketPiece.DisplayName, SvermHiveReadout.Tank(nest.transform)); } } @@ -474,9 +470,10 @@ namespace RacesOfValheim { public static string Tank(Transform nest) { - return $"Biomass {SvermBiomass.Bank(nest):0} / {SvermBiomass.Capacity(nest):0}\n" + - $"Digesting {SvermBiomass.Digesting(nest):0}\n" + - $"Brood eggs {SvermBroodEggs.Count(nest)} / {SvermBroodEggs.Cap(nest)}\n"; + return ModText.Get("rov_hover_sverm_tank", + SvermBiomass.Bank(nest).ToString("0"), SvermBiomass.Capacity(nest).ToString("0"), + SvermBiomass.Digesting(nest).ToString("0"), + SvermBroodEggs.Count(nest), SvermBroodEggs.Cap(nest)); } } diff --git a/JotunnModStub/Translations/English/hover.json b/JotunnModStub/Translations/English/hover.json new file mode 100644 index 0000000..9c09cb6 --- /dev/null +++ b/JotunnModStub/Translations/English/hover.json @@ -0,0 +1,52 @@ +{ + "rov_hover_aswid_dominate": "[$KEY_Use] Dominate", + "rov_hover_aswid_dominate_cooldown_m": "[$KEY_Use] Dominate (Cooldown: $1m)", + "rov_hover_aswid_follow": "[$KEY_Use] Follow", + "rov_hover_aswid_stay": "[$KEY_Use] Stay", + "rov_hover_butler_no_servant_stands_here_raise": "$1\nNo servant stands here.\n[$KEY_Use] Raise one", + "rov_hover_butler_waiting": "Waiting.", + "rov_hover_draugh_feed_flesh_or_draugr_s": "\n[$KEY_Use] Feed it flesh, or a draugr's head", + "rov_hover_draugh_flesh_risen_waiting": "flesh $1/$2, risen $3/$4, waiting $5/$6", + "rov_hover_draugh_next_rises_s": "\nnext rises in $1s", + "rov_hover_draugh_officers_waiting": "\nofficers $1/$2, waiting $3/$4", + "rov_hover_dvergar_at_barrel_pour_round": "$1 $2/$3\n$4 at the barrel\n[$KEY_Use] Pour a round", + "rov_hover_dvergar_contracts": "contracts $1/$2", + "rov_hover_dvergar_empty_pour_brew": "empty\n[$KEY_Use] Pour a brew in", + "rov_hover_dvergar_read_ledger": "\n[$KEY_Use] Read the ledger", + "rov_hover_dvergar_seal_worth_off": "\nyour seal is worth $1% off", + "rov_hover_dvergar_what_queen_left_behind_buys": "\n(what the Queen left behind buys two more crews)", + "rov_hover_fenrir_blood_thin_here_raises_no": "\nthe blood is thin here - it raises no fenrir yet", + "rov_hover_fenrir_fenrir": ", fenrir $1/$2", + "rov_hover_fenrir_fill_with_meat": "\n[$KEY_Use] Fill it with meat", + "rov_hover_fenrir_meat_wolves_ulv": "meat $1/$2\nwolves $3/$4, ulv $5/$6", + "rov_hover_fenrir_next_s": "\nnext in $1s", + "rov_hover_fenrir_not_enough_meat_next_one": "\nnot enough meat for the next one ($1 needed)", + "rov_hover_fenrir_pack_whole": "\nthe pack is whole", + "rov_hover_skeleton_bone_hand_buy_place_empty": "\n[$KEY_Use] Bone in hand to buy a place, empty hands to move the line", + "rov_hover_skeleton_bone_toward_next_places": "\nbone $1/$2 toward the next of $3 places", + "rov_hover_skeleton_every_place_bought": "\nevery place is bought", + "rov_hover_skeleton_melee_archers_rotten": "\nmelee $1/$2 of $3\narchers $4/$5 of $6\nrotten $7/$8 of $9", + "rov_hover_skeleton_needs_greater_cursed_skull": " (needs a Greater Cursed Skull)", + "rov_hover_skeleton_next_rises_s": "\nnext rises in $1s", + "rov_hover_sverm_beehives_taken_allowed_range_feed": "$1\n$2Beehives $3 taken of $4 allowed, $5 in range\n$6[$KEY_Use] Feed it a stack", + "rov_hover_sverm_market_no_hive": "$1\nNo hive within $2 metres.", + "rov_hover_sverm_msg": "$1\n$2[$KEY_Use] $3", + "rov_hover_sverm_stomach_prompt": "Feed it a stack", + "rov_hover_sverm_stomach_title": "Hive Stomach", + "rov_hover_sverm_tank": "Biomass $1 / $2\nDigesting $3\nBrood eggs $4 / $5\n", + "rov_hover_sverm_trade_with_hive": "$1\n$2[$KEY_Use] Trade with the hive", + "rov_hover_trenta_flesh_feed_raw_flesh": "flesh $1/$2\n[$KEY_Use] Feed it raw flesh", + "rov_hover_trenta_grove_growing": "$1 (growing, $2 minutes left)", + "rov_hover_trenta_grove_grown": "$1 ($2 $3/$4, honey $5)\n[$KEY_Use] Feed it Fertilizer", + "rov_hover_trenta_honey_full": "$1, full", + "rov_hover_trenta_honey_next": "$1, next in $2 min", + "rov_hover_trenta_honey_none": "none (no honey item found)", + "rov_hover_trenta_ready_empty": "ready: $1 $2\n[$KEY_Use] Empty it", + "rov_hover_trenta_rotting_minutes_left": "rotting, $1 minutes left", + "rov_hover_trol_call_warbands": "\n[$KEY_Use] Call the warbands", + "rov_hover_trol_warbands": "warbands $1/$2", + "rov_hover_trol_yagluth_drop_hand_buys_king": "\n(a Yagluth drop in hand buys a king's head, and two more bands)", + "rov_hover_ward_personal": "Personal", + "rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\n$1 progression - $2 ($3/$4)\n[$KEY_Use] Open\n[Use item] Offer a boss relic", + "rov_hover_ward_world": "World" +} diff --git a/JotunnModStub/Translations/Italian/hover.json b/JotunnModStub/Translations/Italian/hover.json new file mode 100644 index 0000000..d332961 --- /dev/null +++ b/JotunnModStub/Translations/Italian/hover.json @@ -0,0 +1,52 @@ +{ + "rov_hover_aswid_dominate": "[$KEY_Use] Domina", + "rov_hover_aswid_dominate_cooldown_m": "[$KEY_Use] Domina (ricarica: $1m)", + "rov_hover_aswid_follow": "[$KEY_Use] Segui", + "rov_hover_aswid_stay": "[$KEY_Use] Resta", + "rov_hover_butler_no_servant_stands_here_raise": "$1\nQui non c'è nessun servitore.\n[$KEY_Use] Fanne alzare uno", + "rov_hover_butler_waiting": "In attesa.", + "rov_hover_draugh_feed_flesh_or_draugr_s": "\n[$KEY_Use] Nutrilo di carne, o della testa di un draugr", + "rov_hover_draugh_flesh_risen_waiting": "carne $1/$2, risorti $3/$4, in attesa $5/$6", + "rov_hover_draugh_next_rises_s": "\nil prossimo si alza tra $1s", + "rov_hover_draugh_officers_waiting": "\nufficiali $1/$2, in attesa $3/$4", + "rov_hover_dvergar_at_barrel_pour_round": "$1 $2/$3\n$4 al barile\n[$KEY_Use] Versa un giro", + "rov_hover_dvergar_contracts": "contratti $1/$2", + "rov_hover_dvergar_empty_pour_brew": "vuoto\n[$KEY_Use] Versaci una bevanda", + "rov_hover_dvergar_read_ledger": "\n[$KEY_Use] Leggi il registro", + "rov_hover_dvergar_seal_worth_off": "\nil tuo sigillo vale uno sconto del $1%", + "rov_hover_dvergar_what_queen_left_behind_buys": "\n(ciò che la Regina ha lasciato compra altre due squadre)", + "rov_hover_fenrir_blood_thin_here_raises_no": "\nqui il sangue è debole: non fa ancora nascere fenrir", + "rov_hover_fenrir_fenrir": ", fenrir $1/$2", + "rov_hover_fenrir_fill_with_meat": "\n[$KEY_Use] Riempila di carne", + "rov_hover_fenrir_meat_wolves_ulv": "carne $1/$2\nlupi $3/$4, ulv $5/$6", + "rov_hover_fenrir_next_s": "\nil prossimo tra $1s", + "rov_hover_fenrir_not_enough_meat_next_one": "\nnon c'è abbastanza carne per il prossimo (ne serve $1)", + "rov_hover_fenrir_pack_whole": "\nil branco è al completo", + "rov_hover_skeleton_bone_hand_buy_place_empty": "\n[$KEY_Use] Osso in mano per comprare un posto, mani vuote per muovere la fila", + "rov_hover_skeleton_bone_toward_next_places": "\nossa $1/$2 per il prossimo dei $3 posti", + "rov_hover_skeleton_every_place_bought": "\nogni posto è comprato", + "rov_hover_skeleton_melee_archers_rotten": "\nmischia $1/$2 di $3\narcieri $4/$5 di $6\nrancidi $7/$8 di $9", + "rov_hover_skeleton_needs_greater_cursed_skull": " (serve un teschio maledetto superiore)", + "rov_hover_skeleton_next_rises_s": "\nil prossimo si alza tra $1s", + "rov_hover_sverm_beehives_taken_allowed_range_feed": "$1\n$2Alveari $3 occupati su $4 consentiti, $5 nel raggio\n$6[$KEY_Use] Dagli da mangiare una pila", + "rov_hover_sverm_market_no_hive": "$1\nNessun alveare entro $2 metri.", + "rov_hover_sverm_msg": "$1\n$2[$KEY_Use] $3", + "rov_hover_sverm_stomach_prompt": "Dagli da mangiare una pila", + "rov_hover_sverm_stomach_title": "Stomaco dell'alveare", + "rov_hover_sverm_tank": "Biomassa $1 / $2\nIn digestione $3\nUova della covata $4 / $5\n", + "rov_hover_sverm_trade_with_hive": "$1\n$2[$KEY_Use] Commercia con l'alveare", + "rov_hover_trenta_flesh_feed_raw_flesh": "carne $1/$2\n[$KEY_Use] Nutrila di carne cruda", + "rov_hover_trenta_grove_growing": "$1 (in crescita, mancano $2 minuti)", + "rov_hover_trenta_grove_grown": "$1 ($2 $3/$4, miele $5)\n[$KEY_Use] Nutrilo di fertilizzante", + "rov_hover_trenta_honey_full": "$1, pieno", + "rov_hover_trenta_honey_next": "$1, il prossimo tra $2 min", + "rov_hover_trenta_honey_none": "nessuno (oggetto miele non trovato)", + "rov_hover_trenta_ready_empty": "pronto: $1 $2\n[$KEY_Use] Svuotala", + "rov_hover_trenta_rotting_minutes_left": "sta marcendo, mancano $1 minuti", + "rov_hover_trol_call_warbands": "\n[$KEY_Use] Chiama le bande da guerra", + "rov_hover_trol_warbands": "bande da guerra $1/$2", + "rov_hover_trol_yagluth_drop_hand_buys_king": "\n(un bottino di Yagluth in mano compra la testa di un re, e altre due bande)", + "rov_hover_ward_personal": "Personale", + "rov_hover_ward_race_menu_ward_progression_open": "$rov_piece_racemenuward_name\nProgressione $1 - $2 ($3/$4)\n[$KEY_Use] Apri\n[Usa oggetto] Offri una reliquia di boss", + "rov_hover_ward_world": "del mondo" +} diff --git a/JotunnModStub/Trenta/ComposterBehaviour.cs b/JotunnModStub/Trenta/ComposterBehaviour.cs index 82c9871..df7caf1 100644 --- a/JotunnModStub/Trenta/ComposterBehaviour.cs +++ b/JotunnModStub/Trenta/ComposterBehaviour.cs @@ -243,17 +243,15 @@ namespace RacesOfValheim switch (GetState()) { case State.Ready: - body = $"ready: {m_yield} {TrentaConfig.FertilizerDisplayName}\n" + - "[$KEY_Use] Empty it"; + body = ModText.Get("rov_hover_trenta_ready_empty", m_yield, TrentaConfig.FertilizerDisplayName); break; case State.Composting: - body = $"rotting, {MinutesLeft()} minutes left"; + body = ModText.Get("rov_hover_trenta_rotting_minutes_left", MinutesLeft()); break; default: - body = $"flesh {Mathf.Floor(GetFlesh())}/{m_capacity}\n" + - "[$KEY_Use] Feed it raw flesh"; + body = ModText.Get("rov_hover_trenta_flesh_feed_raw_flesh", Mathf.Floor(GetFlesh()), m_capacity); break; } diff --git a/JotunnModStub/Trenta/GroveBehaviour.cs b/JotunnModStub/Trenta/GroveBehaviour.cs index 64f3989..a40c1ce 100644 --- a/JotunnModStub/Trenta/GroveBehaviour.cs +++ b/JotunnModStub/Trenta/GroveBehaviour.cs @@ -318,34 +318,32 @@ namespace RacesOfValheim { if (!IsGrown()) { - return Localization.instance.Localize( - $"{TrentaConfig.GroveDisplayName} (growing, {MinutesLeft()} minutes left)"); + return ModText.Get("rov_hover_trenta_grove_growing", TrentaConfig.GroveDisplayName, MinutesLeft()); } // The honey line is here because it was missing, and its absence is why a grove that // was quietly producing nothing looked exactly like one that was working. - return Localization.instance.Localize( - $"{TrentaConfig.GroveDisplayName} ({TrentaConfig.FertilizerDisplayName} " + - $"{GetFertilizer()}/{TrentaConfig.GroveFertilizerCapacity}, honey {HoneyStatus()})\n" + - "[$KEY_Use] Feed it Fertilizer"); + return ModText.Get("rov_hover_trenta_grove_grown", TrentaConfig.GroveDisplayName, + TrentaConfig.FertilizerDisplayName, GetFertilizer(), TrentaConfig.GroveFertilizerCapacity, + HoneyStatus()); } /// How much honey is in the crate and how long until the next drop of it. private string HoneyStatus() { - if (m_honeyPrefab == null) return "none (no honey item found)"; + if (m_honeyPrefab == null) return ModText.Get("rov_hover_trenta_honey_none"); Inventory inventory = m_container != null ? m_container.GetInventory() : null; int stored = inventory != null ? CountHoney(inventory) : 0; string status = $"{stored}/{m_honeyCapacity}"; - if (stored >= m_honeyCapacity) return status + ", full"; + if (stored >= m_honeyCapacity) return ModText.Get("rov_hover_trenta_honey_full", status); long stamp = m_nview.GetZDO().GetLong(KeyHoneyTime, 0L); if (stamp == 0L || ZNet.instance == null) return status; double left = m_secPerHoney - (ZNet.instance.GetTime() - new DateTime(stamp)).TotalSeconds; - return status + $", next in {Mathf.Max(1, Mathf.CeilToInt((float)left / 60f))} min"; + return ModText.Get("rov_hover_trenta_honey_next", status, Mathf.Max(1, Mathf.CeilToInt((float)left / 60f))); } // ---------------------------------------------------------------- state diff --git a/JotunnModStub/Trol/TrolTotemBehaviour.cs b/JotunnModStub/Trol/TrolTotemBehaviour.cs index b567f9d..cf040b6 100644 --- a/JotunnModStub/Trol/TrolTotemBehaviour.cs +++ b/JotunnModStub/Trol/TrolTotemBehaviour.cs @@ -276,14 +276,14 @@ namespace RacesOfValheim private string Hover() { - string body = $"warbands {CountGroups()}/{TrolTotem.MaxTroops}"; + string body = ModText.Get("rov_hover_trol_warbands", CountGroups(), TrolTotem.MaxTroops); - if (!IsUpgraded()) body += "\n(a Yagluth drop in hand buys a king's head, and two more bands)"; + if (!IsUpgraded()) body += ModText.Get("rov_hover_trol_yagluth_drop_hand_buys_king"); // The roster lives in the window now, not in the hover - so this only has to get the player // to open it. The hold gesture it used to advertise was unreadable: it cycled faster than // anyone could see what was selected. - body += "\n[$KEY_Use] Call the warbands"; + body += ModText.Get("rov_hover_trol_call_warbands"); return Localization.instance.Localize($"{TrolTotem.PieceDisplayName} ({body})"); }