diff --git a/langs/en-ca.json b/langs/en-ca.json index 14b5d33..07af704 100644 --- a/langs/en-ca.json +++ b/langs/en-ca.json @@ -36,9 +36,31 @@ "Key": "Key", "Value": "Value", "no-data-submitted": "No data submitted", - "data-query-notif-header": "Data Query Notification" + "data-query-notif-header": "Data Query Notification", + "cancel": "Cancel", + "confirm-and-close": "Confirm and Close", + "save-and-close": "Save and Close", + "delete": "Delete", + "resizable": "Resizable", + "not-resizable": "Not Resizable" }, "Apps": { + "Ask": { + "title": "Questions", + "invalid-input-type": "Invalid input type provided: {type}" + }, + "AttributeManager": { + "title": "Attributes: {name}", + "has-max": "Has Maximum?", + "name-placeholder": "Attribute Name...", + "no-attributes": "No attributes yet", + "add-new-attribute": "Add New Attribute" + }, + "PlayerSheet": { + "manage-attributes": "Manage Attributes", + "current-value": "Current value", + "max-value": "Maximum value" + }, "QueryStatus": { "title": "Information Request Status", "user-disconnected-tooltip": "This user is not logged in to Foundry", @@ -55,7 +77,8 @@ "label": "Height" }, "Resizable": { - "label": "Resizable" + "label": "Resizable", + "placeholder": "Default ({placeholder})" }, "tabs": { "foundry": "Foundry", diff --git a/module/apps/Ask.mjs b/module/apps/Ask.mjs index e6d3ce4..1ad0c64 100644 --- a/module/apps/Ask.mjs +++ b/module/apps/Ask.mjs @@ -1,4 +1,5 @@ import { __ID__, filePath } from "../consts.mjs"; +import { localizer } from "../utils/localizer.mjs"; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -24,7 +25,7 @@ export class Ask extends HandlebarsApplicationMixin(ApplicationV2) { width: 330, }, window: { - title: `Questions`, + title: `taf.Apps.Ask.title`, resizable: true, minimizable: true, contentTag: `form`, @@ -80,7 +81,10 @@ export class Ask extends HandlebarsApplicationMixin(ApplicationV2) { for (const input of inputs) { if (!validInputTypes.includes(input.type)) { - input.details = `Invalid input type provided: ${input.type}`; + input.details = localizer( + `taf.Apps.Ask.invalid-input-type`, + { type: input.type }, + ); input.type = `error`; }; }; diff --git a/module/apps/AttributeManager.mjs b/module/apps/AttributeManager.mjs index c81bb1a..5e92b25 100644 --- a/module/apps/AttributeManager.mjs +++ b/module/apps/AttributeManager.mjs @@ -1,5 +1,6 @@ import { __ID__, filePath } from "../consts.mjs"; import { attributeSorter } from "../utils/attributeSort.mjs"; +import { localizer } from "../utils/localizer.mjs"; import { toID } from "../utils/toID.mjs"; const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api; @@ -52,7 +53,10 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) }; get title() { - return `Attributes: ${this.#doc.name}`; + return localizer( + `taf.Apps.AttributeManager.title`, + this.#doc, + ); }; // #endregion Instance Data @@ -102,7 +106,6 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) attrs.push({ id, name: data.name, - displayName: data.isNew ? `New Attribute` : data.name, sort: data.sort, isRange: data.isRange, isNew: data.isNew ?? false, diff --git a/module/apps/PlayerSheet.mjs b/module/apps/PlayerSheet.mjs index 864d11f..d38ec38 100644 --- a/module/apps/PlayerSheet.mjs +++ b/module/apps/PlayerSheet.mjs @@ -82,7 +82,7 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) { controls.push({ icon: `fa-solid fa-at`, - label: `Manage Attributes`, + label: `taf.Apps.PlayerSheet.manage-attributes`, action: `manageAttributes`, visible: () => { const isGM = game.user.isGM; @@ -167,7 +167,6 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) { event.stopPropagation(); if ( event.detail > 1 ) { return } - // const docSheetConfigWidth = TAFDocumentSheetConfig.DEFAULT_OPTIONS.position.width; new TAFDocumentSheetConfig({ document: this.document, position: { diff --git a/module/apps/TAFDocumentSheetConfig.mjs b/module/apps/TAFDocumentSheetConfig.mjs index 760e462..c35b8f6 100644 --- a/module/apps/TAFDocumentSheetConfig.mjs +++ b/module/apps/TAFDocumentSheetConfig.mjs @@ -1,5 +1,6 @@ import { __ID__, filePath } from "../consts.mjs"; import { getDefaultSizing } from "../utils/getSizing.mjs"; +import { localizer } from "../utils/localizer.mjs"; const { diffObject, expandObject, flattenObject } = foundry.utils; const { DocumentSheetConfig } = foundry.applications.apps; @@ -74,7 +75,9 @@ export class TAFDocumentSheetConfig extends DocumentSheetConfig { const defaults = getDefaultSizing(); context.placeholders = { ...defaults, - resizable: defaults.resizable ? `Resizable` : `Not Resizable`, + resizable: defaults.resizable + ? localizer(`taf.misc.resizable`) + : localizer(`taf.misc.not-resizable`), }; // Custom values from document itself @@ -88,9 +91,15 @@ export class TAFDocumentSheetConfig extends DocumentSheetConfig { // Static prep context.resizeOptions = [ - { label: `Default (${context.placeholders.resizable})`, value: `` }, - { label: `Resizable`, value: `true` }, - { label: `No Resizing`, value: `false` }, + { + label: localizer( + `taf.Apps.TAFDocumentSheetConfig.Resizable.placeholder`, + { placeholder: context.placeholders.resizable }, + ), + value: ``, + }, + { label: localizer(`taf.misc.resizable`), value: `true` }, + { label: localizer(`taf.misc.not-resizable`), value: `false` }, ]; }; // #endregion Data Prep diff --git a/module/sockets/query/cancel.mjs b/module/sockets/query/cancel.mjs index f8eeddc..022342e 100644 --- a/module/sockets/query/cancel.mjs +++ b/module/sockets/query/cancel.mjs @@ -1,4 +1,4 @@ -import { DialogManager } from "../../utils/DialogManager.mjs"; +import { close } from "../../utils/DialogManager.mjs"; import { localizer } from "../../utils/localizer.mjs"; export async function queryCancel(payload) { @@ -15,5 +15,5 @@ export async function queryCancel(payload) { return; }; - await DialogManager.close(id); + close(id); }; diff --git a/module/sockets/query/prompt.mjs b/module/sockets/query/prompt.mjs index 8b1700f..9163219 100644 --- a/module/sockets/query/prompt.mjs +++ b/module/sockets/query/prompt.mjs @@ -1,4 +1,4 @@ -import { DialogManager } from "../../utils/DialogManager.mjs"; +import { ask } from "../../utils/DialogManager.mjs"; import { localizer } from "../../utils/localizer.mjs"; import { respondedToQueries } from "../../utils/QueryManager.mjs"; @@ -36,7 +36,7 @@ export async function queryPrompt(payload) { if (users != null && !users.includes(game.user.id)) { return }; request.id = id; - const result = await DialogManager.ask(request, config); + const result = await ask(request, config); if (result.state === `fronted`) { return; } else if (result.state === `errored`) { diff --git a/templates/Ask/controls.hbs b/templates/Ask/controls.hbs index a619549..f354689 100644 --- a/templates/Ask/controls.hbs +++ b/templates/Ask/controls.hbs @@ -3,11 +3,11 @@ type="button" data-action="cancel" > - Cancel + {{localize "taf.misc.cancel"}} diff --git a/templates/AttributeManager/attribute-list.hbs b/templates/AttributeManager/attribute-list.hbs index 5899acb..b6ea745 100644 --- a/templates/AttributeManager/attribute-list.hbs +++ b/templates/AttributeManager/attribute-list.hbs @@ -15,13 +15,13 @@ type="text" data-bind="{{ attr.id }}.name" value="{{ attr.name }}" - placeholder="Attribute Name..." + placeholder="{{localize "taf.Apps.AttributeManager.name-placeholder"}}" > {{else}} {{ attr.name }} {{/if}}