Compat v14 : replace broken localize² with new helper localizeEmbedded

This commit is contained in:
Vlyan
2026-04-06 12:43:36 +02:00
parent 71f01b1c5c
commit 852703c4ef
13 changed files with 62 additions and 54 deletions

View File

@@ -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 */
/* ------------------------------------ */