Skip to content

Conversation

Ovgodd
Copy link
Contributor

@Ovgodd Ovgodd commented Aug 12, 2025

Title
Add configurable locale for DOCX export (default: en-US)

Description
This PR introduces the ability to configure the default language of the generated .docx files via a new optional locale parameter in createDefaultDocumentOptions.

issue 1896

Details

  • Added locale?: string parameter to allow consumers of the library to set the document’s default language in the styles.xml metadata (<w:lang w:val="..."/>).
  • If no locale is provided, the default is set to en-US.
  • This change improves accessibility: screen readers rely on the document’s language metadata to pronounce words correctly.
  • Implementation replaces the existing language in styles.xml while preserving other attributes.

Example usage

const exporter = new DOCXExporter(schema, mappings);
await exporter.toBlob(blocks, { locale: "fr-FR" });

allows setting the default language in generated .docx files
Copy link

vercel bot commented Aug 12, 2025

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

A member of the Team first needs to authorize it.

add test cases to ensure the locale option correctly updates default
language in generated .docx files and defaults to en-US when omitted
Copy link
Contributor

@nperez0111 nperez0111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ovgodd, this looks great. Thanks for your contribution!

Copy link

vercel bot commented Aug 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
blocknote Ready Ready Preview Aug 21, 2025 1:26pm

Copy link

pkg-pr-new bot commented Aug 21, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@1937

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@1937

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1937

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@1937

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1937

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@1937

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@1937

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@1937

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@1937

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-email-exporter@1937

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@1937

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@1937

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@1937

commit: b9cb066

@nperez0111 nperez0111 merged commit 4711c08 into TypeCellOS:main Aug 21, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants