Add localization for a bunch of stuff that I initially missed
This commit is contained in:
parent
6997c736dc
commit
cab29d9cd6
8 changed files with 43 additions and 27 deletions
|
|
@ -1,16 +1,17 @@
|
|||
import { DialogManager } from "../../utils/DialogManager.mjs";
|
||||
import { localizer } from "../../utils/localizer.mjs";
|
||||
|
||||
export async function queryCancel(payload) {
|
||||
const { id } = payload;
|
||||
|
||||
if (!id) {
|
||||
ui.notifications.error(game.i18n.format(
|
||||
ui.notifications.error(localizer(
|
||||
`taf.notifs.error.malformed-socket-payload`,
|
||||
{
|
||||
event: `query.cancel`,
|
||||
details: `A request ID must be provided`,
|
||||
}),
|
||||
);
|
||||
details: `taf.notifs.error.missing-id`,
|
||||
},
|
||||
));
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { localizer } from "../../utils/localizer.mjs";
|
||||
import { respondedToQueries } from "../../utils/QueryManager.mjs";
|
||||
|
||||
export function queryNotify(payload) {
|
||||
|
|
@ -14,7 +15,7 @@ export function queryNotify(payload) {
|
|||
};
|
||||
|
||||
ChatMessage.implementation.create({
|
||||
flavor: `Data Query Notification`,
|
||||
flavor: localizer(`taf.misc.data-query-notif-header`),
|
||||
content,
|
||||
whisper,
|
||||
style: CONST.CHAT_MESSAGE_STYLES.OOC,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { DialogManager } from "../../utils/DialogManager.mjs";
|
||||
import { localizer } from "../../utils/localizer.mjs";
|
||||
import { respondedToQueries } from "../../utils/QueryManager.mjs";
|
||||
|
||||
export async function queryPrompt(payload) {
|
||||
|
|
@ -10,25 +11,25 @@ export async function queryPrompt(payload) {
|
|||
} = payload;
|
||||
|
||||
if (!id) {
|
||||
ui.notifications.error(game.i18n.format(
|
||||
ui.notifications.error(localizer(
|
||||
`taf.notifs.error.malformed-socket-payload`,
|
||||
{
|
||||
event: `query.prompt`,
|
||||
details: `A request ID must be provided`,
|
||||
}),
|
||||
);
|
||||
event: `query.cancel`,
|
||||
details: `taf.notifs.error.missing-id`,
|
||||
},
|
||||
));
|
||||
return;
|
||||
};
|
||||
|
||||
// null/undefined is a special case for "all users but me" by default
|
||||
if (users != null && !Array.isArray(users)) {
|
||||
ui.notifications.error(game.i18n.format(
|
||||
ui.notifications.error(localizer(
|
||||
`taf.notifs.error.malformed-socket-payload`,
|
||||
{
|
||||
event: `query.prompt`,
|
||||
details: `A list of users must be provided`,
|
||||
}),
|
||||
);
|
||||
event: `query.cancel`,
|
||||
details: `taf.sockets.user-list-required`,
|
||||
},
|
||||
));
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { addResponse, has as hasQuery } from "../../utils/QueryManager.mjs";
|
||||
import { localizer } from "../../utils/localizer.mjs";
|
||||
|
||||
export function querySubmit(payload, user) {
|
||||
const {
|
||||
|
|
@ -7,13 +8,13 @@ export function querySubmit(payload, user) {
|
|||
} = payload;
|
||||
|
||||
if (!id) {
|
||||
ui.notifications.error(game.i18n.format(
|
||||
ui.notifications.error(localizer(
|
||||
`taf.notifs.error.malformed-socket-payload`,
|
||||
{
|
||||
event: `query.submit`,
|
||||
details: `A request ID must be provided`,
|
||||
}),
|
||||
);
|
||||
event: `query.cancel`,
|
||||
details: `taf.notifs.error.missing-id`,
|
||||
},
|
||||
));
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue