feat(settings/i18n): dedicated restart button

This commit is contained in:
Elian Doran 2025-03-25 21:48:02 +02:00
parent e408cc5b10
commit 03fd34eeb0
No known key found for this signature in database
2 changed files with 10 additions and 3 deletions

View File

@ -34,6 +34,10 @@ const TPL = `
</label> </label>
</div> </div>
</div> </div>
<div class="option-row centered">
<button class="btn btn-secondary btn-micro restart-app-button">${t("electron_integration.restart-app-button")}</button>
</div>
</div> </div>
<style> <style>
@ -56,6 +60,10 @@ const TPL = `
.locale-options-container .option-row:last-of-type { .locale-options-container .option-row:last-of-type {
border-bottom: unset; border-bottom: unset;
} }
.locale-options-container .option-row.centered {
justify-content: center;
}
</style> </style>
</div> </div>
`; `;
@ -72,20 +80,19 @@ export default class LocalizationOptions extends OptionsWidget {
this.$localeSelect.on("change", async () => { this.$localeSelect.on("change", async () => {
const newLocale = this.$localeSelect.val(); const newLocale = this.$localeSelect.val();
await server.put(`options/locale/${newLocale}`); await server.put(`options/locale/${newLocale}`);
utils.reloadFrontendApp("locale change");
}); });
this.$formattingLocaleSelect = this.$widget.find(".formatting-locale-select"); this.$formattingLocaleSelect = this.$widget.find(".formatting-locale-select");
this.$formattingLocaleSelect.on("change", async () => { this.$formattingLocaleSelect.on("change", async () => {
const newLocale = this.$formattingLocaleSelect.val(); const newLocale = this.$formattingLocaleSelect.val();
await server.put(`options/formattingLocale/${newLocale}`); await server.put(`options/formattingLocale/${newLocale}`);
utils.restartDesktopApp();
}); });
this.$widget.find(`input[name="first-day-of-week"]`).on("change", () => { this.$widget.find(`input[name="first-day-of-week"]`).on("change", () => {
const firstDayOfWeek = String(this.$widget.find(`input[name="first-day-of-week"]:checked`).val()); const firstDayOfWeek = String(this.$widget.find(`input[name="first-day-of-week"]:checked`).val());
this.updateOption("firstDayOfWeek", firstDayOfWeek); this.updateOption("firstDayOfWeek", firstDayOfWeek);
}); });
this.$widget.find(".restart-app-button").on("click", utils.restartDesktopApp);
} }
async optionsLoaded(options: OptionMap) { async optionsLoaded(options: OptionMap) {

View File

@ -1243,7 +1243,7 @@
"first-day-of-the-week": "First day of the week", "first-day-of-the-week": "First day of the week",
"sunday": "Sunday", "sunday": "Sunday",
"monday": "Monday", "monday": "Monday",
"formatting-locale": "Formats (date, numbers)" "formatting-locale": "Date & number format"
}, },
"backup": { "backup": {
"automatic_backup": "Automatic backup", "automatic_backup": "Automatic backup",