From 37f3eb399771ee89f26e702ba8c09796c7cd7ac7 Mon Sep 17 00:00:00 2001 From: Pallando Date: Sun, 6 Oct 2024 18:30:10 +0200 Subject: [PATCH] Translate actor vehicle roles --- modules/babele-register.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/babele-register.js b/modules/babele-register.js index 711a1b1..d1de766 100644 --- a/modules/babele-register.js +++ b/modules/babele-register.js @@ -515,6 +515,17 @@ Hooks.once('init', () => { break; } } + } else if (trait_en.type == "vehicleRole") { + let validCompendiums = game.wfrp4e.tags.getPacksWithTag("vehicleRole") + for (let compData of validCompendiums) { + let role_fr = game.babele.translate(compData.metadata.id, { name: name_en }, true); + if (role_fr?.system) { + trait_en.name = role_fr.name || trait_en.name + // DEBG: console.log(">>>>> Role ?", role_fr.name ); + trait_en.system = foundry.utils.duplicate(role_fr.system); + break; + } + } } else if (trait_en.type == "trapping" || trait_en.type == "weapon" || trait_en.type == "armour" || trait_en.type == "container" || trait_en.type == "money") { let validCompendiums = game.wfrp4e.tags.getPacksWithTag(["trapping"], ["weapon", "armour", "container", "money"]) for (let compData of validCompendiums) {