From 9ed10c6050b6e3e0ce2f14ff9146b73326c20378 Mon Sep 17 00:00:00 2001 From: Miki Date: Fri, 27 Sep 2024 17:00:50 -0700 Subject: [PATCH] Fix dynamic uses of i18n Signed-off-by: Miki --- CHANGELOG.md | 1 + .../incontext_insight/generate_popover_body.tsx | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f28e0b..13b2eadf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - feat: register the AI actions to query controls in discover([#327](https://github.com/opensearch-project/dashboards-assistant/pull/327)) - fix: t2viz ux improvements([#330](https://github.com/opensearch-project/dashboards-assistant/pull/330)) - feat: report metrics for text to visualization([#312](https://github.com/opensearch-project/dashboards-assistant/pull/312)) +- fix: Fix dynamic uses of i18n([#335](https://github.com/opensearch-project/dashboards-assistant/pull/335)) ### 📈 Features/Enhancements diff --git a/public/components/incontext_insight/generate_popover_body.tsx b/public/components/incontext_insight/generate_popover_body.tsx index 76f5950f..7c2c428d 100644 --- a/public/components/incontext_insight/generate_popover_body.tsx +++ b/public/components/incontext_insight/generate_popover_body.tsx @@ -261,9 +261,13 @@ export const GeneratePopoverBody: React.FC<{
- {i18n.translate('assistantDashboards.incontextInsight.Summary', { - defaultMessage: showInsight ? 'Insight With RAG' : 'Summary', - })} + {showInsight + ? i18n.translate('assistantDashboards.inContextInsight.withRAGSummary', { + defaultMessage: 'Insight With RAG', + }) + : i18n.translate('assistantDashboards.inContextInsight.summary', { + defaultMessage: 'Summary', + })}