generate-translations
payloadcms
Use when new translation keys are added to packages to generate new translations strings
bunx add-skill payloadcms/payload -s generate-translationsLoadingβ¦
payloadcms
Use when new translation keys are added to packages to generate new translations strings
bunx add-skill payloadcms/payload -s generate-translationsLoadingβ¦
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 setUse when you need to run Flow type checking, or when seeing Flow type errors in React code.
Use when you want to validate changes before committing, or when you need to check all React contribution requirements.
Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.
Use when you need to check feature flag states, compare channels, or debug why a feature behaves differently across release channels.