diff --git a/apps/client/src/widgets/type_widgets/options/i18n.tsx b/apps/client/src/widgets/type_widgets/options/i18n.tsx
index c39677919..03a8f74ba 100644
--- a/apps/client/src/widgets/type_widgets/options/i18n.tsx
+++ b/apps/client/src/widgets/type_widgets/options/i18n.tsx
@@ -4,29 +4,46 @@ import FormSelect from "../../react/FormSelect";
import OptionsRow from "./components/OptionsRow";
import OptionsSection from "./components/OptionsSection";
import { useTriliumOption } from "../../react/hooks";
+import type { Locale } from "@triliumnext/commons";
+import { isElectron } from "../../../services/utils";
export default function InternationalizationOptions() {
return (
-
+ <>
-
+ >
)
}
function LocalizationOptions() {
- const locales = useMemo(() =>
- getAvailableLocales().filter(locale => !locale.contentOnly)
- , []);
+ const { uiLocales, formattingLocales: contentLocales } = useMemo(() => {
+ const allLocales = getAvailableLocales();
+ return {
+ uiLocales: allLocales.filter(locale => !locale.contentOnly),
+ formattingLocales: allLocales.filter(locale => locale.electronLocale),
+ }
+ }, []);
const [ locale, setLocale ] = useTriliumOption("locale");
+ const [ formattingLocale, setFormattingLocale ] = useTriliumOption("formattingLocale");
return (
-
-
-
+
+
+
+
+
+ {isElectron() &&
+
+ }
+
)
+}
+
+function LocaleSelector({ locales, currentValue, onChange }: { locales: Locale[], currentValue: string, onChange: (newLocale: string) => void }) {
+ return ;
}
\ No newline at end of file
diff --git a/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts b/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts
index f04a0c11d..3b1c1f9dd 100644
--- a/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts
+++ b/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts
@@ -7,11 +7,6 @@ import type { OptionMap, Locale } from "@triliumnext/commons";
const TPL = /*html*/`
-
-
-
-
-
@@ -116,12 +111,6 @@ export default class LocalizationOptions extends OptionsWidget {
this.$minDaysRow = this.$widget.find(".min-days-row");
- this.$formattingLocaleSelect = this.$widget.find(".formatting-locale-select");
- this.$formattingLocaleSelect.on("change", async () => {
- const newLocale = this.$formattingLocaleSelect.val();
- await server.put(`options/formattingLocale/${newLocale}`);
- });
-
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());
this.updateOption("firstDayOfWeek", firstDayOfWeek);