Merge pull request 'Localize everything that isn't already localized' (#27) from feature/localizations into main
Reviewed-on: #27
This commit is contained in:
commit
a3baa53bdd
12 changed files with 67 additions and 27 deletions
|
|
@ -40,9 +40,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",
|
||||
|
|
@ -59,7 +81,8 @@
|
|||
"label": "Height"
|
||||
},
|
||||
"Resizable": {
|
||||
"label": "Resizable"
|
||||
"label": "Resizable",
|
||||
"placeholder": "Default ({placeholder})"
|
||||
},
|
||||
"tabs": {
|
||||
"foundry": "Foundry",
|
||||
|
|
|
|||
|
|
@ -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`;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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`) {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
type="button"
|
||||
data-action="cancel"
|
||||
>
|
||||
Cancel
|
||||
{{localize "taf.misc.cancel"}}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
>
|
||||
Confirm and Close
|
||||
{{localize "taf.misc.confirm-and-close"}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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}}
|
||||
<span>{{ attr.name }}</span>
|
||||
{{/if}}
|
||||
<label>
|
||||
Has Maximum?
|
||||
{{localize "taf.Apps.AttributeManager.has-max"}}
|
||||
<input
|
||||
type="checkbox"
|
||||
data-bind="{{ attr.id }}.isRange"
|
||||
|
|
@ -32,10 +32,12 @@
|
|||
type="button"
|
||||
data-action="removeAttribute"
|
||||
>
|
||||
Delete
|
||||
{{localize "taf.misc.delete"}}
|
||||
</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<p>No attributes yet</p>
|
||||
<p>
|
||||
{{localize "taf.Apps.AttributeManager.no-attributes"}}
|
||||
</p>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
type="button"
|
||||
data-action="addNew"
|
||||
>
|
||||
Add New Attribute
|
||||
{{localize "taf.Apps.AttributeManager.add-new-attribute"}}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
>
|
||||
Save and Close
|
||||
{{localize "taf.misc.save-and-close"}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
class="attr-range__value"
|
||||
name="{{attr.path}}.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}}"
|
||||
>
|
||||
{{#if attr.isRange}}
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
class="attr-range__max"
|
||||
name="{{attr.path}}.max"
|
||||
value="{{attr.max}}"
|
||||
aria-label="Maximum value"
|
||||
aria-label="{{localize "taf.Apps.PlayerSheet.max-value"}}"
|
||||
data-tooltip="@{{ attr.id }}.max"
|
||||
>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@
|
|||
name="name"
|
||||
class="large"
|
||||
value="{{actor.name}}"
|
||||
placeholder="{{ localize 'Name' }}"
|
||||
placeholder="{{ localize "Name" }}"
|
||||
/>
|
||||
</header>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue