The editor in your reader's language
The built-in UI follows a locale you set, ships Portuguese and Spanish, and takes your own translations for any label.

A reviewer in São Paulo opens a contract in your app. The document is in Portuguese, but the toolbar, the context menu, and the review cards around it are in English. Translating that interface meant overriding labels one surface at a time.
SuperDoc's built-in UI now follows a locale you set.
Set the language
Pass one language tag, or the reader's list of preferences:
new SuperDoc({ selector: '#editor', document: '/contract.docx', locale: navigator.languages });SuperDoc uses the first language in the list it has a pack for, and falls back to English. Toolbar labels, menus, dialogs, comment and review cards, and timestamps change. Text already in the document never does.
| Language | Pack | Used for |
|---|---|---|
| English | en | en-* tags, and the fallback |
| Portuguese (Brazil) | pt-BR | pt-BR, pt, pt-PT, pt-* |
| Spanish | es | es, es-MX, es-419, es-* |
The packs ship inside the superdoc package. There is nothing extra to install.
Replace any label, or add a language
translations replaces built-in labels per language. It is typed as SuperDocTranslations, so your editor
autocompletes the keys and a misspelled key fails type checking:
import { SuperDoc, type SuperDocTranslations } from 'superdoc';
const translations = {
en: { 'toolbar.search': 'Find in contract' },
'pt-BR': { 'toolbar.search': 'Buscar no contrato' },
} satisfies SuperDocTranslations;
new SuperDoc({ selector: '#editor', document: '/contract.docx', locale: navigator.languages, translations });An entry for a language SuperDoc doesn't ship adds that language. locale: 'fr-CA' uses a fr entry, and any label
it doesn't translate falls back to English. Labels with a count use ICU plural syntax, so each language picks its own
word forms.
All 840 interface strings ship as superdoc/locales/en.json, a flat file you can load into a translation tool.
Each reader, their own language
The language belongs to the reader, not the document. In a collaboration room, one reviewer can see the toolbar in
English while another sees it in Portuguese. SuperDoc never stores locale in the DOCX. Dates and numbers in the
interface are formatted with Intl for the chosen language.