diff --git a/.betterer.results b/.betterer.results index 629774cfa72..c9ce73693f2 100644 --- a/.betterer.results +++ b/.betterer.results @@ -3212,10 +3212,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] ], - "public/app/features/dashboard-scene/edit-pane/DashboardEditPane.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] - ], "public/app/features/dashboard-scene/embedding/EmbeddedDashboardTestPage.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], @@ -3389,40 +3385,6 @@ exports[`better eslint`] = { "public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx:5381": [ [0, 0, 0, "\'@grafana/data/src/text/sanitize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] ], - "public/app/features/dashboard-scene/scene/NavToolbarActions.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "7"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "8"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "9"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "10"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "11"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "12"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "13"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "14"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "15"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "16"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "17"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "18"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "19"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "20"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "21"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "22"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "23"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "24"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "25"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "26"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "27"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "28"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "29"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "30"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "31"] - ], "public/app/features/dashboard-scene/scene/PanelLinks.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], diff --git a/public/app/features/dashboard-scene/edit-pane/DashboardEditPane.tsx b/public/app/features/dashboard-scene/edit-pane/DashboardEditPane.tsx index 497b45bf109..35f2ce7123b 100644 --- a/public/app/features/dashboard-scene/edit-pane/DashboardEditPane.tsx +++ b/public/app/features/dashboard-scene/edit-pane/DashboardEditPane.tsx @@ -5,6 +5,7 @@ import { useEffect, useRef } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { SceneObjectState, SceneObjectBase, SceneObject, sceneGraph, useSceneObjectState } from '@grafana/scenes'; import { ElementSelectionContextItem, ElementSelectionContextState, ToolbarButton, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { isInCloneChain } from '../utils/clone'; import { getDashboardSceneFor } from '../utils/utils'; @@ -165,12 +166,12 @@ export function DashboardEditPaneRenderer({ editPane, isCollapsed, onToggleColla <>
diff --git a/public/app/features/dashboard-scene/edit-pane/DashboardEditableElement.tsx b/public/app/features/dashboard-scene/edit-pane/DashboardEditableElement.tsx index 1e458430481..4699e8c1c3f 100644 --- a/public/app/features/dashboard-scene/edit-pane/DashboardEditableElement.tsx +++ b/public/app/features/dashboard-scene/edit-pane/DashboardEditableElement.tsx @@ -1,6 +1,7 @@ import { useMemo } from 'react'; import { Input, TextArea } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor'; import { OptionsPaneItemDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor'; @@ -22,13 +23,13 @@ export class DashboardEditableElement implements EditableDashboardElement { const dashboardOptions = useMemo(() => { return new OptionsPaneCategoryDescriptor({ - title: 'Dashboard options', + title: t('dashboard.options.title', 'Dashboard options'), id: 'dashboard-options', isOpenDefault: true, }) .addItem( new OptionsPaneItemDescriptor({ - title: 'Title', + title: t('dashboard.options.title-option', 'Title'), render: function renderTitle() { return ; }, @@ -36,7 +37,7 @@ export class DashboardEditableElement implements EditableDashboardElement { ) .addItem( new OptionsPaneItemDescriptor({ - title: 'Description', + title: t('dashboard.options.description', 'Description'), render: function renderTitle() { return ; }, diff --git a/public/app/features/dashboard-scene/edit-pane/VizPanelEditableElement.tsx b/public/app/features/dashboard-scene/edit-pane/VizPanelEditableElement.tsx index 762dcb5f745..732ac9df825 100644 --- a/public/app/features/dashboard-scene/edit-pane/VizPanelEditableElement.tsx +++ b/public/app/features/dashboard-scene/edit-pane/VizPanelEditableElement.tsx @@ -1,8 +1,8 @@ -import { useMemo } from 'react'; +import { ReactNode, useMemo } from 'react'; import { sceneGraph, VizPanel } from '@grafana/scenes'; import { Button } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { t, Trans } from 'app/core/internationalization'; import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor'; import { OptionsPaneItemDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor'; import { getVisualizationOptions2 } from 'app/features/dashboard/components/PanelEditor/getVisualizationOptions'; @@ -29,13 +29,13 @@ export class VizPanelEditableElement implements EditableDashboardElement, BulkAc const panelOptions = useMemo(() => { return new OptionsPaneCategoryDescriptor({ - title: 'Panel options', + title: t('dashboard.viz-panel.options.title', 'Panel options'), id: 'panel-options', isOpenDefault: true, }) .addItem( new OptionsPaneItemDescriptor({ - title: 'Title', + title: t('dashboard.viz-panel.options.title-option', 'Title'), value: panel.state.title, popularRank: 1, render: function renderTitle() { @@ -45,7 +45,7 @@ export class VizPanelEditableElement implements EditableDashboardElement, BulkAc ) .addItem( new OptionsPaneItemDescriptor({ - title: 'Description', + title: t('dashboard.viz-panel.options.description', 'Description'), value: panel.state.description, render: function renderDescription() { return ; @@ -54,7 +54,7 @@ export class VizPanelEditableElement implements EditableDashboardElement, BulkAc ) .addItem( new OptionsPaneItemDescriptor({ - title: 'Transparent background', + title: t('dashboard.viz-panel.options.transparent-background', 'Transparent background'), render: function renderTransparent() { return ; }, @@ -104,7 +104,7 @@ export class VizPanelEditableElement implements EditableDashboardElement, BulkAc layout.removePanel(this.panel); }; - public renderActions(): React.ReactNode { + public renderActions(): ReactNode { return ( <> ), }); @@ -191,7 +190,7 @@ export function ToolbarActions({ dashboard }: Props) { }} data-testid={selectors.components.PageToolbar.itemButton('add_row')} > - Row + Row ), }); @@ -211,7 +210,7 @@ export function ToolbarActions({ dashboard }: Props) { DashboardInteractions.toolbarAddButtonClicked({ item: 'add_library_panel' }); }} > - Import + Import ), }); @@ -363,7 +362,7 @@ export function ToolbarActions({ dashboard }: Props) { icon="arrow-left" data-testid={selectors.components.NavToolbar.editDashboard.backToDashboardButton} > - Back to dashboard + Back to dashboard ), }); @@ -384,7 +383,7 @@ export function ToolbarActions({ dashboard }: Props) { icon="arrow-left" data-testid={selectors.components.NavToolbar.editDashboard.backToDashboardButton} > - Back to dashboard + Back to dashboard ), }); @@ -396,7 +395,7 @@ export function ToolbarActions({ dashboard }: Props) { render: () => ( ), }); @@ -419,14 +418,14 @@ export function ToolbarActions({ dashboard }: Props) { onClick={() => { dashboard.onEnterEditMode(); }} - tooltip="Enter edit mode" + tooltip={t('dashboard.toolbar.edit.tooltip', 'Enter edit mode')} key="edit" className={styles.buttonWithExtraMargin} variant={config.featureToggles.newDashboardSharingComponent ? 'secondary' : 'primary'} size="sm" data-testid={selectors.components.NavToolbar.editDashboard.editButton} > - Edit + Edit ), }); @@ -440,14 +439,14 @@ export function ToolbarActions({ dashboard }: Props) { dashboard.onEnterEditMode(); dashboard.setState({ editable: true, meta: { ...meta, canEdit: true } }); }} - tooltip="This dashboard was marked as read only" + tooltip={t('dashboard.toolbar.enter-edit-mode.tooltip', 'This dashboard was marked as read only')} key="edit" className={styles.buttonWithExtraMargin} variant="secondary" size="sm" data-testid={selectors.components.NavToolbar.editDashboard.editButton} > - Make editable + Make editable ), }); @@ -472,14 +471,14 @@ export function ToolbarActions({ dashboard }: Props) { onClick={() => { dashboard.onOpenSettings(); }} - tooltip="Dashboard settings" + tooltip={t('dashboard.toolbar.dashboard-settings.tooltip', 'Dashboard settings')} fill="text" size="sm" key="settings" variant="secondary" data-testid={selectors.components.NavToolbar.editDashboard.settingsButton} > - Settings + Settings ), }); @@ -490,14 +489,14 @@ export function ToolbarActions({ dashboard }: Props) { render: () => ( ), }); @@ -508,7 +507,11 @@ export function ToolbarActions({ dashboard }: Props) { render: () => ( ), }); @@ -527,14 +534,14 @@ export function ToolbarActions({ dashboard }: Props) { render: () => ( ), }); @@ -545,14 +552,14 @@ export function ToolbarActions({ dashboard }: Props) { render: () => ( ), }); @@ -563,14 +570,14 @@ export function ToolbarActions({ dashboard }: Props) { render: () => ( ), }); @@ -587,13 +594,13 @@ export function ToolbarActions({ dashboard }: Props) { dashboard.openSaveDrawer({}); }} className={styles.buttonWithExtraMargin} - tooltip="Save changes" + tooltip={t('dashboard.toolbar.save-dashboard.tooltip', 'Save changes')} key="save" size="sm" - variant={'primary'} + variant="primary" data-testid={selectors.components.NavToolbar.editDashboard.saveButton} > - Save dashboard + Save dashboard ); } @@ -606,12 +613,12 @@ export function ToolbarActions({ dashboard }: Props) { dashboard.openSaveDrawer({ saveAsCopy: true }); }} className={styles.buttonWithExtraMargin} - tooltip="Save as copy" + tooltip={t('dashboard.toolbar.save-dashboard-copy.tooltip', 'Save as copy')} key="save" size="sm" variant={isDirty ? 'primary' : 'secondary'} > - Save as copy + Save as copy ); } @@ -620,14 +627,14 @@ export function ToolbarActions({ dashboard }: Props) { const menu = ( { dashboard.openSaveDrawer({}); }} /> { dashboard.openSaveDrawer({ saveAsCopy: true }); @@ -642,16 +649,16 @@ export function ToolbarActions({ dashboard }: Props) { onClick={() => { dashboard.openSaveDrawer({}); }} - tooltip="Save changes" + tooltip={t('dashboard.toolbar.save-dashboard.tooltip', 'Save changes')} size="sm" data-testid={selectors.components.NavToolbar.editDashboard.saveButton} variant={isDirty ? 'primary' : 'secondary'} > - Save dashboard + Save dashboard