diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index b6b8ae6281..4c3a555ef1 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1500,7 +1500,12 @@ "description": "These options apply only for desktop builds, browsers will use their own native spell check.", "enable": "Check spelling", "language_code_label": "Spell Check Languages", - "restart-required": "Changes to the spell check options will take effect after application restart." + "restart-required": "Changes to the spell check options will take effect after application restart.", + "custom_dictionary_title": "Custom Dictionary", + "custom_dictionary_description": "Words added to the dictionary are synced across all your devices.", + "custom_dictionary_edit": "Custom words", + "custom_dictionary_edit_description": "Edit the list of words that should not be flagged by the spell checker. Changes will be visible after a restart.", + "custom_dictionary_open": "Edit dictionary" }, "sync_2": { "config_title": "Sync Configuration", diff --git a/apps/client/src/widgets/type_widgets/options/spellcheck.tsx b/apps/client/src/widgets/type_widgets/options/spellcheck.tsx index 5949e820ce..df79f2402f 100644 --- a/apps/client/src/widgets/type_widgets/options/spellcheck.tsx +++ b/apps/client/src/widgets/type_widgets/options/spellcheck.tsx @@ -1,7 +1,9 @@ import { useCallback, useMemo } from "preact/hooks"; +import appContext from "../../../components/app_context"; import { t } from "../../../services/i18n"; import { dynamicRequire, isElectron } from "../../../services/utils"; +import Button from "../../react/Button"; import FormText from "../../react/FormText"; import FormToggle from "../../react/FormToggle"; import { useTriliumOption, useTriliumOptionBool } from "../../react/hooks"; @@ -25,19 +27,23 @@ function ElectronSpellcheckSettings() { const [ spellCheckEnabled, setSpellCheckEnabled ] = useTriliumOptionBool("spellCheckEnabled"); return ( - - {t("spellcheck.restart-required")} + <> + + {t("spellcheck.restart-required")} - - - + + + - {spellCheckEnabled && } - + {spellCheckEnabled && } + + + {spellCheckEnabled && } + ); } @@ -84,6 +90,27 @@ function SpellcheckLanguages() { ); } +function CustomDictionary() { + function openDictionary() { + appContext.triggerCommand("openInPopup", { noteIdOrPath: "_customDictionary" }); + } + + return ( + + {t("spellcheck.custom_dictionary_description")} + + +