feat: support more langs

* add translations for French, Spanish, and Italian
* change the wording for better understanding of this feature:
    - "import" to "restore"
    - "export" to "backup"
* rename functions to reflect these changes
This commit is contained in:
tetuaoro 2024-07-10 11:55:36 +02:00 committed by pheiduck
parent e3ee09b755
commit ce20bb7fcb
6 changed files with 58 additions and 44 deletions

View file

@ -299,18 +299,21 @@ new Vue({
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
},
importConfig(e) {
restoreConfig(e) {
e.preventDefault();
const file = e.currentTarget.files.item(0);
file.text()
.then((content) => {
this.api.uploadConfiguration(content)
.then((_result) => alert('The configuration was updated.'))
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
})
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
if (file) {
file.text()
.then((content) => {
this.api.restoreConfiguration(content)
.then((_result) => alert('The configuration was updated.'))
.catch((err) => alert(err.message || err.toString()))
.finally(() => this.refresh().catch(console.error));
})
.catch((err) => alert(err.message || err.toString()));
} else {
alert('Failed to load your file!');
}
},
toggleTheme() {
const themes = ['light', 'dark', 'auto'];