Skip to content

Commit 0cf7e85

Browse files
authored
chore(docs): include comments about dynamic locale in TS (#825)
1 parent 3b57c00 commit 0cf7e85

File tree

1 file changed

+3
-0
lines changed
  • examples/01-basic/10-localization

1 file changed

+3
-0
lines changed

examples/01-basic/10-localization/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ import "@blocknote/core/fonts/inter.css";
33
import { BlockNoteView } from "@blocknote/mantine";
44
import "@blocknote/mantine/style.css";
55
import { useCreateBlockNote } from "@blocknote/react";
6+
// import { useTranslation } from "some-i18n-library"; // You can use any i18n library you like
67

78
export 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.

0 commit comments

Comments
 (0)