From 852703c4ef0cb9657150c100f54f836d5dc990ff Mon Sep 17 00:00:00 2001 From: Vlyan Date: Mon, 6 Apr 2026 12:43:36 +0200 Subject: [PATCH] =?UTF-8?q?Compat=20v14=20:=20replace=20broken=20localize?= =?UTF-8?q?=C2=B2=20with=20new=20helper=20localizeEmbedded?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/scripts/handlebars.js | 8 ++++ system/templates/actors/actor-export.html | 32 ++++++------- .../templates/actors/character/conflict.html | 2 +- .../actors/character/techniques.html | 2 +- system/templates/actors/npc/conflict.html | 2 +- system/templates/actors/npc/techniques.html | 2 +- .../actors/twenty-questions-dialog.html | 48 +++++++++---------- system/templates/gm/combat-tracker-bar.html | 4 +- system/templates/gm/gm-monitor.html | 2 +- .../templates/gm/monitor/character-view.html | 2 +- .../templates/gm/monitor/tooltips/global.html | 6 +-- system/templates/items/item/items.html | 2 +- .../items/peculiarity/peculiarity-text.html | 4 +- 13 files changed, 62 insertions(+), 54 deletions(-) diff --git a/system/scripts/handlebars.js b/system/scripts/handlebars.js index 50643e3..6dd5874 100644 --- a/system/scripts/handlebars.js +++ b/system/scripts/handlebars.js @@ -37,6 +37,14 @@ export const RegisterHandlebars = function () { return sanitizeIfFail(game.i18n.localize(isYes ? "Yes" : "No")); }); + // Replace "localize (localize" for partial var (broken in v14) + Handlebars.registerHelper("localizeEmbedded", function (string, objects) { + Object.keys(objects.hash).forEach(key => { + string = string.replace("{" + key + "}", objects.hash[key]); + }); + return sanitizeIfFail(game.i18n.localize(string)); + }); + /* ------------------------------------ */ /* Dice */ /* ------------------------------------ */ diff --git a/system/templates/actors/actor-export.html b/system/templates/actors/actor-export.html index 377ad82..037c384 100644 --- a/system/templates/actors/actor-export.html +++ b/system/templates/actors/actor-export.html @@ -65,7 +65,7 @@