refactor(translations): cleanup and fix import settings text

This commit is contained in:
David Ralph
2021-09-17 14:13:31 +01:00
parent 42b4aa1d62
commit 0fd50e949c
28 changed files with 386 additions and 413 deletions

View File

@@ -29,14 +29,13 @@ export function exportSettings() {
}
export function importSettings(e) {
const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text);
const languagecode = variables.languagecode;
const getMessage = (languagecode, text) => variables.language.getMessage(variables.languagecode, text);
const content = JSON.parse(e.target.result);
Object.keys(content).forEach((key) => {
localStorage.setItem(key, content[key]);
});
toast(getMessage(languagecode, 'toats.imported'));
toast(getMessage('toasts.imported'));
window.stats.postEvent('tab', 'Settings imported');
}