diff --git a/apps/client/src/widgets/type_widgets/MindMap.tsx b/apps/client/src/widgets/type_widgets/MindMap.tsx index 715612947..b4ccdf371 100644 --- a/apps/client/src/widgets/type_widgets/MindMap.tsx +++ b/apps/client/src/widgets/type_widgets/MindMap.tsx @@ -136,7 +136,7 @@ function MindElixir({ containerRef: externalContainerRef, containerProps, apiRef const mind = new VanillaMindElixir({ el: containerRef.current, - locale: LOCALE_MAPPINGS[locale], + locale: LOCALE_MAPPINGS[locale as DISPLAYABLE_LOCALE_IDS] ?? undefined, editable }); diff --git a/apps/client/src/widgets/type_widgets/canvas/Canvas.tsx b/apps/client/src/widgets/type_widgets/canvas/Canvas.tsx index fb5cc1df5..6a5ea9377 100644 --- a/apps/client/src/widgets/type_widgets/canvas/Canvas.tsx +++ b/apps/client/src/widgets/type_widgets/canvas/Canvas.tsx @@ -10,6 +10,7 @@ import { NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/type import { goToLinkExt } from "../../../services/link"; import useCanvasPersistence from "./persistence"; import { LANGUAGE_MAPPINGS } from "./i18n"; +import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons"; // currently required by excalidraw, in order to allows self-hosting fonts locally. // this avoids making excalidraw load the fonts from an external CDN. @@ -60,7 +61,7 @@ export default function Canvas({ note, noteContext }: TypeWidgetProps) { detectScroll={false} handleKeyboardGlobally={false} autoFocus={false} - langCode={LANGUAGE_MAPPINGS[locale]} + langCode={LANGUAGE_MAPPINGS[locale as DISPLAYABLE_LOCALE_IDS] ?? undefined} UIOptions={{ canvasActions: { saveToActiveFile: false, diff --git a/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md b/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md index 2449b6c72..f420ff7ad 100644 --- a/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md +++ b/docs/Developer Guide/Developer Guide/Concepts/Internationalisation Translat.md @@ -15,7 +15,7 @@ One important aspect is the fact that we are using a key-based approach. This me The key-based approach allows a hierarchical structure. For example, a key of `about.title` would be added in `translation.json` as follows: -``` +```json { "about": { "title": "About Trilium Notes"