Skip to content

Commit

Permalink
add missing index.ts files for each language, and in each translatio…
Browse files Browse the repository at this point in the history
…ns.ts export each language separately.

Moreover, deprecate the old "feature-prefixed" const with chunks config. and deprecate old "feature-prefixed" const with wrapper `translations` object
  • Loading branch information
Platonn committed Dec 20, 2024
1 parent 7ec287c commit 901063d
Show file tree
Hide file tree
Showing 780 changed files with 7,850 additions and 838 deletions.
26 changes: 26 additions & 0 deletions feature-libs/asm/assets/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,30 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { TranslationResources } from '@spartacus/core';
import {
translationsEn,
translationChunksConfig,
} from './translations/translations';

export * from './translations/translations';

/**
* @deprecated use **specific language** translations from `@spartacus/asm/assets` instead,
* like in the following example:
* ```ts
* import { translationsEn } from '@spartacus/asm/assets';
* ...
* {
* en: translationsEn
* }
* ```
*/
export const asmTranslations: TranslationResources = {
en: translationsEn,
};

/**
* @deprecated use `translationChunksConfig` from `@spartacus/asm/assets` instead
*/
export const asmTranslationChunksConfig = translationChunksConfig;
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/cs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const cs = {
asm,
};
1 change: 0 additions & 1 deletion feature-libs/asm/assets/translations/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asm from './asm.json';

export const de = {
asm,
};
1 change: 0 additions & 1 deletion feature-libs/asm/assets/translations/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asm from './asm.json';

export const en = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/es/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const es = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/es_CO/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const es_CO = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/fr/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const fr = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/hi/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const hi = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/hu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const hu = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/id/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const id = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/it/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const it = {
asm,
};
1 change: 0 additions & 1 deletion feature-libs/asm/assets/translations/ja/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asm from './asm.json';

export const ja = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/ko/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const ko = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/pl/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const pl = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/pt/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const pt = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/ru/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const ru = {
asm,
};
31 changes: 19 additions & 12 deletions feature-libs/asm/assets/translations/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { TranslationChunksConfig, TranslationResources } from '@spartacus/core';
import { en } from './en/index';
import { ja } from './ja/index';
import { de } from './de/index';
import { zh } from './zh/index';
import { TranslationChunksConfig } from '@spartacus/core';

export const asmTranslations: TranslationResources = {
en,
ja,
de,
zh,
};
export { cs as translationsCs } from './cs/index';
export { de as translationsDe } from './de/index';
export { en as translationsEn } from './en/index';
export { es as translationsEs } from './es/index';
export { es_CO as translationsEs_CO } from './es_CO/index';
export { fr as translationsFr } from './fr/index';
export { hi as translationsHi } from './hi/index';
export { hu as translationsHu } from './hu/index';
export { id as translationsId } from './id/index';
export { it as translationsIt } from './it/index';
export { ja as translationsJa } from './ja/index';
export { ko as translationsKo } from './ko/index';
export { pl as translationsPl } from './pl/index';
export { pt as translationsPt } from './pt/index';
export { ru as translationsRu } from './ru/index';
export { zh as translationsZh } from './zh/index';
export { zh_TW as translationsZh_TW } from './zh_TW/index';

export const asmTranslationChunksConfig: TranslationChunksConfig = {
export const translationChunksConfig: TranslationChunksConfig = {
asm: ['asm'],
};
1 change: 0 additions & 1 deletion feature-libs/asm/assets/translations/zh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asm from './asm.json';

export const zh = {
asm,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/assets/translations/zh_TW/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asm from './asm.json';
export const zh_TW = {
asm,
};
26 changes: 26 additions & 0 deletions feature-libs/asm/customer-360/assets/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,30 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { TranslationResources } from '@spartacus/core';
import {
translationChunksConfig,
translationsEn,
} from './translations/translations';

export * from './translations/translations';

/**
* @deprecated use **specific language** translations from `@spartacus/asm/customer-360/assets` instead,
* like in the following example:
* ```ts
* import { translationsEn } from '@spartacus/asm/customer-360/assets';
* ...
* {
* en: translationsEn
* }
* ```
*/
export const asmCustomer360Translations: TranslationResources = {
en: translationsEn,
};

/**
* @deprecated use `translationChunksConfig` from `@spartacus/asm/customer-360/assets` instead
*/
export const asmCustomer360TranslationChunksConfig = translationChunksConfig;
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/cs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const cs = {
asmCustomer360,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asmCustomer360 from './asmCustomer360.json';

export const de = {
asmCustomer360,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asmCustomer360 from './asmCustomer360.json';

export const en = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/es/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const es = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/es_CO/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const es_CO = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/fr/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const fr = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/hi/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const hi = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/hu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const hu = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/id/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const id = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/it/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const it = {
asmCustomer360,
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

import asmCustomer360 from './asmCustomer360.json';

export const ja = {
asmCustomer360,
};
10 changes: 10 additions & 0 deletions feature-libs/asm/customer-360/assets/translations/ko/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2024 SAP Spartacus team <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

import asmCustomer360 from './asmCustomer360.json';
export const ko = {
asmCustomer360,
};
Loading

0 comments on commit 901063d

Please sign in to comment.