TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.9k stars 384 forks source link

chore(docs): include comments about dynamic locales in TS #825

Closed zaaakher closed 3 weeks ago

zaaakher commented 3 weeks ago

I couldn't figure out how to add additional text under the preview block so I just added comments to the actual preview block.

The comments I added simply show how to use dynamic language in TS with

 dictionary: locales[lang as keyof typeof locales]
vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jun 13, 2024 0:25am
blocknote-website ✅ Ready (Inspect) Visit Preview Jun 13, 2024 0:25am
vercel[bot] commented 3 weeks ago

@zaaakher is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

YousefED commented 3 weeks ago

Nice. Might also be nice to for example select a different locale from a dropdown. Do you think that would have helped you, or was your issue specifically about integrating an i18n lib?

zaaakher commented 3 weeks ago

It worked for me from the first try honestly. But Typescript kept screaming at me for using lang as an index of locales and I had to ask AI for help 😅. lang as keyof typeof locales is the part I got stuck with and figured maybe we should update the docs to include that scenario

I consider myself a beginner in Typescript though