From 0fbb51ab08051b86ee3161cc3c96682bd7fdf847 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Thu, 3 Apr 2025 09:26:24 +0100 Subject: [PATCH] Internationalisation: More automatic markup (#103260) * easy markup * final tweaks, betterer + translations * fix unit test --- .betterer.results | 244 +++--------------- .../AddLibraryPanelWidget.tsx | 9 +- .../AnnotationSettingsEdit.tsx | 52 +++- .../AnnotationSettingsList.tsx | 24 +- .../dashboard/components/DashNav/DashNav.tsx | 2 +- .../DashboardLoading/DashboardLoading.tsx | 3 +- .../components/DashboardRow/DashboardRow.tsx | 10 +- .../DashboardSettings/DashboardSettings.tsx | 10 +- .../DashboardSettings/TimePickerSettings.tsx | 1 + .../components/GenAI/GenAIHistory.tsx | 8 +- .../GenAI/MinimalisticPagination.tsx | 5 +- .../components/HelpWizard/HelpWizard.tsx | 24 +- .../PanelEditor/DynamicConfigValueEditor.tsx | 10 +- .../PanelEditor/OptionsPaneOptions.tsx | 8 +- .../PanelEditor/OverrideCategoryTitle.tsx | 5 +- .../components/PanelEditor/PanelEditor.tsx | 32 ++- .../PanelEditor/PanelEditorTableView.tsx | 3 +- .../PanelEditor/PanelNotSupported.tsx | 3 +- .../PanelEditor/VisualizationButton.tsx | 8 +- .../PanelEditor/VisualizationSelectPane.tsx | 5 +- .../PanelEditor/getFieldOverrideElements.tsx | 8 +- .../PublicDashboardNotAvailable.tsx | 3 +- .../RowOptions/RowOptionsButton.tsx | 3 +- .../components/RowOptions/RowOptionsForm.tsx | 11 +- .../components/RowOptions/RowOptionsModal.tsx | 9 +- .../SaveDashboard/DashboardValidation.tsx | 24 +- .../SaveDashboard/SaveDashboardButton.tsx | 5 +- .../SaveDashboard/SaveDashboardDiff.tsx | 11 +- .../SaveDashboard/SaveDashboardErrorProxy.tsx | 16 +- .../SaveDashboard/UnsavedChangesModal.tsx | 11 +- .../forms/SaveDashboardAsForm.tsx | 34 ++- .../forms/SaveDashboardForm.test.tsx | 2 +- .../SaveDashboard/forms/SaveDashboardForm.tsx | 25 +- .../forms/SaveProvisionedDashboardForm.tsx | 9 +- .../EmailSharingConfiguration.tsx | 3 +- .../components/ShareModal/ViewJsonModal.tsx | 9 +- .../dashboard/components/SubMenu/SubMenu.tsx | 7 +- .../TransformationEditor.tsx | 15 +- .../TransformationFilter.tsx | 3 +- .../TransformationOperationRow.tsx | 17 +- .../TransformationPicker.tsx | 10 +- .../TransformationPickerNg.tsx | 12 +- .../TransformationsEditor.tsx | 18 +- .../VersionHistory/RevertDashboardModal.tsx | 3 +- .../VersionHistoryComparison.tsx | 6 +- .../VersionHistory/VersionHistoryTable.tsx | 19 +- .../dashboard/containers/SoloPanelPage.tsx | 7 +- .../dashboard/dashgrid/PanelLinks.tsx | 8 +- public/locales/en-US/grafana.json | 237 +++++++++++++++++ 49 files changed, 661 insertions(+), 350 deletions(-) diff --git a/.betterer.results b/.betterer.results index 53e63d02c22..618f0476ac2 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2782,40 +2782,17 @@ exports[`better eslint`] = { "public/app/features/dashboard/api/v1.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.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/components/AddLibraryPanelWidget/index.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`./AddLibraryPanelWidget\`)", "0"] ], "public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "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. Wrap text with ", "12"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "13"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "14"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "15"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsList.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. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/dashboard/components/AnnotationSettings/index.tsx:5381": [ [0, 0, 0, "Do not re-export imported variable (\`./AnnotationSettingsEdit\`)", "0"], @@ -2845,16 +2822,14 @@ exports[`better eslint`] = { [0, 0, 0, "Do not re-export imported variable (\`./DashboardExporter\`)", "0"] ], "public/app/features/dashboard/components/DashNav/DashNav.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()", "0"] ], "public/app/features/dashboard/components/DashNav/index.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`DashNav\`)", "0"] ], "public/app/features/dashboard/components/DashboardLoading/DashboardLoading.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] + [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"] ], "public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.test.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -2874,22 +2849,12 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/dashboard/components/DashboardRow/index.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`./DashboardRow\`)", "0"] ], - "public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] - ], - "public/app/features/dashboard/components/DashboardSettings/TimePickerSettings.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], @@ -2897,31 +2862,18 @@ exports[`better eslint`] = { [0, 0, 0, "Do not re-export imported variable (\`./DashboardSettings\`)", "0"] ], "public/app/features/dashboard/components/GenAI/GenAIHistory.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. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/dashboard/components/GenAI/MinimalisticPagination.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. Wrap text with ", "2"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/dashboard/components/HelpWizard/HelpWizard.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. Wrap text with ", "10"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "11"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "12"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "13"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] ], "public/app/features/dashboard/components/Inspector/PanelInspector.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] @@ -2931,8 +2883,7 @@ exports[`better eslint`] = { [0, 0, 0, "Do not re-export imported variable (\`./LinkSettingsList\`)", "1"] ], "public/app/features/dashboard/components/PanelEditor/DynamicConfigValueEditor.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] + [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], "public/app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -2941,47 +2892,18 @@ exports[`better eslint`] = { "public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.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. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/dashboard/components/PanelEditor/OverrideCategoryTitle.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "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, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], "public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], [0, 0, 0, "Do not use any type assertions.", "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. Wrap text with ", "8"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "9"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "10"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "11"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "12"] - ], - "public/app/features/dashboard/components/PanelEditor/PanelEditorTableView.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], - "public/app/features/dashboard/components/PanelEditor/PanelNotSupported.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] - ], - "public/app/features/dashboard/components/PanelEditor/VisualizationButton.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"] ], "public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.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, "Use data-testid for E2E selectors instead of aria-label", "2"] - ], - "public/app/features/dashboard/components/PanelEditor/getFieldOverrideElements.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, "Use data-testid for E2E selectors instead of aria-label", "0"] ], "public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -2994,86 +2916,34 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "3"], [0, 0, 0, "Unexpected any. Specify a different type.", "4"] ], - "public/app/features/dashboard/components/PublicDashboardNotAvailable/PublicDashboardNotAvailable.tsx:5381": [ + "public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/dashboard/components/RowOptions/RowOptionsButton.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], - "public/app/features/dashboard/components/RowOptions/RowOptionsForm.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. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] - ], - "public/app/features/dashboard/components/RowOptions/RowOptionsModal.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], - "public/app/features/dashboard/components/SaveDashboard/DashboardValidation.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. Wrap text with ", "3"] - ], "public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "3"] + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"] ], "public/app/features/dashboard/components/SaveDashboard/SaveDashboardDiff.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. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/dashboard/components/SaveDashboard/SaveDashboardDrawer.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/components/SaveDashboard/SaveDashboardErrorProxy.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. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] - ], - "public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] - ], - "public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.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. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.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. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "6"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "7"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "8"] + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"] ], "public/app/features/dashboard/components/SaveDashboard/forms/SaveProvisionedDashboardForm.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -3087,9 +2957,6 @@ exports[`better eslint`] = { "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/Configuration.tsx:5381": [ [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], - "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/EmailSharingConfiguration.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/AcknowledgeCheckboxes.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"] @@ -3097,73 +2964,34 @@ exports[`better eslint`] = { "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/dashboard/components/ShareModal/ViewJsonModal.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], - "public/app/features/dashboard/components/SubMenu/SubMenu.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], - "public/app/features/dashboard/components/TransformationsEditor/TransformationEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] - ], - "public/app/features/dashboard/components/TransformationsEditor/TransformationFilter.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/dashboard/components/TransformationsEditor/TransformationOperationRow.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()", "1"] ], "public/app/features/dashboard/components/TransformationsEditor/TransformationPicker.tsx:5381": [ [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "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. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] - ], - "public/app/features/dashboard/components/TransformationsEditor/TransformationPickerNg.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. Wrap text with ", "2"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "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. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/dashboard/components/VersionHistory/RevertDashboardModal.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/dashboard/components/VersionHistory/VersionHistoryComparison.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/dashboard/components/VersionHistory/VersionHistoryTable.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -3187,10 +3015,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/dashboard/containers/SoloPanelPage.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] - ], - "public/app/features/dashboard/dashgrid/PanelLinks.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/dashboard/dashgrid/SeriesVisibilityConfigFactory.ts:5381": [ diff --git a/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx b/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx index 22dbeca1de3..f5f6b4e9c06 100644 --- a/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx +++ b/public/app/features/dashboard/components/AddLibraryPanelWidget/AddLibraryPanelWidget.tsx @@ -5,7 +5,7 @@ import tinycolor from 'tinycolor2'; import { GrafanaTheme2 } from '@grafana/data'; import { LibraryPanel } from '@grafana/schema'; import { IconButton, useStyles2 } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { LibraryPanelsSearch, @@ -49,10 +49,13 @@ export const AddLibraryPanelWidget = ({ panel, dashboard }: Props) => {
diff --git a/public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx b/public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx index 6349e5ccd18..5a9dae809c8 100644 --- a/public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx +++ b/public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx @@ -28,7 +28,7 @@ import { } from '@grafana/ui'; import { ColorValueEditor } from 'app/core/components/OptionsUI/color'; import config from 'app/core/config'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import StandardAnnotationQueryEditor from 'app/features/annotations/components/StandardAnnotationQueryEditor'; import { AngularEditorLoader } from 'app/features/dashboard-scene/settings/annotations/AngularEditorLoader'; import { DataSourcePicker } from 'app/features/datasources/components/picker/DataSourcePicker'; @@ -178,7 +178,7 @@ export const AnnotationSettingsEdit = ({ editIdx, dashboard }: Props) => { return (
- + { onChange={onNameChange} /> - + {!ds?.meta.annotations && ( - + The selected data source does not support annotations. Please select a different data source. )} - + - + - + <> @@ -143,7 +143,7 @@ export const GenAIHistory = ({
- + This content is AI-generated using the{' '} onNavigate(currentPage - 1)} disabled={currentPage === 1} /> @@ -37,7 +38,7 @@ export const MinimalisticPagination = ({ onNavigate(currentPage + 1)} disabled={currentPage === numberOfPages} /> diff --git a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx index 69234f1b9b2..906c1120559 100644 --- a/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx +++ b/public/app/features/dashboard/components/HelpWizard/HelpWizard.tsx @@ -20,7 +20,7 @@ import { Icon, Stack, } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { contextSrv } from 'app/core/services/context_srv'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { AccessControlAction } from 'app/types'; @@ -119,13 +119,13 @@ export function HelpWizard({ panel, plugin, onClose }: Props) { {currentTab === SnapshotTab.Data && (
- + - + {warning && ( @@ -49,9 +50,11 @@ export const RowOptionsForm = ({ repeat, title, warning, onUpdate, onCancel }: P )} + - )} diff --git a/public/app/features/dashboard/components/RowOptions/RowOptionsModal.tsx b/public/app/features/dashboard/components/RowOptions/RowOptionsModal.tsx index b16e9b6403d..d20821e01a2 100644 --- a/public/app/features/dashboard/components/RowOptions/RowOptionsModal.tsx +++ b/public/app/features/dashboard/components/RowOptions/RowOptionsModal.tsx @@ -2,6 +2,7 @@ import { css } from '@emotion/css'; import * as React from 'react'; import { Modal, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { OnRowOptionsUpdate, RowOptionsForm } from './RowOptionsForm'; @@ -17,7 +18,13 @@ export const RowOptionsModal = ({ repeat, title, onDismiss, onUpdate, warning }: const styles = useStyles2(getStyles); return ( - + ); diff --git a/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx b/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx index bfe729fd47e..6a963e62833 100644 --- a/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/DashboardValidation.tsx @@ -5,6 +5,7 @@ import { useAsync } from 'react-use'; import { GrafanaTheme2 } from '@grafana/data'; import { FetchError } from '@grafana/runtime'; import { Alert, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { backendSrv } from 'app/core/services/backend_srv'; import { DashboardModel } from '../../state/DashboardModel'; @@ -36,11 +37,22 @@ function DashboardValidation({ dashboard }: DashboardValidationProps) { let alert: React.ReactNode; if (loading) { - alert = ; + alert = ( + + ); } else if (value) { if (!value.isValid) { alert = ( - +

Validation is provided for development purposes and should be safe to ignore. If you are a Grafana developer, consider checking and updating the dashboard schema @@ -52,7 +64,13 @@ function DashboardValidation({ dashboard }: DashboardValidationProps) { } else { const errorMessage = error?.message ?? 'Unknown error'; alert = ( - +

{errorMessage}

); diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx index baf405f7381..ed3f3bd6bf1 100644 --- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardButton.tsx @@ -1,6 +1,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { reportInteraction } from '@grafana/runtime'; import { Button, ButtonVariant, ComponentSize, ModalsController } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { SaveDashboardDrawer } from './SaveDashboardDrawer'; @@ -28,7 +29,7 @@ export const SaveDashboardButton = ({ dashboard, onSaveSuccess, size }: SaveDash }} aria-label={selectors.pages.Dashboard.Settings.General.saveDashBoard} > - Save dashboard + Save dashboard ); }} @@ -58,7 +59,7 @@ export const SaveDashboardAsButton = ({ dashboard, onClick, onSaveSuccess, varia variant={variant} aria-label={selectors.pages.Dashboard.Settings.General.saveAsDashBoard} > - Save as + Save as ); }} diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDiff.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDiff.tsx index 0eeac22b646..e3b69b64cc8 100644 --- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDiff.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardDiff.tsx @@ -2,6 +2,7 @@ import { ReactElement } from 'react'; import { useAsync } from 'react-use'; import { Alert, Box, Spinner, Stack } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { Diffs } from 'app/features/dashboard-scene/settings/version-history/utils'; import { DiffGroup } from '../../../dashboard-scene/settings/version-history/DiffGroup'; @@ -95,12 +96,18 @@ export const SaveDashboardDiff = ({ {!hasMigratedToV2 && value && value.schemaChange && value.schemaChange} {value && value.showDiffs && value.diffs} -

Full JSON diff

+

+ Full JSON diff +

{value.jsonView}
) : ( - No changes in the dashboard JSON + + + No changes in the dashboard JSON + + )} ); diff --git a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx index 547ceebde7a..46e2648ca00 100644 --- a/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/SaveDashboardErrorProxy.tsx @@ -37,7 +37,7 @@ export const SaveDashboardErrorProxy = ({ {error.data && error.data.status === 'version-mismatch' && ( Someone else has updated this dashboard
Would you still like to save this dashboard? @@ -74,7 +74,7 @@ export const SaveDashboardErrorProxy = ({ ) : ( A dashboard with the same name in selected folder already exists.
@@ -109,7 +109,13 @@ const ConfirmPluginDashboardSaveModal = ({ onDismiss, dashboard }: SaveDashboard const styles = useStyles2(getConfirmPluginDashboardSaveModalStyles); return ( - +
Your changes will be lost when you update the plugin.
@@ -119,7 +125,7 @@ const ConfirmPluginDashboardSaveModal = ({ onDismiss, dashboard }: SaveDashboard
diff --git a/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx b/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx index 298869f0c76..051075b05d7 100644 --- a/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/UnsavedChangesModal.tsx @@ -1,6 +1,7 @@ import { css } from '@emotion/css'; import { Button, Modal } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { DashboardModel } from '../../state/DashboardModel'; @@ -17,20 +18,22 @@ export const UnsavedChangesModal = ({ dashboard, onSaveSuccess, onDiscard, onDis return ( -
Do you want to save your changes?
+
+ Do you want to save your changes? +
diff --git a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx index 5d8cdfc0755..77a3e02a7c4 100644 --- a/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx +++ b/public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx @@ -3,6 +3,7 @@ import { ChangeEvent } from 'react'; import { config } from '@grafana/runtime'; import { Button, Input, Switch, Form, Field, InputControl, Label, TextArea, Stack } from '@grafana/ui'; import { FolderPicker } from 'app/core/components/Select/FolderPicker'; +import { Trans, t } from 'app/core/internationalization'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; import { validationSrv } from 'app/features/manage-dashboards/services/ValidationSrv'; @@ -111,7 +112,9 @@ export const SaveDashboardAsForm = ({ - + {config.featureToggles.dashgpt && isNew && ( field.onChange(title)} /> )} @@ -123,7 +126,10 @@ export const SaveDashboardAsForm = ({ ) => field.onChange(e.target.value)} - aria-label="Save dashboard title field" + aria-label={t( + 'dashboard.save-dashboard-as-form.aria-label-save-dashboard-title-field', + 'Save dashboard title field' + )} autoFocus /> @@ -139,7 +145,9 @@ export const SaveDashboardAsForm = ({ - + {config.featureToggles.dashgpt && isNew && ( field.onChange(description)} /> )} @@ -151,7 +159,10 @@ export const SaveDashboardAsForm = ({