mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-22 23:10:58 +01:00
Localize drive error message
This commit is contained in:
parent
735a8271b6
commit
67c4eb95c8
3 changed files with 11 additions and 3 deletions
|
@ -59,7 +59,7 @@
|
|||
driveLoading.set(false);
|
||||
driveError.set(true);
|
||||
synced.set(true);
|
||||
pushToast('Drive sync not available right now 😔', 'error');
|
||||
pushToast($t('common.driveError'), 'error');
|
||||
}
|
||||
|
||||
function handleClientLoad() {
|
||||
|
@ -224,7 +224,7 @@
|
|||
);
|
||||
} else {
|
||||
synced.set(true);
|
||||
pushToast('Data has been synced!');
|
||||
pushToast($t('common.dataSynced'));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
|
|
@ -879,5 +879,9 @@
|
|||
},
|
||||
"radiantSpincrystal": {
|
||||
"title": "Radiant Spincrystals"
|
||||
},
|
||||
"common": {
|
||||
"dataSynced": "Data has been synced!",
|
||||
"driveError": "Drive sync not available right now 😔"
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ import dayjs from 'dayjs';
|
|||
import { writable } from 'svelte/store';
|
||||
import debounce from 'lodash/debounce';
|
||||
import localforage from 'localforage';
|
||||
import { t as $t } from 'svelte-i18n';
|
||||
|
||||
import { synced, saveId, localModified, lastSyncTime, driveSignedIn } from './dataSync';
|
||||
import { pushToast } from './toast';
|
||||
|
@ -12,6 +13,9 @@ export const fromRemote = writable(false);
|
|||
export const UPDATE_TIME_KEY = 'update-time';
|
||||
export const CONVERTED_KEY = 'converted';
|
||||
|
||||
let t;
|
||||
$t.subscribe((f) => (t = f));
|
||||
|
||||
let saveFileId = '';
|
||||
let signedIn = false;
|
||||
|
||||
|
@ -43,7 +47,7 @@ async function saveData(data) {
|
|||
synced.set(true);
|
||||
localModified.set(false);
|
||||
|
||||
pushToast('Data has been synced!');
|
||||
pushToast(t('common.dataSynced'));
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
pushToast('Error when uploading your data!', 'error');
|
||||
|
|
Loading…
Reference in a new issue