Imported from sanity-io/locales (
AGENTS.md). Install upstream withnpx skills add sanity-io/locales. Copyright stays with the author.
AGENTS.md
Cursor Cloud specific instructions
This is the Sanity Studio Locales monorepo: community locale packages under locales/*, plus a demo Studio at apps/studio that loads every locale as a workspace.
Runtime
- Requires Node
>=24.18.0(package.jsonengines) and pnpm (packageManager:pnpm@10.29.2). Prefer a login shell so nvm’s default Node 24 is onPATHahead of any older system Node shim. - Standard commands are in root
package.json/CONTRIBUTING.md:pnpm install,pnpm check:lint,pnpm test,pnpm build,pnpm dev.
Services
| Service | Command | Notes |
|---|---|---|
| i18n demo Studio | pnpm dev (from repo root) |
Serves at http://localhost:3333. Uses Sanity project ppsg7ml5 / dataset test. Vite aliases locale packages to their src/ so you can edit translations without rebuilding. |
Studio auth (cloud / local)
-
The Studio requires a Sanity session. In this environment, authenticate by opening:
node -e "const t=process.env.SANITY_TEST_STUDIO_AUTH_TOKEN; console.log('http://localhost:3333/<locale>#token=' + encodeURIComponent(t))"Example locale paths:
en-US,de-DE,ja-JP. AlwaysencodeURIComponentthe token. Do not commit or log the token. -
Secret name:
SANITY_TEST_STUDIO_AUTH_TOKEN. -
Pre-auth chrome (login / workspace picker) often stays on a default locale; full UI translation is visible after auth inside a locale workspace. That is expected.
Lint / test / build caveats
- CI (
.github/workflows/test.yaml) runspnpm check:lint,pnpm test, andpnpm build --filter=./locales/*. It does not runpnpm check:types. pnpm check:typescurrently fails on main (roottsconfigusesmoduleResolution: "node"vs studio package exports). Treat lint + test as the gate unless you are specifically fixing types.- Locale package builds via
@sanity/pkg-utilsv11 have been failing on main (api-extractor /moduleResolution=node10under TypeScript 5.9). Reproducing that failure locally is expected until fixed upstream in the repo; do not treat it as an environment misconfiguration. pnpm installmay warn that esbuild’s build script was ignored; the@esbuild/linux-x64binary is still present andsanity dev/ Vite work without approving builds.
Hello-world check
After pnpm dev, open an auth URL for a non-English workspace (e.g. de-DE), confirm German Studio chrome (e.g. Entwurf, Veröffentlichen), and create/save a Localization test draft.
Bugbot Autofix
Repo Autofix mode is Create New Branch (not commit-to-existing). See .cursor/BUGBOT.md. PR approval routing for autotranslate locales lives under .cursor/approval-policies/.