Localization enhancements #10705
Replies: 13 comments 4 replies
-
Being able to unpublish specific locales really needs to be prioritised. It seems like a fundamental feature for localization. Currently the only way I can see to unpublish a locale is completely deleting the document and re-implementing it without publishing the specific locale, causing all version history to be lost (which in our case is not practical). If anyone has any other workarounds I'd appreciate if they could share. Glad to see it's showing up here for discussion. |
Beta Was this translation helpful? Give feedback.
-
@rilrom, I support your view, and here's how I see this improvement for Payload's localization to match Strapi's excellent implementation. We need two key features for collections with translations:
For example: if content ID 5 has English published but French in draft:
This solves the common issue where content exists in some languages but not others, ensuring users only see properly published content in their requested language. These changes would significantly improve Payload's localization workflow and make it more user-friendly for content managers working with multiple languages. |
Beta Was this translation helpful? Give feedback.
-
Hello 👋 There are also questions around the locale data model to make it easier to retrieve all slugs for all locales for a document in a given collection. When generating a sitemap, it is generally better to request the document in a single language rather than using Another use case is language switching. When I fetch a document to display it on my page, it’s helpful to have the slug in other available languages so I can directly link to the corresponding language version on a language switch. For example, in a real life front-end application, there is no way editors will redirect To optimize performance, it would be valuable to have these slugs available directly in a single call to fetch documents from a collection, rather than remapping the data within a PayloadCMS custom endpoint. One workaround we are doing (that will not work without the discussed "admin unpublish feature") is:
So, when we request a collections of documents with
Right now, this works, but the content of |
Beta Was this translation helpful? Give feedback.
-
Hi, a thing from me. Support multiple values in the
|
Beta Was this translation helpful? Give feedback.
-
Hello! A client duplicated a german post multiple times. For the client it was really confusing why the english content suddenly had 5 identical posts. Maybe it would be good to give the user a choice which languages to duplicate. Another thing thats logical for developers, but not for the clients are empty language pendants (). |
Beta Was this translation helpful? Give feedback.
-
It would be nice to be able to add new locales without code changes. |
Beta Was this translation helpful? Give feedback.
-
It would be incredibly helpful to be able to set fields to be Example configuration: localization: {
locales: ["en", "fr"],
defaultLocale: "en",
fallback: true,
} A possible implementation for a field could look as such: {
name: "someField",
type: "text",
required: true, // required only to default locale ('en')
localized {
// overrides required status for non-default locales
// falls back to defaultLocale if not provided
required: false
}
} Expected Behaviour:
Or, if someone had more than two locales, it may be better to extend the implementation to allow setting which ones should be required: {
name: "someField",
type: "text",
required: true,
localized: {
required: ["en", "de"], // required only in 'en' and 'de', optional in other locales
}
} |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I think for editors it's easy to forget about localization, because the localization status and locale switch are not very prominent within the UI. I am thinking of a status indicator: If the locales would even be clickable so that you can edit the fields value in the specified locale, regardless of the globally selected locale, that would be awesome. |
Beta Was this translation helpful? Give feedback.
-
Could also be good to have a better way of identifying what locales a document is "using", so that we can do custom fields, columns and whatnot |
Beta Was this translation helpful? Give feedback.
-
Following up with @lorenzrabs 's comment, I created this issue as I found out that when you duplicate a localized document it actually publishes all the rest of available locales and adds a "null - Copy" title to them, even though the other locales have never been touched. |
Beta Was this translation helpful? Give feedback.
-
Saw this discussion on Discord and wanted to add my previous discussion points: I provided some source code and for instance the currently used data models is: {
"locales": {
"de": {
"status": "published",
"createdAt": "2025-01-28T22:03:43.128Z",
"createdBy": "64d118d7ec4a6f13f2ed0d11",
"updatedAt": "2025-01-28T22:04:50.712Z",
"updatedBy": "64d118d7ec4a6f13f2ed0d11",
"publishedAt": "2025-01-28T22:04:50.712Z",
"publishedBy": "64d118d7ec4a6f13f2ed0d11"
},
"en": {
"status": "draft",
"createdAt": "2025-01-28T22:04:00.594Z",
"createdBy": "64d118d7ec4a6f13f2ed0d11",
"updatedAt": "2025-01-28T22:04:03.983Z",
"updatedBy": "64d118d7ec4a6f13f2ed0d11"
},
"fr": {},
"it": {}
}
} Basically additional metadata gets saved per language which can be used to check which translations exist. Based on such a structure features can be built on top of it. |
Beta Was this translation helpful? Give feedback.
-
Another thing I'd like to add, I realized that when you enable localization in the Payload app, it adds the "Publish In [Locale]" button to the editing screen. The problem is that this button also appears in "Non-localized" collections that have versioning enabled, which creates a lot of confusion and insecurity in the editors. I went ahead and dove a little deeper to see how this works at DB level, and realized that even for "Non-localized" collections—locale tables are created, where there's an entry for each of the documents in the "Non-localized" collection and for each locale, although they don't update at all, meaning the "Publish in [locale]" button doesn't really do anything aside from the normal behaviour of the "Publish version" button. However, I think it's pretty confusing, and also weird that "localized" tables are created for documents that don't have any localized fields whatsoever. |
Beta Was this translation helpful? Give feedback.
-
We aim to improve current localization features with the following items:
status
bar to include all locale status information. Related thread here by italodr.Any other localization enhancements requests are welcome, they will be prioritized and incorporated into the roadmap accordingly.
Beta Was this translation helpful? Give feedback.
All reactions