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
This commit is contained in:
Piotr Jamróz 2024-02-28 09:19:20 +01:00 committed by GitHub
parent 3901077f39
commit ecb8447a7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<Props> {
name = data.refId || `${i}`;
}
return name ? (
<Trans i18nKey="explore.table.title-with-name">Table - {{ name }}</Trans>
) : (
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() {