From ecb8447a7fbad847ad2df6831df9981d2774d95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Wed, 28 Feb 2024 09:19:20 +0100 Subject: [PATCH] Explore: Translate table title in runtime to get a better test id (#83236) * Explore: Translate table title in runtime to get a better test id * Fix escaping * Retrigger the build * Prettify --- public/app/features/explore/Table/TableContainer.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/public/app/features/explore/Table/TableContainer.tsx b/public/app/features/explore/Table/TableContainer.tsx index 5ecc838664c..6626977824b 100644 --- a/public/app/features/explore/Table/TableContainer.tsx +++ b/public/app/features/explore/Table/TableContainer.tsx @@ -7,7 +7,7 @@ import { getTemplateSrv } from '@grafana/runtime'; import { TimeZone } from '@grafana/schema'; import { Table, AdHocFilterItem, PanelChrome, withTheme2, Themeable2 } from '@grafana/ui'; import { config } from 'app/core/config'; -import { t, Trans } from 'app/core/internationalization'; +import { t } from 'app/core/internationalization'; import { hasDeprecatedParentRowIndex, migrateFromParentRowIndexToNestedFrames, @@ -59,11 +59,9 @@ export class TableContainer extends PureComponent { name = data.refId || `${i}`; } - return name ? ( - Table - {{ name }} - ) : ( - t('explore.table.title', 'Table') - ); + return name + ? t('explore.table.title-with-name', 'Table - {{name}}', { name, interpolation: { escapeValue: false } }) + : t('explore.table.title', 'Table'); } render() {