fix: affichage des Instincts et Interdits du Totem sur la fiche PJ

- 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.
This commit is contained in:
2026-08-05 13:06:57 +02:00
parent 0ad240bd03
commit a13b0fc2d6
3 changed files with 7 additions and 6 deletions
+3 -2
View File
@@ -98,8 +98,9 @@ export const registerHandlebarsHelpers = function () {
}); });
// search translation with variables // search translation with variables
Handlebars.registerHelper('smarttl', function (arrayLabel, objectLabel, options) { Handlebars.registerHelper('smarttl', function (arrayLabel, objectLabel, key) {
return game.i18n.localize(arrayLabel + "." + objectLabel + ".name"); if (!key || typeof key !== 'string') key = 'name';
return game.i18n.localize(arrayLabel + "." + objectLabel + "." + key);
}); });
// Return an object of skills ordered alphabetically by their localized // Return an object of skills ordered alphabetically by their localized
+2 -2
View File
@@ -13,10 +13,10 @@
<p style="font-size:80%;">{{smarttl "TOTEMS" system.identity.totem "description"}}</p> <p style="font-size:80%;">{{smarttl "TOTEMS" system.identity.totem "description"}}</p>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class> <div class>
<div class="item-name"><strong>Principes</strong><br />{{smarttl "TOTEMS" system.identity.totem "instincts"}}</div> <div class="item-name"><strong>{{ localize 'IDENTITY.instincts' }}</strong><br />{{smarttl "TOTEMS" system.identity.totem "instincts"}}</div>
</div> </div>
<div class> <div class>
<div class="item-name"><strong>Interdits</strong><br />{{smarttl "TOTEMS" system.identity.totem "bans"}}</div> <div class="item-name"><strong>{{ localize 'IDENTITY.prohibits' }}</strong><br />{{smarttl "TOTEMS" system.identity.totem "bans"}}</div>
</div> </div>
</div> </div>
</div> </div>
@@ -12,10 +12,10 @@
<p style="font-size:80%;">{{smarttl "TOTEMS" system.identity.totem "description"}}</p> <p style="font-size:80%;">{{smarttl "TOTEMS" system.identity.totem "description"}}</p>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class> <div class>
<div class="item-name"><strong>Principes</strong><br />{{smarttl "TOTEMS" system.identity.totem "instincts"}}</div> <div class="item-name"><strong>{{ localize 'IDENTITY.instincts' }}</strong><br />{{smarttl "TOTEMS" system.identity.totem "instincts"}}</div>
</div> </div>
<div class> <div class>
<div class="item-name"><strong>Interdits</strong><br />{{smarttl "TOTEMS" system.identity.totem "bans"}}</div> <div class="item-name"><strong>{{ localize 'IDENTITY.prohibits' }}</strong><br />{{smarttl "TOTEMS" system.identity.totem "bans"}}</div>
</div> </div>
</div> </div>
</div> </div>