feat: adds experimental option localizeStatus and allows unpublish per-locale functionality#14667
Conversation
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
1ca91d8 to
405c563
Compare
|
🚀 This is included in version v3.72.0 |
\### Why? New translation keys were introduced in payloadcms#14667 to add the `localizeStatus` option, so this PR updates the Japanese translations accordingly. \### What? This PR refines the Japanese translations related to `localizeStatus` to keep them consistent with the rest of the UI and to make the wording sound more natural. \### How? - Since *unpublish* is translated as *非公開* in Japanese, unify existing occurrences of *未公開* to *非公開*. - Tweak other minor phrasing to improve naturalness and consistency in Japanese.
|
@JarrodMFlesch Is the migration only needed here if you want to use the experimental feature? And post-migration the feature works for both I don't use this feature but need to decide whether to complete the migration anyway or not. |
|
@mobeigi yes the migration is only needed if you are going to use the experimental feature and already have existing data. If you aren't using it, don't do the migration. If you do it, you cannot easily switch the feature on/off, you need to migrate each time because it changes the data shape. |
|
Getting |
…atus (#15358) ### What? This PR refines the Japanese translations related to `localizeStatus` to keep them consistent with the rest of the UI and to make the wording sound more natural. ### Why? New translation keys were introduced in #14667 to add the `localizeStatus` option, so this PR updates the Japanese translations accordingly. ### How? - Since *unpublish* is translated as *非公開* in Japanese, unify existing occurrences of *未公開* to *非公開*. - Tweak other minor phrasing to improve naturalness and consistency in Japanese.
…ion (#15353) ### What? Additional fixes to Swedish translations. ### Why? #14667 added some new strings which weren't accurately handled by the automatic translator. Also fixed a couple of capitalization issues and improved the wording in a couple of places to be more in line with other strings. Co-authored-by: Patrik Kozak <35232443+PatrikKozak@users.noreply.github.com>
…atus (payloadcms#15358) ### What? This PR refines the Japanese translations related to `localizeStatus` to keep them consistent with the rest of the UI and to make the wording sound more natural. ### Why? New translation keys were introduced in payloadcms#14667 to add the `localizeStatus` option, so this PR updates the Japanese translations accordingly. ### How? - Since *unpublish* is translated as *非公開* in Japanese, unify existing occurrences of *未公開* to *非公開*. - Tweak other minor phrasing to improve naturalness and consistency in Japanese.
…ion (payloadcms#15353) ### What? Additional fixes to Swedish translations. ### Why? payloadcms#14667 added some new strings which weren't accurately handled by the automatic translator. Also fixed a couple of capitalization issues and improved the wording in a couple of places to be more in line with other strings. Co-authored-by: Patrik Kozak <35232443+PatrikKozak@users.noreply.github.com>
Same here with 3.84.1 |
|
@JessRynkar does this feature have a viable upgrade path to v4? I've pinpointed the error that currently breaks the migration code, but I don't want to apply this feature my projects is where is no upgrade path to v4 and my data ends in a dead end |
|
For Payload v4, maybe consider storing separate docs per language in the database? It will simplify the per-locale publishing workflow. |
Localized Status (Experimental)
This PR introduces a new experimental option that allows each locale to track and manage its own publication status independently, for collection docs and globals.
Configuration
To enable this feature, you need two configurations:
payload.config:Key Changes
When enabled:
Improved Behavior
Migration Required (If you already have version data)
localizeStatusis enabled, existing_statusfields will need to be migrated from strings to locale objects.➡️ Step 1
Before doing anything, take a backup of your current database.
➡️ Step 2
Stop your dev server if it is running
➡️ Step 3
Create migration file
Add migration code
🔵 PostgreSQL / SQLite:
🟢 MongoDB:
➡️ Step 4
Run the migration
➡️ Step 5
Set
localizeStatus: truePayload Config
Collection Config
➡️ Step 6
Run
pnpm devand test out the feature.Related PRs in this feature