mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 23:05:23 +01:00
[i18n] Replace hardcoded messages for Data import (#6795)
* localize confirm import message * localize error messages
This commit is contained in:
parent
c945a1b3f9
commit
4522e9e593
@ -1446,18 +1446,10 @@ export class GameData {
|
|||||||
globalScene.ui.showText(error, null, () => globalScene.ui.showText("", 0), fixedInt(1500));
|
globalScene.ui.showText(error, null, () => globalScene.ui.showText("", 0), fixedInt(1500));
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return globalScene.ui.showText(
|
return displayError(i18next.t("menuUiHandler:importCorrupt", { dataName }));
|
||||||
`Your ${dataName} data could not be loaded. It may be corrupted.`,
|
|
||||||
null,
|
|
||||||
() => globalScene.ui.showText("", 0),
|
|
||||||
fixedInt(1500),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(i18next.t("menuUiHandler:confirmImport", { dataName }), null, () => {
|
||||||
`Your ${dataName} data will be overridden and the page will reload. Proceed?`,
|
|
||||||
null,
|
|
||||||
() => {
|
|
||||||
globalScene.ui.setOverlayMode(
|
globalScene.ui.setOverlayMode(
|
||||||
UiMode.CONFIRM,
|
UiMode.CONFIRM,
|
||||||
() => {
|
() => {
|
||||||
@ -1466,9 +1458,7 @@ export class GameData {
|
|||||||
if (!bypassLogin && dataType < GameDataType.SETTINGS) {
|
if (!bypassLogin && dataType < GameDataType.SETTINGS) {
|
||||||
updateUserInfo().then(success => {
|
updateUserInfo().then(success => {
|
||||||
if (!success[0]) {
|
if (!success[0]) {
|
||||||
return displayError(
|
return displayError(i18next.t("menuUiHandler:importNoServer", { dataName }));
|
||||||
`Could not contact the server. Your ${dataName} data could not be imported.`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
const { trainerId, secretId } = this;
|
const { trainerId, secretId } = this;
|
||||||
let updatePromise: Promise<string | null>;
|
let updatePromise: Promise<string | null>;
|
||||||
@ -1491,9 +1481,7 @@ export class GameData {
|
|||||||
updatePromise.then(error => {
|
updatePromise.then(error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return displayError(
|
return displayError(i18next.t("menuUiHandler:importError", { dataName }));
|
||||||
`An error occurred while updating ${dataName} data. Please contact the administrator.`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
@ -1509,8 +1497,7 @@ export class GameData {
|
|||||||
false,
|
false,
|
||||||
-98,
|
-98,
|
||||||
);
|
);
|
||||||
},
|
});
|
||||||
);
|
|
||||||
};
|
};
|
||||||
})((e.target as any).files[0]);
|
})((e.target as any).files[0]);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user