From a13b0fc2d6ccd0a564afa0729feddf13cee12960 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Wed, 5 Aug 2026 13:06:57 +0200 Subject: [PATCH] fix: affichage des Instincts et Interdits du Totem sur la fiche PJ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Helper smarttl : honore la clé passée en 3e argument (défaut "name") ; il renvoyait systématiquement le nom du Totem, donc Instincts et Interdits n'apparaissaient pas (description et autres clés aussi). - Onglet Totem (AppV2 et legacy) : libellés localisés IDENTITY.instincts / IDENTITY.prohibits au lieu de textes codés en dur. --- module/system/handlebars-manager.mjs | 5 +++-- templates/actor/appv2/character-totem.hbs | 4 ++-- templates/actor/character/character-totem.hbs | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/module/system/handlebars-manager.mjs b/module/system/handlebars-manager.mjs index 5b81fc5..5149280 100644 --- a/module/system/handlebars-manager.mjs +++ b/module/system/handlebars-manager.mjs @@ -98,8 +98,9 @@ export const registerHandlebarsHelpers = function () { }); // search translation with variables - Handlebars.registerHelper('smarttl', function (arrayLabel, objectLabel, options) { - return game.i18n.localize(arrayLabel + "." + objectLabel + ".name"); + Handlebars.registerHelper('smarttl', function (arrayLabel, objectLabel, key) { + if (!key || typeof key !== 'string') key = 'name'; + return game.i18n.localize(arrayLabel + "." + objectLabel + "." + key); }); // Return an object of skills ordered alphabetically by their localized diff --git a/templates/actor/appv2/character-totem.hbs b/templates/actor/appv2/character-totem.hbs index 0ac2652..429ced5 100644 --- a/templates/actor/appv2/character-totem.hbs +++ b/templates/actor/appv2/character-totem.hbs @@ -13,10 +13,10 @@

{{smarttl "TOTEMS" system.identity.totem "description"}}

-
Principes
{{smarttl "TOTEMS" system.identity.totem "instincts"}}
+
{{ localize 'IDENTITY.instincts' }}
{{smarttl "TOTEMS" system.identity.totem "instincts"}}
-
Interdits
{{smarttl "TOTEMS" system.identity.totem "bans"}}
+
{{ localize 'IDENTITY.prohibits' }}
{{smarttl "TOTEMS" system.identity.totem "bans"}}
diff --git a/templates/actor/character/character-totem.hbs b/templates/actor/character/character-totem.hbs index 7ceeeec..165873d 100644 --- a/templates/actor/character/character-totem.hbs +++ b/templates/actor/character/character-totem.hbs @@ -12,10 +12,10 @@

{{smarttl "TOTEMS" system.identity.totem "description"}}

-
Principes
{{smarttl "TOTEMS" system.identity.totem "instincts"}}
+
{{ localize 'IDENTITY.instincts' }}
{{smarttl "TOTEMS" system.identity.totem "instincts"}}
-
Interdits
{{smarttl "TOTEMS" system.identity.totem "bans"}}
+
{{ localize 'IDENTITY.prohibits' }}
{{smarttl "TOTEMS" system.identity.totem "bans"}}