Skip to content
payloadcms avatar

Generate Translations

Step-by-step workflow that adds new translation keys to Payload core or plugin packages and auto-generates all languages.

CCM score
78 of 100
skills.sh installs
586
GitHub stars
46K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers two separate systems: core translations for packages/ui, payload, and next, and plugin translations for packages/plugin-*
  • Walks through English source edits in en.ts, optional client key registration in clientKeys.ts, and generation via pnpm generateTranslations:* scripts
  • Requires an OPENAI_KEY environment variable, since generation uses OpenAI to translate from English as the source of truth
  • Includes scaffolding steps for new plugin translation folders, with a prompt to ask the user before creating one

Install

$ npx -y skills add payloadcms/payload --skill generate-translations -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Translation Generation Guide

Payload has two separate translation systems:

  1. Core Translations - for core Payload packages (packages/ui, packages/payload, packages/next)
  2. Plugin Translations - for plugins (packages/plugin-*)

Table of Contents


1. Core Translations

When to use: Adding translations to core Payload packages (packages/ui, packages/payload, packages/next)

Steps:

  1. Add the English translation to packages/translations/src/languages/en.ts

    • Add your new key/value to the appropriate section (e.g., authentication, general, fields, etc.)
    • Use nested objects for organization
    • Example:
      export const enTranslations = {
        authentication: {
          // ... existing keys
          newFeature: 'New Feature Text',
        },
      }
      
  2. Add client key (if needed for client-side usage) to packages/translations/src/clientKeys.ts

Details

Repository
github.com/payloadcms/payload
First seen
Jun 3, 2026

Questions

What does the generate-translations skill do?

The generate-translations skill is used when new translation keys are added to Payload packages, and it generates the new translation strings. It covers core Payload packages and plugin packages, which have separate translation systems.

How do I install the generate-translations skill?

Run npx -y skills add payloadcms/payload --skill generate-translations -y in a project to install it. Once installed, the agent can add English keys and generate matching translations for all supported languages.

What do I need before using generate-translations?

Translation generation requires the OPENAI_KEY environment variable to be set, because the scripts use OpenAI to translate from English. English keys must be added first, since English is the source of truth.

Who is generate-translations for?

It is for developers working in the Payload repository who add translation keys to core packages such as packages/ui, packages/payload and packages/next, or to plugin packages under packages/plugin-*. It can also scaffold translation folders for a new plugin.

More from payloadcms/payload

All 5

Similar to Generate Translations