Localize everything that isn't already localized #27
12 changed files with 67 additions and 27 deletions
|
|
@ -36,9 +36,31 @@
|
||||||
"Key": "Key",
|
"Key": "Key",
|
||||||
"Value": "Value",
|
"Value": "Value",
|
||||||
"no-data-submitted": "No data submitted",
|
"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": {
|
"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": {
|
"QueryStatus": {
|
||||||
"title": "Information Request Status",
|
"title": "Information Request Status",
|
||||||
"user-disconnected-tooltip": "This user is not logged in to Foundry",
|
"user-disconnected-tooltip": "This user is not logged in to Foundry",
|
||||||
|
|
@ -55,7 +77,8 @@
|
||||||
"label": "Height"
|
"label": "Height"
|
||||||
},
|
},
|
||||||
"Resizable": {
|
"Resizable": {
|
||||||
"label": "Resizable"
|
"label": "Resizable",
|
||||||
|
"placeholder": "Default ({placeholder})"
|
||||||
},
|
},
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"foundry": "Foundry",
|
"foundry": "Foundry",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { __ID__, filePath } from "../consts.mjs";
|
import { __ID__, filePath } from "../consts.mjs";
|
||||||
|
import { localizer } from "../utils/localizer.mjs";
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
|
|
@ -24,7 +25,7 @@ export class Ask extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
width: 330,
|
width: 330,
|
||||||
},
|
},
|
||||||
window: {
|
window: {
|
||||||
title: `Questions`,
|
title: `taf.Apps.Ask.title`,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
minimizable: true,
|
minimizable: true,
|
||||||
contentTag: `form`,
|
contentTag: `form`,
|
||||||
|
|
@ -80,7 +81,10 @@ export class Ask extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
|
|
||||||
for (const input of inputs) {
|
for (const input of inputs) {
|
||||||
if (!validInputTypes.includes(input.type)) {
|
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`;
|
input.type = `error`;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { __ID__, filePath } from "../consts.mjs";
|
import { __ID__, filePath } from "../consts.mjs";
|
||||||
import { attributeSorter } from "../utils/attributeSort.mjs";
|
import { attributeSorter } from "../utils/attributeSort.mjs";
|
||||||
|
import { localizer } from "../utils/localizer.mjs";
|
||||||
import { toID } from "../utils/toID.mjs";
|
import { toID } from "../utils/toID.mjs";
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
@ -52,7 +53,10 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
||||||
};
|
};
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
return `Attributes: ${this.#doc.name}`;
|
return localizer(
|
||||||
|
`taf.Apps.AttributeManager.title`,
|
||||||
|
this.#doc,
|
||||||
|
);
|
||||||
};
|
};
|
||||||
// #endregion Instance Data
|
// #endregion Instance Data
|
||||||
|
|
||||||
|
|
@ -102,7 +106,6 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2)
|
||||||
attrs.push({
|
attrs.push({
|
||||||
id,
|
id,
|
||||||
name: data.name,
|
name: data.name,
|
||||||
displayName: data.isNew ? `New Attribute` : data.name,
|
|
||||||
sort: data.sort,
|
sort: data.sort,
|
||||||
isRange: data.isRange,
|
isRange: data.isRange,
|
||||||
isNew: data.isNew ?? false,
|
isNew: data.isNew ?? false,
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
|
|
||||||
controls.push({
|
controls.push({
|
||||||
icon: `fa-solid fa-at`,
|
icon: `fa-solid fa-at`,
|
||||||
label: `Manage Attributes`,
|
label: `taf.Apps.PlayerSheet.manage-attributes`,
|
||||||
action: `manageAttributes`,
|
action: `manageAttributes`,
|
||||||
visible: () => {
|
visible: () => {
|
||||||
const isGM = game.user.isGM;
|
const isGM = game.user.isGM;
|
||||||
|
|
@ -167,7 +167,6 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
if ( event.detail > 1 ) { return }
|
if ( event.detail > 1 ) { return }
|
||||||
|
|
||||||
// const docSheetConfigWidth = TAFDocumentSheetConfig.DEFAULT_OPTIONS.position.width;
|
|
||||||
new TAFDocumentSheetConfig({
|
new TAFDocumentSheetConfig({
|
||||||
document: this.document,
|
document: this.document,
|
||||||
position: {
|
position: {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { __ID__, filePath } from "../consts.mjs";
|
import { __ID__, filePath } from "../consts.mjs";
|
||||||
import { getDefaultSizing } from "../utils/getSizing.mjs";
|
import { getDefaultSizing } from "../utils/getSizing.mjs";
|
||||||
|
import { localizer } from "../utils/localizer.mjs";
|
||||||
|
|
||||||
const { diffObject, expandObject, flattenObject } = foundry.utils;
|
const { diffObject, expandObject, flattenObject } = foundry.utils;
|
||||||
const { DocumentSheetConfig } = foundry.applications.apps;
|
const { DocumentSheetConfig } = foundry.applications.apps;
|
||||||
|
|
@ -74,7 +75,9 @@ export class TAFDocumentSheetConfig extends DocumentSheetConfig {
|
||||||
const defaults = getDefaultSizing();
|
const defaults = getDefaultSizing();
|
||||||
context.placeholders = {
|
context.placeholders = {
|
||||||
...defaults,
|
...defaults,
|
||||||
resizable: defaults.resizable ? `Resizable` : `Not Resizable`,
|
resizable: defaults.resizable
|
||||||
|
? localizer(`taf.misc.resizable`)
|
||||||
|
: localizer(`taf.misc.not-resizable`),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Custom values from document itself
|
// Custom values from document itself
|
||||||
|
|
@ -88,9 +91,15 @@ export class TAFDocumentSheetConfig extends DocumentSheetConfig {
|
||||||
|
|
||||||
// Static prep
|
// Static prep
|
||||||
context.resizeOptions = [
|
context.resizeOptions = [
|
||||||
{ label: `Default (${context.placeholders.resizable})`, value: `` },
|
{
|
||||||
{ label: `Resizable`, value: `true` },
|
label: localizer(
|
||||||
{ label: `No Resizing`, value: `false` },
|
`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
|
// #endregion Data Prep
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { DialogManager } from "../../utils/DialogManager.mjs";
|
import { close } from "../../utils/DialogManager.mjs";
|
||||||
import { localizer } from "../../utils/localizer.mjs";
|
import { localizer } from "../../utils/localizer.mjs";
|
||||||
|
|
||||||
export async function queryCancel(payload) {
|
export async function queryCancel(payload) {
|
||||||
|
|
@ -15,5 +15,5 @@ export async function queryCancel(payload) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
await DialogManager.close(id);
|
close(id);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { DialogManager } from "../../utils/DialogManager.mjs";
|
import { ask } from "../../utils/DialogManager.mjs";
|
||||||
import { localizer } from "../../utils/localizer.mjs";
|
import { localizer } from "../../utils/localizer.mjs";
|
||||||
import { respondedToQueries } from "../../utils/QueryManager.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 };
|
if (users != null && !users.includes(game.user.id)) { return };
|
||||||
|
|
||||||
request.id = id;
|
request.id = id;
|
||||||
const result = await DialogManager.ask(request, config);
|
const result = await ask(request, config);
|
||||||
if (result.state === `fronted`) {
|
if (result.state === `fronted`) {
|
||||||
return;
|
return;
|
||||||
} else if (result.state === `errored`) {
|
} else if (result.state === `errored`) {
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
type="button"
|
type="button"
|
||||||
data-action="cancel"
|
data-action="cancel"
|
||||||
>
|
>
|
||||||
Cancel
|
{{localize "taf.misc.cancel"}}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
Confirm and Close
|
{{localize "taf.misc.confirm-and-close"}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@
|
||||||
type="text"
|
type="text"
|
||||||
data-bind="{{ attr.id }}.name"
|
data-bind="{{ attr.id }}.name"
|
||||||
value="{{ attr.name }}"
|
value="{{ attr.name }}"
|
||||||
placeholder="Attribute Name..."
|
placeholder="{{localize "taf.Apps.AttributeManager.name-placeholder"}}"
|
||||||
>
|
>
|
||||||
{{else}}
|
{{else}}
|
||||||
<span>{{ attr.name }}</span>
|
<span>{{ attr.name }}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<label>
|
<label>
|
||||||
Has Maximum?
|
{{localize "taf.Apps.AttributeManager.has-max"}}
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
data-bind="{{ attr.id }}.isRange"
|
data-bind="{{ attr.id }}.isRange"
|
||||||
|
|
@ -32,10 +32,12 @@
|
||||||
type="button"
|
type="button"
|
||||||
data-action="removeAttribute"
|
data-action="removeAttribute"
|
||||||
>
|
>
|
||||||
Delete
|
{{localize "taf.misc.delete"}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p>No attributes yet</p>
|
<p>
|
||||||
|
{{localize "taf.Apps.AttributeManager.no-attributes"}}
|
||||||
|
</p>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
type="button"
|
type="button"
|
||||||
data-action="addNew"
|
data-action="addNew"
|
||||||
>
|
>
|
||||||
Add New Attribute
|
{{localize "taf.Apps.AttributeManager.add-new-attribute"}}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
Save and Close
|
{{localize "taf.misc.save-and-close"}}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
class="attr-range__value"
|
class="attr-range__value"
|
||||||
name="{{attr.path}}.value"
|
name="{{attr.path}}.value"
|
||||||
value="{{attr.value}}"
|
value="{{attr.value}}"
|
||||||
aria-label="Current value"
|
aria-label="{{localize "taf.Apps.PlayerSheet.current-value"}}"
|
||||||
data-tooltip="@{{ attr.id }}{{#if attr.isRange}}.value{{/if}}"
|
data-tooltip="@{{ attr.id }}{{#if attr.isRange}}.value{{/if}}"
|
||||||
>
|
>
|
||||||
{{#if attr.isRange}}
|
{{#if attr.isRange}}
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
class="attr-range__max"
|
class="attr-range__max"
|
||||||
name="{{attr.path}}.max"
|
name="{{attr.path}}.max"
|
||||||
value="{{attr.max}}"
|
value="{{attr.max}}"
|
||||||
aria-label="Maximum value"
|
aria-label="{{localize "taf.Apps.PlayerSheet.max-value"}}"
|
||||||
data-tooltip="@{{ attr.id }}.max"
|
data-tooltip="@{{ attr.id }}.max"
|
||||||
>
|
>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@
|
||||||
name="name"
|
name="name"
|
||||||
class="large"
|
class="large"
|
||||||
value="{{actor.name}}"
|
value="{{actor.name}}"
|
||||||
placeholder="{{ localize 'Name' }}"
|
placeholder="{{ localize "Name" }}"
|
||||||
/>
|
/>
|
||||||
</header>
|
</header>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue