From 0c99b31285173aac013267ef5fcbb38c889c0cea Mon Sep 17 00:00:00 2001 From: marwaldv Date: Wed, 6 Nov 2024 16:28:48 +0100 Subject: [PATCH] Feature: Add Swiss backoffice localizations (#2503) * Add swiss languages as backoffice languages * Added Swiss localizations to manifest * De-duplicated localizations To reduce lines of duplicated code, (from the German, French and Italian localizations), those localizations are imported at runtime. --------- Co-authored-by: leekelleher --- .../src/assets/lang/de-ch.ts | 17 +++++++++++ .../src/assets/lang/fr-ch.ts | 17 +++++++++++ .../src/assets/lang/it-ch.ts | 17 +++++++++++ .../packages/core/localization/manifests.ts | 30 +++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/assets/lang/de-ch.ts create mode 100644 src/Umbraco.Web.UI.Client/src/assets/lang/fr-ch.ts create mode 100644 src/Umbraco.Web.UI.Client/src/assets/lang/it-ch.ts diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/de-ch.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/de-ch.ts new file mode 100644 index 0000000000..cd33f22eab --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/de-ch.ts @@ -0,0 +1,17 @@ +/** + * Creator Name: The Umbraco community + * Creator Link: https://docs.umbraco.com/umbraco-cms/extending/language-files + * + * Language Alias: de_CH + * Language Int Name: German Switzerland (DE-CH) + * Language Local Name: Deutsch Schweiz (DE-CH) + * Language LCID: 7 + * Language Culture: de-CH + */ +import de_de from './de-de.js'; +import type { UmbLocalizationDictionary } from '@umbraco-cms/backoffice/localization-api'; + +export default { + // NOTE: Imports and re-exports the German (Germany) localizations, so that any German (Switzerland) localizations can be override them. [LK] + ...de_de, +} as UmbLocalizationDictionary; diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/fr-ch.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/fr-ch.ts new file mode 100644 index 0000000000..712e9fc0fd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/fr-ch.ts @@ -0,0 +1,17 @@ +/** + * Creator Name: The Umbraco community + * Creator Link: https://docs.umbraco.com/umbraco-cms/extending/language-files + * + * Language Alias: fr_ch + * Language Int Name: French Switzerland (FR-CH) + * Language Local Name: Français Suisse (FR-CH) + * Language LCID: 12 + * Language Culture: fr-CH + */ +import fr_fr from './fr-fr.js'; +import type { UmbLocalizationDictionary } from '@umbraco-cms/backoffice/localization-api'; + +export default { + // NOTE: Imports and re-exports the French (France) localizations, so that any French (Switzerland) localizations can be override them. [LK] + ...fr_fr, +} as UmbLocalizationDictionary; diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/it-ch.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/it-ch.ts new file mode 100644 index 0000000000..bdba6cf8c1 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/it-ch.ts @@ -0,0 +1,17 @@ +/** + * Creator Name: The Umbraco community + * Creator Link: https://docs.umbraco.com/umbraco-cms/extending/language-files + * + * Language Alias: it_ch + * Language Int Name: Italian Switzerland (IT-CH) + * Language Local Name: Italiano Svizerra (IT-CH) + * Language LCID: 16 + * Language Culture: it-CH + */ +import it_it from './it-it.js'; +import type { UmbLocalizationDictionary } from '@umbraco-cms/backoffice/localization-api'; + +export default { + // NOTE: Imports and re-exports the Italian (Italy) localizations, so that any Italian (Switzerland) localizations can be override them. [LK] + ...it_it, +} as UmbLocalizationDictionary; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts index 576c677f65..e8741a538a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/localization/manifests.ts @@ -61,6 +61,16 @@ export const manifests: Array = [ }, js: () => import('../../../assets/lang/de-de.js'), }, + { + type: 'localization', + alias: 'Umb.Localization.De-CH', + weight: -100, + name: 'Deutsch (Schweiz)', + meta: { + culture: 'de-ch', + }, + js: () => import('../../../assets/lang/de-ch.js'), + }, { type: 'localization', alias: 'Umb.Localization.En-GB', @@ -101,6 +111,16 @@ export const manifests: Array = [ }, js: () => import('../../../assets/lang/fr-fr.js'), }, + { + type: 'localization', + alias: 'Umb.Localization.Fr-CH', + weight: -100, + name: 'Français (Suisse)', + meta: { + culture: 'fr-ch', + }, + js: () => import('../../../assets/lang/fr-ch.js'), + }, { type: 'localization', alias: 'Umb.Localization.He-IL', @@ -131,6 +151,16 @@ export const manifests: Array = [ }, js: () => import('../../../assets/lang/it-it.js'), }, + { + type: 'localization', + alias: 'Umb.Localization.It-CH', + weight: -100, + name: 'Italiano (Svizerra)', + meta: { + culture: 'it-ch', + }, + js: () => import('../../../assets/lang/it-ch.js'), + }, { type: 'localization', alias: 'Umb.Localization.Ja-JP',