vendor/payload-upstream/.claude/skills/generate-translations/SKILL.md
Use when new translation keys are added to packages to generate new translations strings
npx skillsauth add asymmetric-al/core generate-translationsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Payload has two separate translation systems:
When to use: Adding translations to core Payload packages (packages/ui, packages/payload, packages/next)
Add the English translation to packages/translations/src/languages/en.ts
authentication, general, fields, etc.)export const enTranslations = {
authentication: {
// ... existing keys
newFeature: 'New Feature Text',
},
}
Add client key (if needed for client-side usage) to packages/translations/src/clientKeys.ts
'authentication:newFeature'Generate translations for all languages
cd tools/scriptspnpm generateTranslations:coreWhen to use: Adding translations to any plugin package (packages/plugin-*)
Verify plugin has translations folder
packages/plugin-{name}/src/translations existsAdd the English translation to the plugin's packages/plugin-{name}/src/translations/languages/en.ts
export const enTranslations = {
'plugin-multi-tenant': {
'new-feature-label': 'New Feature',
},
}
Generate translations for all languages
cd tools/scriptspnpm generateTranslations:plugin-{name}pnpm generateTranslations:plugin-multi-tenantpnpm generateTranslations:plugin-ecommercepnpm generateTranslations:plugin-import-exportIf a plugin doesn't have a translations folder yet, ask the user if they want to scaffold one.
packages/plugin-{name}/src/translations/
├── index.ts
├── types.ts
└── languages/
├── en.ts
├── es.ts
└── ... (all other language files)
Create tools/scripts/src/generateTranslations/plugin-{name}.ts
plugin-multi-tenant.ts as a templateAdd script to tools/scripts/package.json:
"generateTranslations:plugin-{name}": "node --no-deprecation --import @swc-node/register/esm-register src/generateTranslations/plugin-{name}.ts"
OPENAI_KEY environment variable to be setdevelopment
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
testing
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
data-ai
Pointer to the canonical agent instruction and skill system for this monorepo
development
React View Transitions and Next.js App Router route continuity. Use for page or route transitions, shared element morphs, React ViewTransition usage, list-to-detail navigation polish, and navigation motion across admin, donor, or missionary surfaces — without fighting motion/react.