From 8ff905f88029a2a0d8e8a0ddf3c6fc34633618a5 Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 2 Oct 2024 16:18:57 -0700 Subject: [PATCH] Fix dynamic uses of i18n in core (#8392) * Fix dynamic uses of i18n in core Signed-off-by: Miki * Changeset file for PR #8392 created/updated --------- Signed-off-by: Miki Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/8392.yml | 2 ++ src/core/public/i18n/i18n_eui_mapping.tsx | 2 +- src/core/server/rendering/views/template.tsx | 7 +++++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/8392.yml diff --git a/changelogs/fragments/8392.yml b/changelogs/fragments/8392.yml new file mode 100644 index 000000000000..618bfdf06517 --- /dev/null +++ b/changelogs/fragments/8392.yml @@ -0,0 +1,2 @@ +fix: +- Fix dynamic uses of i18n in core ([#8392](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8392)) \ No newline at end of file diff --git a/src/core/public/i18n/i18n_eui_mapping.tsx b/src/core/public/i18n/i18n_eui_mapping.tsx index d3294085e096..5196199c6804 100644 --- a/src/core/public/i18n/i18n_eui_mapping.tsx +++ b/src/core/public/i18n/i18n_eui_mapping.tsx @@ -315,7 +315,7 @@ export const getEuiContextMapping = () => { ), 'euiFilterButton.filterBadge': ({ count, hasActiveFilters }: EuiValues) => i18n.translate('core.euiFilterButton.filterBadge', { - defaultMessage: '${count} ${filterCountLabel} filters', + defaultMessage: '{count} {filterCountLabel} filters', values: { count, filterCountLabel: hasActiveFilters ? 'active' : 'available' }, }), 'euiForm.addressFormErrors': i18n.translate('core.euiForm.addressFormErrors', { diff --git a/src/core/server/rendering/views/template.tsx b/src/core/server/rendering/views/template.tsx index 992cd117be6a..bb5fd83d74ea 100644 --- a/src/core/server/rendering/views/template.tsx +++ b/src/core/server/rendering/views/template.tsx @@ -170,11 +170,14 @@ export const Template: FunctionComponent = ({
{i18n('core.ui.welcomeMessage', { - defaultMessage: `Loading ${applicationTitle}`, + defaultMessage: 'Loading {applicationTitle}', + values: { applicationTitle }, })}
{/* Show a progress bar if a static custom branded logo is used */}