payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
27.66k stars 1.72k forks source link

Localized fields show empty content even if default language has content set #9402

Closed sriechersrc closed 22 hours ago

sriechersrc commented 22 hours ago

Describe the Bug.

English Image German Image

Translatable fields do not display the content they use as a fallback, instead they show an empty field. I think it would be better if these fields were filled with the fallback content to make it easier to see which fields have not yet been translated.

Also having to go back up to the top of the admin panel to switch the language environment is kind of annoying. Maybe it would be better if the select would be in the sticky status bar at the top:

Image

Reproduction Steps

  1. Create a localized field
  2. Fill the field with content in the default language
  3. Switch the language environment
  4. The Text in the field will be empty, even though the api is returning the default language content

Environment Info

Binaries:
  Node: 22.8.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 8.12.1
Relevant Packages:
  payload: 3.0.1
  next: 15.0.3
  @payloadcms/db-mongodb: 3.0.1
  @payloadcms/email-nodemailer: 3.0.1
  @payloadcms/graphql: 3.0.1
  @payloadcms/live-preview: 3.0.1
  @payloadcms/live-preview-react: 3.0.1
  @payloadcms/next/utilities: 3.0.1
  @payloadcms/payload-cloud: 3.0.1
  @payloadcms/plugin-cloud-storage: 3.0.1
  @payloadcms/plugin-nested-docs: 3.0.1
  @payloadcms/plugin-search: 3.0.1
  @payloadcms/plugin-seo: 3.0.1
  @payloadcms/richtext-lexical: 3.0.1
  @payloadcms/storage-vercel-blob: 3.0.1
  @payloadcms/translations: 3.0.1
  @payloadcms/ui/shared: 3.0.1
  react: 19.0.0-rc-69d4b800-20241021
  react-dom: 19.0.0-rc-69d4b800-20241021
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:51 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11
JarrodMFlesch commented 22 hours ago

Personally I think it is easier to spot if it is empty. If you had 100 fields and they were mixed content it would be harder to spot which ones have been localized or not.

I am going to close this for now. If you want to open up a discussion or search for discussions talking about localization that might be helpful. But since this is preference and not really an issue, I am going to close.

Thanks!