Studio APIs for internationalization (i18n) and localization (l10n)
Published: December 19, 2023
Installation and upgrading
To initiate a new Studio without installing the CLI globally:
npm create sanity@latest
To upgrade a v3 Studio, run this command in its folder:
npm install sanity@latest
⨠Highlights
š Publish! Verƶffentlichen! Publicar! å ¬é!: Sanity Studio UI Localization! š
The Translate the studio UI #1603 issue has been one of our most popular feature requests on GitHub. Now we can finally close it, because we have launched Studio UI localization.
What's New?
- Multilingual support: You can now configure the Sanity Studio user interface to use languages other than English. We're starting with many languages, including Spanish, French, Norwegian, German, Portuguese, Korean, Turkish, Icelandic, Thai, Vietnamese, Swedish, Finnish, Czech, Italian, Japanese, Chinese, and Polish. Donāt see your preferred language? It's easy to request additional language plugins!
- AI-Translated language plugins: These initial translations are generated by AI ā we're inviting the community (thatās you!) to help us improve and maintain these translations for accuracy and cultural relevance. Interested? Read more about how to contribute over on GitHub.
First steps to a localized Studio
This is our first step towards a fully global studio. The support for localization will grow, starting with our official plugins. We appreciate your patience and contributions as we expand these capabilities!
Getting started:
- Choose your language: Visit github.com/sanity-io/locales to find the plugin for your desired language. If it's not listed, weād love you to request it - we can do a first auto-translated pass, and you can help us review and improve the automated translations.
- Plugin setup:
- Ensure you are using Sanity version
3.22.0or newer - Install the plugin for your desired language (
npm install @sanity/locale-nb-no) - Import it (
import {nbNOLocale} from @sanity/locale-nb-no - Add it to your studio's plugins array (
plugins: [nbNOLocale()]) - Youāll find full instructions on the locale pluginās README!
- Ensure you are using Sanity version
- Documentation:
We're eager to hear from you and welcome any feedback. This is just the beginning, and your insights are invaluable in making Sanity Studio even better.
Introducing telemetry š”
As a product company, we have to prioritize what to work on. Ideally, those decisions are based on a healthy amount of vision (how we think things could be better) and insight (how people use the product). We have had a good amount of the former but less of the latter.
With this release, weāre introducing telemetry data collection in the CLI and Studio. Participation is optional, and you can easily opt-out by running npx sanity telemetry disable, setting the DO_NOT_TRACK=1 environment variable, or visiting Account Settings in Manage. For more details on what data is collected, how itās being used, and how consent is handled, go to sanity.io/telemetry.
Other features
- Adds experimental support for using Bun as package manager when creating new Sanity projects (
bun create sanity) - Adds the ability to customize the suffix added to auto-generated GraphQL filter types (
Filterby default), by configuringfilterSuffixin the GraphQL configuration ofsanity.cli.ts
š Notable bugfixes
- Fixes issue where annotation popover would open in the wrong location when selecting annotation text in the Portable Text editor
- Fixes removal of marks in the Portable Text editor, not always cleaning up unused mark definitions
- Fixes issue where Portable Text editor would crash when attempting to use annotations on text over multiple blocks
- Fixes issue in which new empty text blocks were added when adding a non-text block in the Portable Text editor
- Fixes an issue where selecting a custom API version in the Vision tool would sometimes crash
Related documentation
Localizing Sanity Studio
Sanity Studio supports UI localization via plugins. Users can install languages, override translations, and contribute to localization.
Internationalizing plugins
This article provides a guide for plugin authors to add localization capabilities to their Sanity Studio plugins.
CLI configuration
Wrangle datasets and webhooks, initialize plugin boilerplate code, build and deploy, all from the command line