Skip to content

Commit d589c0e

Browse files
committed
chore: change enableStatusLocalization to disableStatusLocalization
1 parent 8a9caef commit d589c0e

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

docs/configuration/localization.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ export default buildConfig({
7878

7979
The following options are available:
8080

81-
| Option | Description |
82-
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83-
| **`locales`** | Array of all the languages that you would like to support. [More details](#locales) |
84-
| **`defaultLocale`** | Required string that matches one of the locale codes from the array provided. By default, if no locale is specified, documents will be returned in this locale. |
85-
| **`enableStatusLocalization`** | **Boolean.** When `true`, shows document status per locale in the admin panel instead of always showing the latest overall status. Opt-in for backwards compatibility. Defaults to `false`. |
86-
| **`fallback`** | Boolean enabling "fallback" locale functionality. If a document is requested in a locale, but a field does not have a localized value corresponding to the requested locale, then if this property is enabled, the document will automatically fall back to the fallback locale value. If this property is not enabled, the value will not be populated unless a fallback is explicitly provided in the request. True by default. |
87-
| **`filterAvailableLocales`** | A function that is called with the array of `locales` and the `req`, it should return locales to show in admin UI selector. [See more](#filter-available-options). |
81+
| Option | Description |
82+
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
83+
| **`locales`** | Array of all the languages that you would like to support. [More details](#locales) |
84+
| **`defaultLocale`** | Required string that matches one of the locale codes from the array provided. By default, if no locale is specified, documents will be returned in this locale. |
85+
| **`disableStatusLocalization`** | Boolean. When `true`, the admin panel will show the latest overall document status instead of showing the status per locale. Defaults to `false`. @depreciated This is a backward compatibility option and will be removed in 4.0. |
86+
| **`fallback`** | Boolean enabling "fallback" locale functionality. If a document is requested in a locale, but a field does not have a localized value corresponding to the requested locale, then if this property is enabled, the document will automatically fall back to the fallback locale value. If this property is not enabled, the value will not be populated unless a fallback is explicitly provided in the request. True by default. |
87+
| **`filterAvailableLocales`** | A function that is called with the array of `locales` and the `req`, it should return locales to show in admin UI selector. [See more](#filter-available-options). |
8888

8989
### Locales
9090

packages/payload/src/config/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ export const createClientConfig = ({
193193
config.localization.defaultLocalePublishOption
194194
}
195195

196-
if (config.localization.enableStatusLocalization) {
197-
clientConfig.localization.enableStatusLocalization =
198-
config.localization.enableStatusLocalization
196+
if (config.localization.disableStatusLocalization) {
197+
clientConfig.localization.disableStatusLocalization =
198+
config.localization.disableStatusLocalization
199199
}
200200

201201
if (config.localization.fallback) {

packages/payload/src/config/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,11 +487,13 @@ export type BaseLocalizationConfig = {
487487
*/
488488
defaultLocalePublishOption?: 'active' | 'all'
489489
/**
490-
* Enable localization of the status of the document.
490+
* Disable localization of the status of the document.
491491
* If enabled, the status will reflect the current locale throughout the Admin UI.
492+
* If disabled, the status will not be localized and will always reflect the overall status of the document.
492493
* @default false
494+
* @deprecated This is a backward compatibility option and will be removed in 4.0.
493495
*/
494-
enableStatusLocalization?: boolean
496+
disableStatusLocalization?: boolean
495497
/** Set to `true` to let missing values in localised fields fall back to the values in `defaultLocale`
496498
*
497499
* If false, then no requests will fallback unless a fallbackLocale is specified in the request.

packages/payload/src/versions/buildCollectionFields.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const buildVersionCollectionFields = <T extends boolean = false>(
6363
}),
6464
})
6565

66-
if (config.localization.enableStatusLocalization) {
66+
if (config.localization.disableStatusLocalization !== true) {
6767
const localeStatusFields = buildLocaleStatusField(config)
6868

6969
fields.push({

packages/payload/src/versions/buildGlobalFields.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const buildVersionGlobalFields = <T extends boolean = false>(
5757
}),
5858
})
5959

60-
if (config.localization.enableStatusLocalization) {
60+
if (config.localization.disableStatusLocalization !== true) {
6161
const localeStatusFields = buildLocaleStatusField(config)
6262

6363
fields.push({

packages/payload/src/versions/saveVersion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const saveVersion = async ({
137137
if (
138138
localizationEnabled &&
139139
payload.config.localization !== false &&
140-
payload.config.localization.enableStatusLocalization
140+
payload.config.localization.disableStatusLocalization !== true
141141
) {
142142
const allLocales = (
143143
(payload.config.localization && payload.config.localization?.locales) ||

test/localization/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ export default buildConfigWithDefaults({
434434
},
435435
defaultLocale,
436436
fallback: true,
437-
enableStatusLocalization: true,
437+
disableStatusLocalization: false,
438438
locales: [
439439
{
440440
code: 'xx',

0 commit comments

Comments
 (0)