payload icon indicating copy to clipboard operation
payload copied to clipboard

Maybe don't create a localized page for other languages automatically?

Open razaanstha opened this issue 4 months ago • 1 comments

Describe the Bug

When I create a new page in one locale (for example, en), Payload automatically generates empty localized versions for all other configured locales (fr, es, sv, no, etc.).

This creates multiple empty documents that I don’t need, and it becomes messy when managing content. It would be better if:

  • Payload only created a localized version when a user explicitly switches to that locale in the admin panel, or add better UI.
  • Maybe add a configuration option to disable automatic creation of empty locale variants.

This would give more control over translations and avoid unnecessary empty documents in the database.

Link to the code that reproduces this issue

https://payloadcms.com/docs/configuration/localization

Reproduction Steps

  1. Create a fresh Payload project using the latest version.
  2. Enable localization in the config and add multiple locales (e.g. en, fr, es, sv, no).
  3. Go to the admin panel and create a new page while selecting one specific locale (e.g. en).
  4. After saving, switch to another locale in the admin panel.

You will see that Payload has created empty localized variants/options for every other locale automatically.

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
Node: 22.17.0
npm: 10.9.2
pnpm: 10.3.0
Relevant Packages:
payload: 3.62.1
next: 15.5.6
@payloadcms/admin-bar: 3.62.1
@payloadcms/db-mongodb: 3.62.1
@payloadcms/email-nodemailer: 3.62.1
@payloadcms/live-preview-react: 3.62.1
@payloadcms/next: 3.62.1
@payloadcms/plugin-form-builder: 3.62.1
@payloadcms/plugin-nested-docs: 3.62.1
@payloadcms/plugin-redirects: 3.62.1
@payloadcms/plugin-seo: 3.62.1
@payloadcms/richtext-lexical: 3.62.1
@payloadcms/storage-vercel-blob: 3.62.1
@payloadcms/ui: 3.62.1
react: 19.2.0
react-dom: 19.2.0
Operating System:
Platform: darwin
Arch: arm64

razaanstha avatar Nov 28 '25 12:11 razaanstha

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@latest -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

github-actions[bot] avatar Nov 28 '25 12:11 github-actions[bot]

Hi @razaanstha, I wanted to clarify how localization works in Payload, because it seems there’s a bit of a misunderstanding here.

When you create a new document in Payload, it creates a single document in the database. That document will contain fields for all configured locales, but only the locale you’ve entered data for will have values. The other locales exist in the document structure but remain empty until you explicitly add content for them. So no extra documents or versions are being created here, just empty localized fields within the same document.

What you’re seeing in the admin panel (empty fields for other locales) is expected behavior. To hide fields in other locales until they’re needed or if you have fields that should only be populated under certain conditions, you can use admin.condition or custom hooks to control fields based on the locale.

If you have any other questions, feel free to reach out. Closing as no work to be done.

jessrynkar avatar Dec 05 '25 16:12 jessrynkar