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:
@@ -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
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
<p style="font-size:80%;">{{smarttl "TOTEMS" system.identity.totem "description"}}</p>
|
||||
<div class="grid grid-2col">
|
||||
<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 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>
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
<p style="font-size:80%;">{{smarttl "TOTEMS" system.identity.totem "description"}}</p>
|
||||
<div class="grid grid-2col">
|
||||
<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 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>
|
||||
|
||||
Reference in New Issue
Block a user