From b77e7ca1d0c068ab28ec53a7f00be6f085e48cb0 Mon Sep 17 00:00:00 2001 From: JC Franco Date: Mon, 6 Nov 2023 09:42:42 -0800 Subject: [PATCH] refactor(card)!: remove deprecated `deselected` message (#8099) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Related Issue:** #6660 ## Summary BREAKING CHANGE: Removed the `deselect` message property – this property was deprecated in #6657 as it is no longer being rendered. --- .../src/components/card/assets/card/t9n/messages.json | 1 - .../src/components/card/assets/card/t9n/messages_en.json | 1 - packages/calcite-components/support/generateT9nDocsJSON.ts | 7 ++++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/calcite-components/src/components/card/assets/card/t9n/messages.json b/packages/calcite-components/src/components/card/assets/card/t9n/messages.json index baaf3628cba..eac24c88066 100644 --- a/packages/calcite-components/src/components/card/assets/card/t9n/messages.json +++ b/packages/calcite-components/src/components/card/assets/card/t9n/messages.json @@ -1,5 +1,4 @@ { "select": "Selectable card", - "deselect": "Deselect", "loading": "Loading" } diff --git a/packages/calcite-components/src/components/card/assets/card/t9n/messages_en.json b/packages/calcite-components/src/components/card/assets/card/t9n/messages_en.json index baaf3628cba..eac24c88066 100644 --- a/packages/calcite-components/src/components/card/assets/card/t9n/messages_en.json +++ b/packages/calcite-components/src/components/card/assets/card/t9n/messages_en.json @@ -1,5 +1,4 @@ { "select": "Selectable card", - "deselect": "Deselect", "loading": "Loading" } diff --git a/packages/calcite-components/support/generateT9nDocsJSON.ts b/packages/calcite-components/support/generateT9nDocsJSON.ts index adcb5c27a89..39b59a26706 100755 --- a/packages/calcite-components/support/generateT9nDocsJSON.ts +++ b/packages/calcite-components/support/generateT9nDocsJSON.ts @@ -32,7 +32,12 @@ const messagesFile = JSON.parse(await readFile(resolve(t9nPath, messagesFilename), { encoding: "utf-8" })); for (const [key, value] of Object.entries(messagesFile)) { - data[component][key][lang] = value; + const translationEntries = data[component][key]; + + // translation bundles might still have references to strings removed in the `main` and `en` bundle + if (translationEntries) { + translationEntries[lang] = value; + } } } }