Skip to content

Commit

Permalink
fix: bring back the old chunks config for the CDS with the cds pref…
Browse files Browse the repository at this point in the history
…ix (#19888)

**Problem:**
When lately double-checking in runtime whether the translation chunks configs for all features are the same Before the PR #19799 and After it, I noticed a small difference. The chunks config for the CDS feature unintentionally lost their `cds` prefix. 

Note:  For consistency also renamed the relevant JSON filenames to match with the desired `cds`-prefixed chunk names.


---
**QA steps**
1. add this APP_INTIALIZER to the providers array in our app.module:
```ts
import { cdsTranslationChunksConfig } from '@spartacus/cds/assets';
/*...*/

    {
      provide: APP_INITIALIZER,
      useFactory: () => {
        console.log({
          cdsTranslationChunksConfig,
        });
      },
      multi: true,
    },
 ```

2. Run and open the storefront, and check in runtime in the console the printed value contains:
EXPECTED (with `cds`-prefixed keys):
```
"cdsTranslationChunksConfig": {
    "cdsRecentSearches": ["cdsRecentSearches"],
    "cdsTrendingSearches": ["cdsTrendingSearches"]
  },
```

WRONG (it was before this commit):
```
  "cdsTranslationChunksConfig": {
    "recentSearches": ["cdsRecentSearches"],
    "trendingSearches": ["cdsTrendingSearches"]
  },
```
  • Loading branch information
Platonn authored Jan 17, 2025
1 parent bb0bf3c commit 2c6f95e
Show file tree
Hide file tree
Showing 51 changed files with 68 additions and 68 deletions.
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/cs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const cs = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const de = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const en = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/es/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const es = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/es_CO/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const es_CO = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const fr = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/hi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const hi = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/hu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const hu = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/id/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const id = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/it/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const it = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/ja/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const ja = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/ko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const ko = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/pl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const pl = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/pt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const pt = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/ru/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const ru = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/zh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const zh = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};
8 changes: 4 additions & 4 deletions integration-libs/cds/assets/translations/zh_TW/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

import recentSearches from './recentSearches.json';
import trendingSearches from './trendingSearches.json';
import cdsRecentSearches from './cdsRecentSearches.json';
import cdsTrendingSearches from './cdsTrendingSearches.json';
export const zh_TW = {
recentSearches,
trendingSearches,
cdsRecentSearches,
cdsTrendingSearches,
};

0 comments on commit 2c6f95e

Please sign in to comment.