File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
examples/01-basic/10-localization Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,17 @@ import "@blocknote/core/fonts/inter.css";
33import { BlockNoteView } from "@blocknote/mantine" ;
44import "@blocknote/mantine/style.css" ;
55import { useCreateBlockNote } from "@blocknote/react" ;
6+ // import { useTranslation } from "some-i18n-library"; // You can use any i18n library you like
67
78export default function App ( ) {
9+ // const { lang } = useTranslation('common'); // You can get the current language from the i18n library or alternatively from a router
810 // Creates a new editor instance.
911 const editor = useCreateBlockNote ( {
1012 // Passes the Dutch (NL) dictionary to the editor instance.
1113 // You can also provide your own dictionary here to customize the strings used in the editor,
1214 // or submit a Pull Request to add support for your language of your choice
1315 dictionary : locales . nl ,
16+ // dictionary: locales[lang as keyof typeof locales], // Use the language from the i18n library dynamically
1417 } ) ;
1518
1619 // Renders the editor instance using a React component.
You can’t perform that action at this time.
0 commit comments