Skip to main content
The plugin ships UI translations for 44 locales, automatically merged into your Payload i18n configuration under the @seshuk/payload-plugin-openapi namespace. Only the languages present in your project’s i18n.supportedLanguages are merged in — the plugin never adds languages your project doesn’t declare.

How language resolution works

Entity titles and descriptions in the generated spec are resolved through the active request locale, the same way Payload resolves its own labels. The spec endpoint also honors an explicit ?lang= query param:
returns the document with Russian descriptions. Without ?lang=, the request language (or the i18n fallback) applies.

Language switcher in Scalar

Scalar supports multiple spec sources natively. Point configuration.sources at the same runtime endpoint with different ?lang= values — nothing is pre-generated, each language resolves on request:
payload.config.ts
When sources is set, the renderer’s own specEndpoint is ignored. The first entry is the default unless another entry sets default: true.
The same switcher works against static files instead of the runtime endpoint — generate one file per language with --lang all and point the sources at /openapi.en.json, /openapi.ru.json, and so on. See Serve a pre-generated spec.

Swagger UI: one instance per language

Swagger UI has no built-in switcher. Mount one instance per language, each on its own path:
payload.config.ts

Localizable field metadata

description, title, and summary in custom.openapi metadata are localizable. Give them a function or a locale-keyed object and they resolve against the request language, the same way Payload labels do:
See Field metadata for the full merge behavior.

Generating translated files

The openapi:generate CLI takes --lang for a single locale, or --lang all to write one file per supported language (openapi.<lang>.json):

Supported locales

ar, az, bg, bn (BD/IN), ca, cs, da, de, en, es, et, fa, fr, he, hr, hu, hy, id, is, it, ja, ko, lt, lv, my, nb, nl, pl, pt, ro, rs (Cyrillic/Latin), ru, sk, sl, sv, ta, th, tr, uk, vi, zh, zhTw

See also