sanity-i18n-translate
Skill by sanity-io
Teaches AI assistants to use the Sanity <Translate> i18n component correctly, especially its components map and componentProps. Useful for developers rendering locale strings with embedded markup or fixing the no-inline-translate-components lint rule.
Install sanity-i18n-translate
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sanity-io/sanity /tmp/sanity && mkdir -p ~/.claude/skills && cp -r /tmp/sanity/.agents/skills/sanity-i18n-translate ~/.claude/skills/sanity-i18n-translateRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sanity-io/sanity /tmp/sanity && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/sanity/.agents/skills/sanity-i18n-translate ~/.gemini/antigravity-cli/skills/sanity-i18n-translateAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install sanity-i18n-translate in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill explains how to use the Sanity <Translate> i18n component. Its components prop maps tag names in locale strings, such as 'Search for "<Red>{{keyword}}</Red>"', to React components or intrinsic HTML tag names. Its componentProps object passes data to those components. The skill says plain t() should be used when a message has no markup, because <Translate> is more expensive to render.
The main rule is that components in the map must be stable, module-scope definitions, never created inline during render. The skill gives fixes for each case: plain HTML tags as strings, hoisted static components, and hoisted components that receive render data through componentProps. It is aimed at developers adding or reviewing Translate usages, or fixing the @repo/i18n/no-inline-translate-components lint rule. It points to reference files in the Sanity repository.
Written from the project's SKILL.md and checked against it.
What it can do
- Map markup tags to componentsExplains how the components prop maps tags in locale strings to React components or HTML tag names.
- Fix inline component definitionsShows how to hoist components out of render to avoid remounts and lint errors.
- Pass render dataDescribes passing data to components through componentProps.
- Handle the lint ruleCovers fixes for the @repo/i18n/no-inline-translate-components lint rule.
- Review Translate usagesLists gotchas such as as const literals, children handling and unmapped tags.
What you need
- Access to the Sanity monorepo source
Try asking
- Fix the no-inline-translate-components lint error in this file
- Show me how to pass a tone prop to a component inside a Translate string
- Review my Translate usages for inline component definitions
Good to know
- Components in the components map must be module-scope, not defined inline.
- Unmapped lowercase tags render only if listed in RECOGNIZED_HTML_TAGS.
- componentProps is forwarded to every non-string component in the map.
- <Translate> is more expensive to render than plain t().
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/sanity-i18n-translate/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md4 KB
Alternatives to sanity-i18n-translate
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
sanity-i18n-translate: common questions
Why should Translate components not be defined inline?
Each render creates a new component identity, so React unmounts and remounts the subtree, losing state, DOM and focus. The source says the lint rule enforces this for Translate.
When should I use t() instead of Translate?
The source says to use plain t() when the message has no markup, because <Translate> is more expensive to render.
What does componentProps do?
It passes an object to every non-string component in the components map. The source advises declaring only the props each component reads.
How do I install sanity-i18n-translate?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is sanity-i18n-translate free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is sanity-i18n-translate safe to use?
It scores 82 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to sanity-i18n-translate?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
