Publishing non-base language documents with document-internationalization plugin
I understand this is a frustrating issue! Based on the official documentation and GitHub repository, I need to clarify what's happening and provide you with practical solutions.
The behavior you're experiencing where the dropdown appears "broken" when trying to create a document in a non-base language (English instead of Swedish) appears to be a workflow limitation of how the plugin is designed, though the exact cause isn't fully documented.
How the plugin works
The @sanity/document-internationalization plugin creates unique translations of documents that are joined together by a shared translation.metadata document. This metadata document maintains references to all language versions of a document.
The plugin's typical workflow expects you to:
- Create a document in one language first
- Then use the language selector to create translations from that initial document
This is because the translation.metadata document needs at least one document to reference before it can establish the translation relationship structure.
Practical solutions
Option 1: Create Swedish first, then immediately translate (Most reliable)
Create the document in Swedish (your base language), save it, then immediately use the language dropdown to create the English version. You can then:
- Leave the Swedish version unpublished if you only want English content visible to end users
- Keep minimal placeholder content in Swedish while focusing work on the English version
This respects the plugin's architecture while achieving your goal of having English-only content published.
Option 2: Enable allowCreateMetaDoc configuration
The plugin has an allowCreateMetaDoc option that was designed for tying together pre-existing documents. Try adding this to your configuration:
documentI18n({
languages: i18n.languages,
"idStructure": "delimiter",
"referenceBehavior": "weak",
"withTranslationsMaintenance": false,
"allowCreateMetaDoc": true, // Add this
"fieldNames": {
"lang": "__i18n_lang",
"references": "__i18n_refs",
"baseReference": "__i18n_base"
},
customFlagComponents: {
'sv': () => '🇸🇪',
'en': () => '🇬🇧',
}
})This enables the "manage translations" button without requiring a translated version to exist first, which might help with your workflow.
Option 3: Report this as a usability issue
Since this specific workflow limitation affects your clients' needs, it may be worth checking the plugin's GitHub issues to see if others have reported similar needs, or opening a new issue describing your use case. The dropdown behavior when trying to select a non-base language on document creation could be improved, and the maintainers may have additional workarounds or could consider this for future improvements.
What to try first
I'd recommend trying Option 2 (allowCreateMetaDoc: true) combined with Option 1 (creating Swedish first, then English). Your configuration otherwise looks correct, so this isn't a configuration error—it's about working with the plugin's current workflow design.
If the dropdown is truly "broken" (showing errors or completely non-functional rather than just not allowing the selection), that would be worth reporting as a bug on the GitHub repository with screenshots or console errors.
Show original thread9 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.