From 3effc2a0b2d40f8874137644d72e24afd0601e40 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Wed, 10 Jun 2026 15:25:15 +0200 Subject: [PATCH] Fixed localization --- lang/en.json | 4 ++++ module/applications/ui/countdowns.mjs | 2 +- module/config/generalConfig.mjs | 6 ++++-- module/helpers/handlebarsHelper.mjs | 7 +------ templates/ui/countdowns/countdowns-view.hbs | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lang/en.json b/lang/en.json index 9f16828e..70c1f097 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1170,6 +1170,10 @@ "fear": "Fear", "spotlight": "Spotlight" }, + "CountdownBaseType": { + "shortterm": { "label": "Short Term", "shortLabel": "Short" }, + "longterm": { "label": "Long Term", "shortLabel": "Long" } + }, "DaggerheartDiceAnimationEvents": { "critical": { "name": "Critical" }, "higher": { "name": "Highest Roll" } diff --git a/module/applications/ui/countdowns.mjs b/module/applications/ui/countdowns.mjs index 8ce0d2ce..a869e887 100644 --- a/module/applications/ui/countdowns.mjs +++ b/module/applications/ui/countdowns.mjs @@ -189,7 +189,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application context.typeToggles = Object.values(CONFIG.DH.GENERAL.countdownType).map(type => ({ type: type.id, - label: game.i18n.localize(type.label), + label: game.i18n.localize(type.shortLabel), active: context.userCountdownTypes.includes(type.id) })); diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index e39be829..05862377 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -962,11 +962,13 @@ export const countdownAppMode = { export const countdownType = { shortterm: { id: 'shortterm', - label: 'Short' + label: 'DAGGERHEART.CONFIG.CountdownBaseType.shortterm.label', + shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.shortterm.shortLabel' }, longterm: { id: 'longterm', - label: 'Long' + label: 'DAGGERHEART.CONFIG.CountdownBaseType.longterm.label', + shortLabel: 'DAGGERHEART.CONFIG.CountdownBaseType.longterm.shortLabel' } }; diff --git a/module/helpers/handlebarsHelper.mjs b/module/helpers/handlebarsHelper.mjs index d6e8417e..7f30d970 100644 --- a/module/helpers/handlebarsHelper.mjs +++ b/module/helpers/handlebarsHelper.mjs @@ -16,8 +16,7 @@ export default class RegisterHandlebarsHelpers { empty: this.empty, pluralize: this.pluralize, positive: this.positive, - isNullish: this.isNullish, - debug: this.debug + isNullish: this.isNullish }); } static add(a, b) { @@ -93,8 +92,4 @@ export default class RegisterHandlebarsHelpers { static isNullish(a) { return a === null || a === undefined; } - - static debug(a) { - return a; - } } diff --git a/templates/ui/countdowns/countdowns-view.hbs b/templates/ui/countdowns/countdowns-view.hbs index 8bfa3fd5..fbd61d31 100644 --- a/templates/ui/countdowns/countdowns-view.hbs +++ b/templates/ui/countdowns/countdowns-view.hbs @@ -4,7 +4,7 @@ {{localize "DAGGERHEART.UI.Countdowns.title"}}
{{#each typeToggles as |type|}} - {{type.label}} + {{localize type.label}} {{/each}}
{{#if isGM}}