From 119d5897ea541f0678b94e79c066aa062bbea3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Thu, 15 May 2025 09:17:14 +0200 Subject: [PATCH] i18n: imports use @grafana/i18n (#105177) * i18n: everything should target @grafana/i18n * wip * chore: updates after PR feedback * Trigger build * Trigger build * Trigger build * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: skip flaky tests * chore: revert all flaky tests * chore: some incorrect usages of useTranslate --- contribute/internationalization.md | 24 +++--- packages/grafana-i18n/src/i18n.tsx | 3 +- packages/grafana-i18n/src/internal/index.ts | 8 +- public/app/api/clients/provisioning/index.ts | 2 +- public/app/app.ts | 13 +++- .../AccessControl/AddPermission.tsx | 3 +- .../AccessControl/PermissionList.tsx | 2 +- .../AccessControl/PermissionListItem.tsx | 4 +- .../components/AccessControl/Permissions.tsx | 3 +- .../core/components/AppChrome/AppChrome.tsx | 2 +- .../components/AppChrome/AppChromeService.tsx | 2 +- .../ExtensionSidebar/ExtensionToolbarItem.tsx | 5 +- .../AppChrome/History/HistoryContainer.tsx | 3 +- .../AppChrome/History/HistoryWrapper.tsx | 4 +- .../AppChrome/MegaMenu/MegaMenu.tsx | 4 +- .../AppChrome/MegaMenu/MegaMenuHeader.tsx | 3 +- .../AppChrome/MegaMenu/MegaMenuItem.tsx | 3 +- .../AppChrome/MegaMenu/MegaMenuItemText.tsx | 3 +- .../components/AppChrome/MegaMenu/utils.ts | 2 +- .../components/AppChrome/News/NewsDrawer.tsx | 4 +- .../components/AppChrome/News/NewsWrapper.tsx | 4 +- .../OrganizationSelect.tsx | 4 +- .../AppChrome/QuickAdd/QuickAdd.tsx | 5 +- .../ReturnToPrevious/DismissableButton.tsx | 4 +- .../ReturnToPrevious/ReturnToPrevious.tsx | 4 +- .../AppChrome/TopBar/ProfileButton.tsx | 4 +- .../AppChrome/TopBar/SignInLink.tsx | 2 +- .../AppChrome/TopBar/SingleTopBar.tsx | 4 +- .../TopSearchBarCommandPaletteTrigger.tsx | 6 +- .../AppNotifications/AppNotificationItem.tsx | 2 +- .../BouncingLoader/BouncingLoader.tsx | 5 +- .../components/Breadcrumbs/Breadcrumbs.tsx | 5 +- .../components/CloseButton/CloseButton.tsx | 5 +- .../components/EmptyListCTA/EmptyListCTA.tsx | 2 +- .../components/FolderFilter/FolderFilter.tsx | 3 +- public/app/core/components/Footer/Footer.tsx | 2 +- .../ForgottenPassword/ChangePassword.tsx | 3 +- .../ForgottenPassword/ForgottenPassword.tsx | 3 +- .../core/components/FormPrompt/FormPrompt.tsx | 4 +- .../InviteUserButton/InviteUserButton.tsx | 4 +- .../components/Layers/LayerDragDropList.tsx | 5 +- .../app/core/components/Layers/LayerName.tsx | 4 +- .../app/core/components/Login/LoginCtrl.tsx | 2 +- .../app/core/components/Login/LoginForm.tsx | 4 +- .../app/core/components/Login/LoginLayout.tsx | 2 +- .../app/core/components/Login/LoginPage.tsx | 3 +- .../components/Login/LoginServiceButtons.tsx | 2 +- .../Login/PasswordlessConfirmationForm.tsx | 3 +- .../Login/PasswordlessLoginForm.tsx | 4 +- .../app/core/components/Login/UserSignup.tsx | 2 +- .../NestedFolderPicker/FolderRepo.tsx | 4 +- .../NestedFolderPicker/NestedFolderList.tsx | 2 +- .../NestedFolderPicker/NestedFolderPicker.tsx | 3 +- .../components/NestedFolderPicker/Trigger.tsx | 3 +- .../app/core/components/OptionsUI/color.tsx | 5 +- .../core/components/OptionsUI/fieldColor.tsx | 4 +- .../app/core/components/OptionsUI/units.tsx | 4 +- .../core/components/Page/EditableTitle.tsx | 4 +- .../PageNotFound/EntityNotFound.tsx | 2 +- .../PanelTypeFilter/PanelTypeFilter.tsx | 4 +- .../PasswordField/PasswordField.tsx | 5 +- .../core/components/PluginHelp/PluginHelp.tsx | 4 +- .../QueryOperationRowHeader.tsx | 4 +- .../RolePicker/BuiltinRoleSelector.tsx | 2 +- .../RolePicker/RoleMenuGroupOption.tsx | 5 +- .../components/RolePicker/RoleMenuOption.tsx | 4 +- .../components/RolePicker/RolePickerInput.tsx | 3 +- .../components/RolePicker/RolePickerMenu.tsx | 4 +- .../RolePicker/RolePickerSubMenu.tsx | 4 +- .../RolePickerDrawer/RolePickerBadges.tsx | 4 +- .../RolePickerDrawer/RolePickerDrawer.tsx | 4 +- .../components/Select/OldFolderPicker.tsx | 4 +- .../app/core/components/Select/OrgPicker.tsx | 4 +- .../Select/ServiceAccountPicker.tsx | 3 +- .../app/core/components/Select/SortPicker.tsx | 4 +- .../app/core/components/Select/TeamPicker.tsx | 3 +- .../app/core/components/Select/UserPicker.tsx | 3 +- .../SharedPreferences/SharedPreferences.tsx | 4 +- .../app/core/components/Signup/SignupPage.tsx | 4 +- .../core/components/Signup/VerifyEmail.tsx | 4 +- .../core/components/TagFilter/TagFilter.tsx | 4 +- .../core/components/TagFilter/TagOption.tsx | 5 +- .../core/components/Theme/ThemePreview.tsx | 2 +- .../ThemeSelector/ThemeSelectorDrawer.tsx | 10 ++- .../TimePicker/TimePickerWithHistory.tsx | 4 +- .../core/components/Upgrade/UpgradeBox.tsx | 4 +- .../ValidationLabels/ValidationLabels.tsx | 2 +- .../VersionHistoryComparison.tsx | 4 +- public/app/core/components/help/HelpModal.tsx | 8 +- .../app/core/internationalization/index.tsx | 35 --------- .../app/core/navigation/GrafanaRouteError.tsx | 3 +- .../app/core/utils/navBarItem-translations.ts | 2 +- public/app/core/utils/richHistory.ts | 2 +- public/app/core/utils/shortLinks.ts | 2 +- public/app/features/actions/ActionEditor.tsx | 4 +- .../actions/ActionEditorModalContent.tsx | 2 +- public/app/features/actions/ParamsEditor.tsx | 3 +- .../app/features/admin/AdminEditOrgPage.tsx | 4 +- .../admin/AdminFeatureTogglesPage.tsx | 4 +- .../admin/AdminFeatureTogglesTable.tsx | 3 +- .../app/features/admin/AdminListOrgsPage.tsx | 2 +- public/app/features/admin/AdminOrgsTable.tsx | 3 +- public/app/features/admin/AdminSettings.tsx | 2 +- public/app/features/admin/OrgRolePicker.tsx | 4 +- public/app/features/admin/ServerStats.tsx | 2 +- public/app/features/admin/UpgradePage.tsx | 6 +- public/app/features/admin/UserCreatePage.tsx | 3 +- .../app/features/admin/UserLdapSyncInfo.tsx | 3 +- .../app/features/admin/UserListAdminPage.tsx | 4 +- .../features/admin/UserListAnonymousPage.tsx | 3 +- public/app/features/admin/UserListPage.tsx | 31 ++++---- .../DashboardsListModalButton.tsx | 5 +- .../DeleteUserModalButton.tsx | 6 +- .../UserListPublicDashboardPage.tsx | 4 +- public/app/features/admin/UserOrgs.tsx | 3 +- public/app/features/admin/UserPermissions.tsx | 4 +- public/app/features/admin/UserProfile.tsx | 5 +- public/app/features/admin/UserSessions.tsx | 3 +- .../features/admin/Users/AnonUsersTable.tsx | 2 +- .../features/admin/Users/OrgUsersTable.tsx | 6 +- .../app/features/admin/Users/UsersTable.tsx | 6 +- .../admin/ldap/LdapConnectionStatus.tsx | 8 +- public/app/features/admin/ldap/LdapDrawer.tsx | 3 +- .../features/admin/ldap/LdapGroupMapping.tsx | 4 +- public/app/features/admin/ldap/LdapPage.tsx | 3 +- .../features/admin/ldap/LdapSettingsPage.tsx | 5 +- .../app/features/admin/ldap/LdapSyncInfo.tsx | 2 +- .../features/admin/ldap/LdapUserGroups.tsx | 5 +- .../app/features/admin/ldap/LdapUserInfo.tsx | 2 +- .../admin/ldap/LdapUserPermissions.tsx | 2 +- .../features/alerting/unified/AlertGroups.tsx | 4 +- .../alerting/unified/AlertWarning.tsx | 2 +- .../alerting/unified/AlertsFolderView.tsx | 4 +- .../unified/GrafanaRuleQueryViewer.tsx | 6 +- .../unified/NotificationPoliciesPage.tsx | 4 +- .../alerting/unified/PanelAlertTabContent.tsx | 3 +- .../alerting/unified/RedirectToRuleViewer.tsx | 3 +- .../features/alerting/unified/RuleViewer.tsx | 4 +- .../features/alerting/unified/Settings.tsx | 3 +- .../alerting/unified/api/alertRuleApi.ts | 2 +- .../unified/api/alertingFolderActionsApi.ts | 2 +- .../unified/components/AlertLabel.tsx | 4 +- .../unified/components/AlertLabelDropdown.tsx | 4 +- .../unified/components/AlertLabels.tsx | 4 +- .../unified/components/DynamicTable.tsx | 3 +- .../GrafanaAlertmanagerDeliveryWarning.tsx | 3 +- .../unified/components/InfoPausedRule.tsx | 4 +- .../components/InvalidIntervalWarning.tsx | 40 +++++----- .../unified/components/MoreButton.tsx | 5 +- .../components/NoAlertManagerWarning.tsx | 58 ++++++++------ .../unified/components/Provisioning.tsx | 5 +- .../components/alert-groups/AlertDetails.tsx | 4 +- .../components/alert-groups/AlertGroup.tsx | 2 +- .../alert-groups/AlertGroupAlertsTable.tsx | 2 +- .../alert-groups/AlertGroupFilter.tsx | 2 +- .../alert-groups/AlertStateFilter.tsx | 2 +- .../components/alert-groups/GroupBy.tsx | 3 +- .../components/alert-groups/MatcherFilter.tsx | 3 +- .../MuteTimingsSelector.tsx | 3 +- .../bridges/DeclareIncidentButton.tsx | 6 +- .../unified/components/common/DetailText.tsx | 3 +- .../contact-points/ContactPoint.tsx | 2 +- .../contact-points/ContactPointHeader.tsx | 4 +- .../contact-points/ContactPoints.tsx | 7 +- .../DuplicateMessageTemplate.tsx | 5 +- .../contact-points/EditContactPoint.tsx | 3 +- .../contact-points/EditMessageTemplate.tsx | 5 +- .../contact-points/NewMessageTemplate.tsx | 4 +- .../contact-points/NotificationTemplates.tsx | 4 +- .../components/ContactPointsFilter.tsx | 3 +- .../components/GlobalConfig.tsx | 3 +- .../components/GlobalConfigAlert.tsx | 3 +- .../contact-points/components/Modals.tsx | 45 ++++++----- .../contact-points/components/UnusedBadge.tsx | 30 +++---- .../components/contact-points/utils.ts | 2 +- .../create-folder/CreateNewFolder.tsx | 4 +- .../components/export/FileExportPreview.tsx | 2 +- .../components/export/GrafanaExportDrawer.tsx | 3 +- .../components/export/GrafanaModifyExport.tsx | 4 +- .../export/GrafanaMuteTimingsExporter.tsx | 4 +- .../export/GrafanaPoliciesExporter.tsx | 3 +- .../export/GrafanaReceiverExporter.tsx | 3 +- .../export/GrafanaReceiversExporter.tsx | 3 +- .../components/export/GrafanaRuleExporter.tsx | 3 +- .../export/GrafanaRuleFolderExporter.tsx | 4 +- .../export/GrafanaRuleGroupExporter.tsx | 4 +- .../export/GrafanaRulesExporter.tsx | 4 +- .../components/expressions/Expression.tsx | 7 +- .../AlertInstanceExtensionPoint.tsx | 4 +- .../folder-bulk-actions/DeleteModal.tsx | 3 +- .../FolderBulkActionsButton.tsx | 3 +- .../PauseUnpauseActionMenuItem.tsx | 3 +- .../import-to-gma/ConfirmConvertModal.tsx | 37 +++++---- .../import-to-gma/ImportFromDSRules.tsx | 4 +- .../import-to-gma/NamespaceAndGroupFilter.tsx | 3 +- .../mute-timings/MuteTimingActionsButtons.tsx | 4 +- .../mute-timings/MuteTimingForm.tsx | 3 +- .../mute-timings/MuteTimingTimeInterval.tsx | 4 +- .../mute-timings/MuteTimingTimeRange.tsx | 3 +- .../mute-timings/MuteTimingsTable.tsx | 4 +- .../AlertGroupsSummary.tsx | 4 +- .../ContactPointSelector.tsx | 3 +- .../EditDefaultPolicyForm.tsx | 4 +- .../EditNotificationPolicyForm.tsx | 3 +- .../notification-policies/Filters.tsx | 3 +- .../notification-policies/Modals.tsx | 23 ++++-- .../NotificationPoliciesList.tsx | 3 +- .../notification-policies/Policy.tsx | 33 +++++--- .../PolicyUpdateErrorAlert.tsx | 3 +- .../PromDurationDocs.tsx | 2 +- .../NewRuleFromPanelButton.tsx | 3 +- .../permissions/ManagePermissions.tsx | 3 +- .../receivers/AlertInstanceModalSelector.tsx | 3 +- .../components/receivers/GlobalConfigForm.tsx | 4 +- .../components/receivers/PayloadEditor.tsx | 4 +- .../components/receivers/ReceiversSection.tsx | 4 +- .../components/receivers/TemplateDataDocs.tsx | 2 +- .../components/receivers/TemplateForm.tsx | 6 +- .../components/receivers/TemplatePreview.tsx | 4 +- .../components/receivers/TemplatesTable.tsx | 6 +- .../receivers/form/ChannelSubForm.tsx | 3 +- .../form/CloudCommonChannelSettings.tsx | 4 +- .../receivers/form/CloudReceiverForm.tsx | 3 +- .../receivers/form/GenerateAlertDataModal.tsx | 3 +- .../form/GrafanaCommonChannelSettings.tsx | 3 +- .../receivers/form/GrafanaReceiverForm.tsx | 3 +- .../receivers/form/ReceiverForm.tsx | 3 +- .../receivers/form/TestContactPointModal.tsx | 4 +- .../form/fields/KeyValueMapInput.tsx | 3 +- .../form/fields/StringArrayInput.tsx | 4 +- .../form/fields/SubformArrayField.tsx | 4 +- .../receivers/form/fields/SubformField.tsx | 4 +- .../form/fields/TemplateContentAndPreview.tsx | 3 +- .../form/fields/TemplateSelector.tsx | 5 +- .../onCall/useOnCallIntegration.tsx | 7 +- .../rule-editor/AlertRuleNameInput.tsx | 4 +- .../rule-editor/AnnotationsStep.tsx | 3 +- .../rule-editor/CloudAlertPreview.tsx | 2 +- .../rule-editor/CloudEvaluationBehavior.tsx | 3 +- .../CustomAnnotationHeaderField.tsx | 4 +- .../rule-editor/DashboardAnnotationField.tsx | 2 +- .../rule-editor/DashboardPicker.tsx | 3 +- .../rule-editor/DurationQuickPick.tsx | 2 +- .../rule-editor/ExpressionEditor.tsx | 3 +- .../components/rule-editor/FolderSelector.tsx | 4 +- .../rule-editor/GrafanaEvaluationBehavior.tsx | 3 +- .../GrafanaFolderAndLabelsStep.tsx | 4 +- .../rule-editor/GroupAndNamespaceFields.tsx | 3 +- .../components/rule-editor/NeedHelpInfo.tsx | 2 +- .../rule-editor/NotificationsStep.tsx | 7 +- .../components/rule-editor/PreviewRule.tsx | 4 +- .../rule-editor/PreviewRuleResult.tsx | 3 +- .../components/rule-editor/QueryOptions.tsx | 4 +- .../components/rule-editor/QueryRows.tsx | 2 +- .../components/rule-editor/QueryWrapper.tsx | 4 +- .../rule-editor/RecordingRuleEditor.tsx | 2 +- .../RecordingRulesNameSpaceAndGroupStep.tsx | 4 +- .../rule-editor/RuleEditorSection.tsx | 3 +- .../components/rule-editor/RuleInspector.tsx | 4 +- .../components/rule-editor/VizWrapper.tsx | 2 +- .../alert-rule-form/AlertRuleForm.tsx | 4 +- .../alert-rule-form/ModifyExportRuleForm.tsx | 4 +- .../simplifiedRouting/AlertManagerRouting.tsx | 3 +- .../contactPoint/ContactPointSelector.tsx | 4 +- .../route-settings/ActiveTimingFields.tsx | 4 +- .../route-settings/MuteTimingFields.tsx | 4 +- .../route-settings/RouteSettings.tsx | 3 +- .../rule-editor/labels/LabelsButtons.tsx | 3 +- .../rule-editor/labels/LabelsEditorModal.tsx | 3 +- .../rule-editor/labels/LabelsField.tsx | 18 +++-- .../rule-editor/labels/LabelsFieldInForm.tsx | 3 +- .../NotificationPolicyMatchers.tsx | 2 +- .../NotificationPreview.tsx | 3 +- .../NotificationPreviewByAlertManager.tsx | 4 +- .../notificaton-preview/NotificationRoute.tsx | 4 +- .../NotificationRouteDetailsModal.tsx | 3 +- .../UnknownContactPointDetails.tsx | 40 +++++----- .../CloudDataSourceSelector.tsx | 3 +- .../QueryAndExpressionsStep.tsx | 3 +- .../SimpleCondition.tsx | 4 +- .../SmartAlertTypeDetector.tsx | 3 +- .../rule-types/DisabledTooltip.tsx | 4 +- .../rule-types/GrafanaManagedAlert.tsx | 2 +- .../rule-types/MimirOrLokiAlert.tsx | 2 +- .../rule-types/MimirOrLokiRecordingRule.tsx | 2 +- .../rule-editor/rule-types/RuleTypePicker.tsx | 2 +- .../components/rule-viewer/AlertRuleMenu.tsx | 4 +- .../components/rule-viewer/DeleteModal.tsx | 5 +- .../rule-viewer/FederatedRuleWarning.tsx | 4 +- .../components/rule-viewer/PausedBadge.tsx | 3 +- .../components/rule-viewer/RuleViewer.tsx | 5 +- .../rule-viewer/tabs/AlertVersionHistory.tsx | 3 +- .../components/rule-viewer/tabs/Details.tsx | 3 +- .../components/rule-viewer/tabs/Query.tsx | 3 +- .../components/rule-viewer/tabs/Routing.tsx | 2 +- .../tabs/version-history/ComparisonDrawer.tsx | 3 +- .../ConfirmVersionRestoreModal.tsx | 3 +- .../tabs/version-history/UpdatedBy.tsx | 3 +- .../version-history/VersionHistoryTable.tsx | 3 +- .../tabs/version-history/versions-utils.tsx | 2 +- .../components/rules/AlertInstanceDetails.tsx | 4 +- .../rules/AlertInstanceStateFilter.tsx | 2 +- .../components/rules/AlertStateTag.tsx | 4 +- .../unified/components/rules/CloneRule.tsx | 6 +- .../unified/components/rules/CloudRules.tsx | 5 +- .../rules/Filter/RulesFilter.v1.tsx | 5 +- .../rules/Filter/RulesFilter.v2.tsx | 7 +- .../unified/components/rules/GrafanaRules.tsx | 4 +- .../unified/components/rules/NoRulesCTA.tsx | 3 +- .../components/rules/RuleActionsButtons.tsx | 3 +- .../components/rules/RuleConfigStatus.tsx | 2 +- .../unified/components/rules/RuleDetails.tsx | 4 +- .../components/rules/RuleDetailsButtons.tsx | 2 +- .../rules/RuleDetailsDataSources.tsx | 3 +- .../rules/RuleDetailsExpression.tsx | 4 +- .../rules/RuleDetailsFederatedSources.tsx | 3 +- .../rules/RuleDetailsMatchingInstances.tsx | 2 +- .../unified/components/rules/RuleHealth.tsx | 2 +- .../components/rules/RuleListErrors.tsx | 8 +- .../unified/components/rules/RuleState.tsx | 3 +- .../unified/components/rules/RuleStats.tsx | 3 +- .../unified/components/rules/RulesGroup.tsx | 4 +- .../CentralAlertHistoryScene.tsx | 4 +- .../central-state-history/EventDetails.tsx | 3 +- .../EventListSceneObject.tsx | 4 +- .../HistoryErrorMessage.tsx | 3 +- .../ConfirmDeletePermanantlyModal.tsx | 3 +- .../ConfirmRestoreDeletedRuleModal.tsx | 3 +- .../rules/deleted-rules/DeletedRules.tsx | 3 +- .../rules/deleted-rules/DeletedRulesPage.tsx | 3 +- .../rules/state-history/LogRecordViewer.tsx | 4 +- .../rules/state-history/LokiStateHistory.tsx | 5 +- .../rules/state-history/StateHistory.tsx | 4 +- .../components/settings/AlertmanagerCard.tsx | 3 +- .../settings/AlertmanagerConfig.tsx | 3 +- .../settings/ConfigurationDrawer.tsx | 14 +++- .../components/settings/VersionManager.tsx | 3 +- .../components/silences/MatchersField.tsx | 3 +- .../components/silences/NoSilencesCTA.tsx | 3 +- .../components/silences/SilenceDetails.tsx | 2 +- .../silences/SilenceGrafanaRuleDrawer.tsx | 3 +- .../components/silences/SilencePeriod.tsx | 4 +- .../silences/SilencedAlertsTable.tsx | 2 +- .../silences/SilencedAlertsTableRow.tsx | 2 +- .../silences/SilencedInstancesPreview.tsx | 3 +- .../components/silences/SilencesEditor.tsx | 4 +- .../components/silences/SilencesFilter.tsx | 4 +- .../components/silences/SilencesTable.tsx | 6 +- .../group-details/GroupDetailsPage.tsx | 6 +- .../unified/group-details/GroupEditPage.tsx | 5 +- .../components/DraggableRulesTable.tsx | 4 +- .../alerting/unified/home/GettingStarted.tsx | 4 +- .../features/alerting/unified/home/Home.tsx | 3 +- .../alerting/unified/home/Insights.tsx | 2 +- .../unified/home/PluginIntegrations.tsx | 2 +- .../hooks/ruleGroup/useDeleteRuleFromGroup.ts | 4 +- .../hooks/ruleGroup/usePauseAlertRule.ts | 4 +- .../hooks/ruleGroup/useUpdateRuleGroup.ts | 7 +- .../ruleGroup/useUpsertRuleFromRuleGroup.ts | 6 +- .../unified/hooks/useStateHistoryModal.tsx | 6 +- .../unified/insights/InsightsMenuButton.tsx | 4 +- .../unified/integration/AlertRulesDrawer.tsx | 5 +- .../integration/AlertRulesDrawerContent.tsx | 3 +- .../integration/AlertRulesToolbarButton.tsx | 3 +- .../unified/plugins/PluginOriginBadge.tsx | 3 +- .../unified/rule-editor/CloneRuleEditor.tsx | 4 +- .../rule-editor/ExistingRuleEditor.tsx | 4 +- .../unified/rule-editor/RuleEditor.tsx | 5 +- .../rule-list/DataSourceGroupLoader.tsx | 3 +- .../alerting/unified/rule-list/FilterView.tsx | 3 +- .../unified/rule-list/FilterViewStatus.tsx | 4 +- .../unified/rule-list/GrafanaGroupLoader.tsx | 3 +- .../unified/rule-list/GrafanaRuleLoader.tsx | 3 +- .../unified/rule-list/RuleList.v1.tsx | 4 +- .../unified/rule-list/RuleList.v2.tsx | 6 +- .../unified/rule-list/RuleListPageTitle.tsx | 4 +- .../components/AlertRuleListItem.tsx | 3 +- .../components/AlertRuleListItemLoader.tsx | 3 +- .../components/DataSourceErrorBoundary.tsx | 4 +- .../components/DataSourceSection.tsx | 3 +- .../rule-list/components/EvaluationGroup.tsx | 3 +- .../rule-list/components/GroupStatus.tsx | 4 +- .../rule-list/components/LazyPagination.tsx | 4 +- .../rule-list/components/ListGroup.tsx | 4 +- .../rule-list/components/ListSection.tsx | 4 +- .../rule-list/components/Namespace.tsx | 4 +- .../components/RuleActionsButtons.V2.tsx | 3 +- .../rule-list/components/RuleGroup.tsx | 3 +- .../components/RuleGroupActionsMenu.tsx | 5 +- .../unified/state/AlertingQueryRunner.ts | 2 +- .../alerting/unified/utils/k8s/errors.ts | 2 +- .../components/AnnotationResultMapper.tsx | 2 +- .../StandardAnnotationQueryEditor.tsx | 3 +- .../features/api-keys/ApiKeysActionBar.tsx | 4 +- public/app/features/api-keys/ApiKeysPage.tsx | 3 +- public/app/features/api-keys/ApiKeysTable.tsx | 3 +- .../api-keys/MigrateToServiceAccountsCard.tsx | 4 +- .../app/features/auth-config/AuthDrawer.tsx | 3 +- .../auth-config/AuthProvidersListPage.tsx | 2 +- .../auth-config/ProviderConfigForm.tsx | 3 +- .../auth-config/ProviderConfigPage.tsx | 4 +- .../components/ConfigureAuthCTA.tsx | 2 +- .../auth-config/components/ProviderCard.tsx | 3 +- .../components/ServerDiscoveryField.tsx | 2 +- .../components/ServerDiscoveryModal.tsx | 4 +- public/app/features/auth-config/fields.tsx | 4 +- .../app/features/bookmarks/BookmarksPage.tsx | 3 +- .../BrowseDashboardsPage.tsx | 2 +- .../BrowseFolderAlertingPage.tsx | 3 +- .../browse-dashboards/RecentlyDeletedPage.tsx | 3 +- .../api/browseDashboardsAPI.ts | 2 +- .../BrowseActions/BrowseActions.tsx | 3 +- .../components/BrowseActions/DeleteModal.tsx | 3 +- .../BrowseActions/DescendantCount.tsx | 3 +- .../components/BrowseActions/MoveModal.tsx | 3 +- .../components/BrowseActions/utils.ts | 2 +- .../components/BrowseView.tsx | 4 +- .../components/CheckboxCell.tsx | 3 +- .../components/CheckboxHeaderCell.tsx | 3 +- .../components/DashboardsTree.tsx | 5 +- .../components/FolderActionsButton.tsx | 3 +- .../browse-dashboards/components/NameCell.tsx | 3 +- .../components/NewFolderForm.tsx | 3 +- .../components/NewProvisionedFolderForm.tsx | 17 +++- .../components/PermanentlyDeleteModal.tsx | 4 +- .../components/RecentlyDeletedActions.tsx | 2 +- .../components/RecentlyDeletedEmptyState.tsx | 3 +- .../components/RestoreModal.tsx | 3 +- .../components/SearchView.tsx | 3 +- .../app/features/canvas/elements/notFound.tsx | 3 +- public/app/features/canvas/elements/text.tsx | 4 +- .../app/features/canvas/runtime/element.tsx | 2 +- .../commandPalette/CommandPalette.tsx | 4 +- .../app/features/commandPalette/ScopesRow.tsx | 2 +- .../actions/dashboardActions.ts | 2 +- .../actions/recentScopesActions.ts | 4 +- .../commandPalette/actions/staticActions.ts | 2 +- .../commandPalette/actions/useActions.tsx | 2 +- .../AdvisorRedirectNotice.tsx | 3 +- .../ConnectionsRedirectNotice.tsx | 4 +- .../pages/DataSourceDetailsPage.tsx | 2 +- .../tabs/ConnectData/CardGrid/CardGrid.tsx | 4 +- .../tabs/ConnectData/ConnectData.tsx | 3 +- .../NoAccessModal/NoAccessModal.tsx | 2 +- .../tabs/ConnectData/Search/Search.tsx | 3 +- .../CorrelationsFeatureToggle.tsx | 2 +- .../correlations/CorrelationsPage.tsx | 8 +- .../ConfigureCorrelationBasicInfoForm.tsx | 4 +- .../Forms/ConfigureCorrelationSourceForm.tsx | 9 ++- .../Forms/ConfigureCorrelationTargetForm.tsx | 4 +- .../Forms/CorrelationFormNavigation.tsx | 4 +- .../correlations/Forms/QueryEditorField.tsx | 3 +- .../Forms/TransformationEditorRow.tsx | 4 +- .../Forms/TransformationsEditor.tsx | 2 +- .../app/features/correlations/Forms/types.ts | 2 +- .../components/EmptyCorrelationsCTA.tsx | 3 +- .../addToDashboard/AddToDashboardForm.tsx | 3 +- .../ConditionalRendering.tsx | 2 +- .../ConditionalRenderingBase.tsx | 3 +- .../ConditionalRenderingData.tsx | 2 +- .../ConditionalRenderingEditor.tsx | 3 +- .../ConditionalRenderingGroup.tsx | 2 +- .../ConditionalRenderingGroupAdd.tsx | 6 +- .../ConditionalRenderingGroupCondition.tsx | 5 +- .../ConditionalRenderingGroupVisibility.tsx | 6 +- .../ConditionalRenderingOverlay.tsx | 3 +- .../ConditionalRenderingTimeRangeSize.tsx | 2 +- .../ConditionalRenderingVariable.tsx | 2 +- .../edit-pane/DashboardEditPane.tsx | 3 +- .../edit-pane/DashboardEditableElement.tsx | 3 +- .../edit-pane/DashboardOutline.tsx | 3 +- .../edit-pane/EditPaneHeader.tsx | 4 +- .../MultiSelectedObjectsEditableElement.tsx | 2 +- .../MultiSelectedVizPanelsEditableElement.tsx | 2 +- .../edit-pane/VizPanelEditableElement.tsx | 3 +- .../embedding/EmbeddedDashboard.tsx | 3 +- .../inspect/HelpWizard/HelpWizard.tsx | 4 +- .../inspect/InspectDataTab.tsx | 3 +- .../inspect/InspectJsonTab.tsx | 3 +- .../inspect/InspectMetaDataTab.tsx | 2 +- .../inspect/InspectQueryTab.tsx | 2 +- .../inspect/InspectStatsTab.tsx | 2 +- .../inspect/PanelInspectDrawer.tsx | 3 +- .../panel-edit/LibraryVizPanelInfo.tsx | 2 +- .../EmptyTransformationsMessage.tsx | 2 +- .../PanelDataPane/NewAlertRuleButton.tsx | 4 +- .../PanelDataPane/PanelDataAlertingTab.tsx | 3 +- .../PanelDataPane/PanelDataQueriesTab.tsx | 2 +- .../PanelDataTransformationsTab.tsx | 3 +- .../PanelDataPane/TransformationsDrawer.tsx | 3 +- .../panel-edit/PanelEditControls.tsx | 3 +- .../panel-edit/PanelEditorRenderer.tsx | 5 +- .../panel-edit/PanelOptionsPane.tsx | 2 +- .../panel-edit/PanelVizTypePicker.tsx | 3 +- .../panel-edit/SaveLibraryVizPanelModal.tsx | 4 +- .../saving/DashboardPrompt.tsx | 4 +- .../saving/SaveDashboardAsForm.tsx | 3 +- .../saving/SaveDashboardDrawer.tsx | 2 +- .../saving/SaveDashboardForm.tsx | 4 +- .../saving/SaveProvisionedDashboardForm.tsx | 2 +- .../provisioned/DashboardPreviewBanner.tsx | 4 +- .../ProvisionedResourceDeleteModal.tsx | 4 +- .../SaveProvisionedDashboardForm.tsx | 6 +- .../dashboard-scene/saving/shared.tsx | 4 +- .../scene/AddLibraryPanelDrawer.tsx | 2 +- .../scene/GoToSnapshotOriginButton.tsx | 4 +- .../scene/LibraryPanelBehavior.tsx | 2 +- .../scene/NavToolbarActions.tsx | 3 +- .../dashboard-scene/scene/PanelLinks.tsx | 4 +- .../scene/PanelMenuBehavior.tsx | 2 +- .../scene/PanelSearchLayout.tsx | 2 +- .../scene/UnconfiguredPanel.tsx | 3 +- .../dashboard-scene/scene/UnlinkModal.tsx | 4 +- .../layout-auto-grid/AutoGridItemEditor.tsx | 2 +- .../AutoGridLayoutManager.tsx | 2 +- .../AutoGridLayoutManagerEditor.tsx | 4 +- .../DashboardGridItemEditor.tsx | 5 +- .../DefaultGridLayoutManager.tsx | 2 +- .../SceneGridRowEditableElement.tsx | 3 +- .../layout-default/row-actions/RowActions.tsx | 2 +- .../row-actions/RowActionsRenderer.tsx | 3 +- .../row-actions/RowOptionsButton.tsx | 4 +- .../row-actions/RowOptionsForm.tsx | 4 +- .../row-actions/RowOptionsModal.tsx | 4 +- .../scene/layout-rows/RowItem.tsx | 2 +- .../scene/layout-rows/RowItemEditor.tsx | 9 ++- .../scene/layout-rows/RowItemRenderer.tsx | 3 +- .../scene/layout-rows/RowItems.tsx | 2 +- .../scene/layout-rows/RowItemsEditor.tsx | 2 +- .../scene/layout-rows/RowsLayoutManager.tsx | 2 +- .../layout-rows/RowsLayoutManagerRenderer.tsx | 2 +- .../scene/layout-tabs/TabItem.tsx | 2 +- .../scene/layout-tabs/TabItemEditor.tsx | 8 +- .../scene/layout-tabs/TabItemRenderer.tsx | 5 +- .../scene/layout-tabs/TabItems.tsx | 2 +- .../scene/layout-tabs/TabsLayoutManager.tsx | 2 +- .../layout-tabs/TabsLayoutManagerRenderer.tsx | 2 +- .../layouts-shared/CanvasGridAddActions.tsx | 4 +- .../DashboardLayoutSelector.tsx | 6 +- .../actions/BackToDashboardButton.tsx | 2 +- .../actions/DashboardAddButton.tsx | 4 +- .../actions/DashboardSettingsButton.tsx | 22 +++--- .../actions/DiscardLibraryPanelButton.tsx | 30 +++---- .../actions/DiscardPanelButton.tsx | 4 +- .../actions/EditDashboardSwitch.tsx | 44 ++++++----- .../actions/EditSchemaV2Button.tsx | 24 +++--- .../actions/ExportDashboardButton.tsx | 4 +- .../actions/MakeDashboardEditableButton.tsx | 36 +++++---- .../actions/PlayListNextButton.tsx | 24 +++--- .../actions/PlayListPreviousButton.tsx | 22 +++--- .../actions/PlayListStopButton.tsx | 2 +- .../actions/PublicDashboardBadge.tsx | 3 +- .../new-toolbar/actions/SaveDashboard.tsx | 3 +- .../actions/SaveLibraryPanelButton.tsx | 30 +++---- .../actions/ShareDashboardButton.tsx | 3 +- .../actions/ShareExportDashboardButton.tsx | 4 +- .../scene/new-toolbar/actions/StarButton.tsx | 48 ++++++------ .../actions/UnlinkLibraryPanelButton.tsx | 30 +++---- .../settings/DeleteDashboardButton.tsx | 6 +- .../settings/GeneralSettingsEditView.tsx | 4 +- .../settings/JsonModelEditView.tsx | 3 +- .../annotations/AnnotationSettingsEdit.tsx | 3 +- .../annotations/AnnotationSettingsList.tsx | 4 +- .../settings/links/DashboardLinkForm.tsx | 4 +- .../settings/links/DashboardLinkList.tsx | 3 +- .../dashboard-scene/settings/utils.ts | 3 +- .../LocalVariableEditableElement.tsx | 2 +- .../variables/VariableEditableElement.tsx | 3 +- .../settings/variables/VariableEditorForm.tsx | 4 +- .../settings/variables/VariableEditorList.tsx | 3 +- .../variables/VariableEditorListRow.tsx | 4 +- .../variables/VariableSetEditableElement.tsx | 4 +- .../variables/VariablesUnknownTable.tsx | 4 +- .../components/AdHocVariableForm.tsx | 3 +- .../components/ConstantVariableForm.tsx | 4 +- .../components/CustomVariableForm.tsx | 5 +- .../components/DataSourceVariableForm.tsx | 2 +- .../components/GroupByVariableForm.tsx | 3 +- .../components/IntervalVariableForm.tsx | 4 +- .../variables/components/QueryEditor.tsx | 2 +- .../components/QueryVariableForm.tsx | 3 +- .../components/SelectionOptionsForm.tsx | 4 +- .../components/TextBoxVariableForm.tsx | 4 +- .../components/VariableHideSelect.tsx | 3 +- .../components/VariableValuesPreview.tsx | 2 +- .../editors/ConstantVariableEditor.tsx | 5 +- .../variables/editors/QueryVariableEditor.tsx | 5 +- .../editors/TextBoxVariableEditor.tsx | 4 +- .../useVariableSelectionOptionsCategory.tsx | 6 +- .../version-history/RevertDashboardModal.tsx | 4 +- .../version-history/VersionHistoryButtons.tsx | 60 +++++++------- .../VersionHistoryComparison.tsx | 4 +- .../version-history/VersionHistoryHeader.tsx | 4 +- .../version-history/VersionHistoryTable.tsx | 4 +- .../sharing/ExportButton/ExportAsCode.tsx | 4 +- .../sharing/ExportButton/ExportButton.tsx | 3 +- .../sharing/ExportButton/ExportMenu.tsx | 6 +- .../sharing/ExportButton/ResourceExport.tsx | 3 +- .../sharing/ShareButton/ShareButton.tsx | 3 +- .../sharing/ShareButton/ShareMenu.tsx | 5 +- .../ConfigEmailSharing/ConfigEmailSharing.tsx | 4 +- .../EmailListConfiguration.tsx | 6 +- .../EmailShare/CreateEmailSharing.tsx | 3 +- .../PublicShare/CreatePublicSharing.tsx | 4 +- .../share-externally/ShareConfiguration.tsx | 4 +- .../share-externally/ShareExternally.tsx | 5 +- .../share-externally/ShareTypeSelect.tsx | 2 +- .../ShareButton/share-externally/utils.ts | 3 +- .../share-internally/ShareInternally.tsx | 4 +- .../share-snapshot/ShareSnapshot.tsx | 4 +- .../share-snapshot/UpsertSnapshot.tsx | 4 +- .../ShareDrawer/ShareDrawerConfirmAction.tsx | 3 +- .../sharing/ShareExportTab.tsx | 3 +- .../sharing/ShareInternallyConfiguration.tsx | 4 +- .../sharing/ShareLibraryPanelTab.tsx | 2 +- .../dashboard-scene/sharing/ShareLinkTab.tsx | 3 +- .../dashboard-scene/sharing/ShareModal.tsx | 2 +- .../sharing/SharePanelEmbedTab.tsx | 2 +- .../sharing/ShareSnapshotTab.tsx | 5 +- .../panel-share/SharePanelInternally.tsx | 4 +- .../sharing/panel-share/SharePanelPreview.tsx | 4 +- .../ConfigPublicDashboard.tsx | 2 +- .../SharePublicDashboardTab.tsx | 2 +- .../dashboard-scene/solo/SoloPanelPage.tsx | 4 +- .../features/dashboard-scene/utils/utils.ts | 2 +- .../v2schema/ImportDashboardFormV2.tsx | 4 +- .../variables/VariableUsagesButton.tsx | 3 +- .../variables/VariablesDependenciesButton.tsx | 3 +- .../dashboard/api/publicDashboardApi.ts | 2 +- .../AddLibraryPanelWidget.tsx | 4 +- .../AddPanelButton/AddPanelButton.tsx | 2 +- .../AddPanelButton/AddPanelMenu.tsx | 4 +- .../AnnotationSettingsEdit.tsx | 3 +- .../AnnotationSettingsList.tsx | 4 +- .../dashboard/components/DashNav/DashNav.tsx | 3 +- .../DashNav/DashNavTimeControls.tsx | 2 +- .../components/DashNav/ShareButton.tsx | 2 +- .../DashboardLoading/DashboardLoading.tsx | 2 +- .../components/DashboardRow/DashboardRow.tsx | 3 +- .../AutoRefreshIntervals.tsx | 3 +- .../DashboardSettings/DashboardSettings.tsx | 4 +- .../DashboardSettings/GeneralSettings.tsx | 3 +- .../DashboardSettings/JsonEditorSettings.tsx | 2 +- .../DashboardSettings/TimePickerSettings.tsx | 2 +- .../DeleteDashboard/DeleteDashboardButton.tsx | 2 +- .../DeleteDashboard/DeleteDashboardModal.tsx | 78 ++++++++++--------- .../components/GenAI/GenAIHistory.tsx | 3 +- .../GenAI/MinimalisticPagination.tsx | 3 +- .../components/HelpWizard/HelpWizard.tsx | 3 +- .../components/Inspector/InspectContent.tsx | 4 +- .../dashboard/components/Inspector/hooks.ts | 6 +- .../PanelEditor/DynamicConfigValueEditor.tsx | 3 +- .../PanelEditor/OptionsPaneOptions.tsx | 4 +- .../PanelEditor/OverrideCategoryTitle.tsx | 3 +- .../components/PanelEditor/PanelEditor.tsx | 3 +- .../PanelEditor/PanelEditorTableView.tsx | 3 +- .../PanelEditor/PanelNotSupported.tsx | 2 +- .../PanelEditor/VisualizationButton.tsx | 4 +- .../PanelEditor/VisualizationSelectPane.tsx | 3 +- .../PanelEditor/getFieldOverrideElements.tsx | 2 +- .../PublicDashboardNotAvailable.tsx | 3 +- .../RowOptions/RowOptionsButton.tsx | 4 +- .../components/RowOptions/RowOptionsForm.tsx | 3 +- .../components/RowOptions/RowOptionsModal.tsx | 4 +- .../SaveDashboard/DashboardValidation.tsx | 3 +- .../SaveDashboard/SaveDashboardButton.tsx | 2 +- .../SaveDashboard/SaveDashboardDiff.tsx | 3 +- .../SaveDashboard/SaveDashboardDrawer.tsx | 3 +- .../SaveDashboard/SaveDashboardErrorProxy.tsx | 5 +- .../SaveDashboard/UnsavedChangesModal.tsx | 3 +- .../forms/SaveDashboardAsForm.tsx | 4 +- .../SaveDashboard/forms/SaveDashboardForm.tsx | 4 +- .../forms/SaveProvisionedDashboardForm.tsx | 2 +- .../components/ShareModal/ShareEmbed.tsx | 4 +- .../components/ShareModal/ShareExport.tsx | 3 +- .../ShareModal/ShareLibraryPanel.tsx | 2 +- .../components/ShareModal/ShareLink.tsx | 3 +- .../components/ShareModal/ShareModal.tsx | 2 +- .../ConfigPublicDashboard.tsx | 4 +- .../ConfigPublicDashboard/Configuration.tsx | 4 +- .../EmailSharingConfiguration.tsx | 6 +- .../SettingsBarHeader.tsx | 4 +- .../ConfigPublicDashboard/SettingsSummary.tsx | 4 +- .../AcknowledgeCheckboxes.tsx | 3 +- .../CreatePublicDashboard.tsx | 2 +- .../ModalAlerts/EmailSharingPricingAlert.tsx | 2 +- .../ModalAlerts/NoUpsertPermissionsAlert.tsx | 4 +- .../ModalAlerts/PublicDashboardAlert.tsx | 3 +- .../ModalAlerts/SaveDashboardChangesAlert.tsx | 26 ++++--- .../UnsupportedDataSourcesAlert.tsx | 4 +- .../UnsupportedTemplateVariablesAlert.tsx | 40 +++++----- .../SharePublicDashboard.tsx | 2 +- .../components/ShareModal/ShareSnapshot.tsx | 3 +- .../components/ShareModal/ThemePicker.tsx | 4 +- .../components/ShareModal/ViewJsonModal.tsx | 3 +- .../SubMenu/DashboardLinksDashboard.tsx | 4 +- .../dashboard/components/SubMenu/SubMenu.tsx | 2 +- .../TransformationEditor.tsx | 3 +- .../TransformationFilter.tsx | 4 +- .../TransformationOperationRow.tsx | 4 +- .../TransformationPicker.tsx | 4 +- .../TransformationPickerNg.tsx | 3 +- .../TransformationsEditor.tsx | 3 +- .../VersionHistory/RevertDashboardModal.tsx | 4 +- .../VersionHistoryComparison.tsx | 4 +- .../VersionHistory/VersionHistoryTable.tsx | 4 +- .../containers/DashboardPageError.tsx | 3 +- .../containers/NewDashboardWithDS.tsx | 2 +- .../dashboard/containers/SoloPanelPage.tsx | 3 +- .../dashboard/dashgrid/DashboardEmpty.tsx | 2 +- .../dashboard/dashgrid/PanelLinks.tsx | 3 +- .../dashboard/services/DashboardSrv.ts | 2 +- .../features/dashboard/services/TimeSrv.ts | 2 +- .../features/dashboard/utils/getPanelMenu.ts | 2 +- .../datasources/components/BasicSettings.tsx | 6 +- .../datasources/components/ButtonRow.tsx | 2 +- .../datasources/components/CloudInfoBox.tsx | 3 +- .../components/DashboardsTable.tsx | 4 +- .../components/DataSourceAddButton.tsx | 2 +- .../components/DataSourceCategories.tsx | 2 +- .../components/DataSourceLoadError.tsx | 2 +- .../DataSourceMissingRightsMessage.tsx | 4 +- .../components/DataSourcePluginConfigPage.tsx | 3 +- .../components/DataSourcePluginState.tsx | 2 +- .../components/DataSourceReadOnlyMessage.tsx | 4 +- .../components/DataSourceTestingStatus.tsx | 4 +- .../components/DataSourceTypeCard.tsx | 5 +- .../components/DataSourcesList.tsx | 4 +- .../components/DataSourcesListCard.tsx | 2 +- .../components/EditDataSourceActions.tsx | 2 +- .../datasources/components/NewDataSource.tsx | 4 +- .../picker/AddNewDataSourceButton.tsx | 4 +- .../picker/BuiltInDataSourceList.tsx | 9 ++- .../components/picker/DataSourceList.tsx | 2 +- .../components/picker/DataSourceModal.tsx | 4 +- .../components/picker/DataSourcePicker.tsx | 4 +- .../components/useDataSourceInfo.tsx | 4 +- .../dimensions/editors/FileUploader.tsx | 4 +- .../dimensions/editors/FolderPickerTab.tsx | 4 +- .../editors/ResourceDimensionEditor.tsx | 3 +- .../dimensions/editors/ResourcePicker.tsx | 2 +- .../editors/ResourcePickerPopover.tsx | 2 +- .../editors/ScalarDimensionEditor.tsx | 3 +- .../editors/ScaleDimensionEditor.tsx | 3 +- .../editors/TextDimensionEditor.tsx | 3 +- .../ThresholdsEditor/ThresholdsEditor.tsx | 3 +- .../dimensions/editors/URLPickerTab.tsx | 4 +- .../ValueMappingEditRow.tsx | 4 +- .../ValueMappingsEditor.tsx | 3 +- .../ValueMappingsEditorModal.tsx | 4 +- .../explore/ContentOutline/ContentOutline.tsx | 5 +- .../ContentOutlineItemButton.tsx | 4 +- .../explore/CorrelationEditorModeBar.tsx | 4 +- .../features/explore/CorrelationHelper.tsx | 4 +- .../CorrelationTransformationAddModal.tsx | 4 +- .../CorrelationUnsavedChangesModal.tsx | 4 +- .../features/explore/DrilldownAlertBox.tsx | 5 +- public/app/features/explore/Explore.tsx | 2 +- public/app/features/explore/ExplorePage.tsx | 2 +- .../explore/ExploreRunQueryButton.tsx | 4 +- .../app/features/explore/ExploreToolbar.tsx | 4 +- .../features/explore/FeatureTogglePage.tsx | 3 +- .../features/explore/Graph/GraphContainer.tsx | 3 +- .../app/features/explore/LiveTailButton.tsx | 3 +- public/app/features/explore/Logs/LiveLogs.tsx | 3 +- public/app/features/explore/Logs/Logs.tsx | 4 +- .../explore/Logs/LogsColumnSearch.tsx | 3 +- .../features/explore/Logs/LogsContainer.tsx | 2 +- .../features/explore/Logs/LogsFeedback.tsx | 2 +- .../app/features/explore/Logs/LogsMetaRow.tsx | 2 +- .../features/explore/Logs/LogsNavigation.tsx | 3 +- .../features/explore/Logs/LogsSamplePanel.tsx | 3 +- .../explore/Logs/LogsTableAvailableFields.tsx | 4 +- .../explore/Logs/LogsTableEmptyFields.tsx | 2 +- .../explore/Logs/LogsTableMultiSelect.tsx | 2 +- .../explore/Logs/LogsTableNavField.tsx | 3 +- .../features/explore/Logs/LogsTableWrap.tsx | 3 +- .../features/explore/Logs/LogsVolumePanel.tsx | 3 +- .../explore/Logs/LogsVolumePanelList.tsx | 4 +- .../app/features/explore/Logs/PopoverMenu.tsx | 4 +- .../explore/NoDataSourceCallToAction.tsx | 2 +- .../explore/NodeGraph/NodeGraphContainer.tsx | 3 +- .../PrometheusListView/RawListContainer.tsx | 4 +- .../PrometheusListView/RawListItem.tsx | 3 +- .../explore/RichHistory/RichHistory.tsx | 5 +- .../RichHistory/RichHistoryAddToLibrary.tsx | 3 +- .../explore/RichHistory/RichHistoryCard.tsx | 7 +- .../RichHistory/RichHistoryContainer.tsx | 2 +- .../RichHistory/RichHistoryQueriesTab.tsx | 3 +- .../RichHistory/RichHistorySettingsTab.tsx | 3 +- .../RichHistory/RichHistoryStarredTab.tsx | 3 +- .../app/features/explore/SecondaryActions.tsx | 3 +- .../features/explore/ShortLinkButtonMenu.tsx | 4 +- .../explore/SupplementaryResultError.tsx | 2 +- .../features/explore/Table/TableContainer.tsx | 3 +- .../app/features/explore/TimeSyncButton.tsx | 5 +- .../features/explore/TraceView/TraceView.tsx | 2 +- .../explore/TraceView/TraceViewContainer.tsx | 3 +- .../Actions/TracePageActions.tsx | 3 +- .../SearchBar/NextPrevResult.tsx | 4 +- .../SearchBar/TracePageSearchBar.tsx | 4 +- .../SpanFilters/SpanFilters.tsx | 4 +- .../SpanFilters/SpanFiltersTags.tsx | 4 +- .../SpanGraph/ViewingLayer.tsx | 2 +- .../TracePageHeader/TracePageHeader.tsx | 4 +- .../TraceTimelineViewer/SpanBar.tsx | 2 +- .../SpanDetail/AccordianLogs.tsx | 2 +- .../SpanDetail/AccordianReferences.tsx | 4 +- .../SpanDetail/SpanDetailLinkButtons.tsx | 4 +- .../SpanDetail/SpanFlameGraph.tsx | 2 +- .../TraceTimelineViewer/SpanDetail/index.tsx | 4 +- .../TimelineHeaderRow/TimelineCollapser.tsx | 4 +- .../TimelineHeaderRow/TimelineHeaderRow.tsx | 2 +- .../VirtualizedTraceView.tsx | 2 +- .../TraceView/components/common/CopyIcon.tsx | 5 +- .../components/common/SearchBarInput.tsx | 2 +- .../components/settings/SpanBarSettings.tsx | 4 +- .../demo/DraggableManagerDemo.tsx | 2 +- .../explore/TraceView/createSpanLink.tsx | 3 +- .../extensions/AddToDashboard/index.tsx | 3 +- .../extensions/ConfirmNavigationModal.tsx | 2 +- .../extensions/toolbar/BasicExtensions.tsx | 4 +- .../toolbar/QuerylessAppsExtensions.tsx | 4 +- public/app/features/explore/state/time.ts | 2 +- .../expressions/ExpressionQueryEditor.tsx | 4 +- .../components/ClassicConditions.tsx | 4 +- .../expressions/components/Condition.tsx | 2 +- .../features/expressions/components/Math.tsx | 4 +- .../expressions/components/Reduce.tsx | 4 +- .../expressions/components/Resample.tsx | 4 +- .../expressions/components/Threshold.tsx | 8 +- .../expressions/components/ToLabel.tsx | 2 +- public/app/features/folders/state/navModel.ts | 2 +- .../components/ConfigCard.tsx | 4 +- .../components/ConfigureIRM.tsx | 2 +- .../components/Essentials.tsx | 4 +- .../components/ProgressBar.tsx | 3 +- .../features/inspector/InspectDataOptions.tsx | 4 +- .../app/features/inspector/InspectDataTab.tsx | 3 +- .../features/inspector/InspectErrorTab.tsx | 3 +- .../app/features/inspector/InspectJSONTab.tsx | 13 ++-- .../features/inspector/InspectMetadataTab.tsx | 2 +- .../features/inspector/InspectStatsTab.tsx | 4 +- .../app/features/inspector/QueryInspector.tsx | 3 +- public/app/features/invites/InviteeRow.tsx | 2 +- public/app/features/invites/InviteesTable.tsx | 2 +- public/app/features/invites/SignupInvited.tsx | 4 +- .../AddLibraryPanelModal.tsx | 5 +- .../DeleteLibraryPanelModal.tsx | 3 +- .../LibraryPanelCard/LibraryPanelCard.tsx | 2 +- .../LibraryPanelInfo/LibraryPanelInfo.tsx | 2 +- .../LibraryPanelsSearch.tsx | 4 +- .../LibraryPanelsView/LibraryPanelsView.tsx | 4 +- .../OpenLibraryPanelModal.tsx | 3 +- .../PanelLibraryOptionsGroup.tsx | 2 +- .../SaveLibraryPanelModal.tsx | 4 +- .../library-panels/utils/usePanelSave.ts | 3 +- .../features/live/LiveConnectionWarning.tsx | 2 +- .../live/dashboard/DashboardChangedModal.tsx | 4 +- .../logs/components/InfiniteScroll.tsx | 2 +- .../features/logs/components/LogDetails.tsx | 3 +- .../logs/components/LogDetailsBody.tsx | 4 +- .../logs/components/LogDetailsRow.tsx | 2 +- .../logs/components/LogLabelStats.tsx | 4 +- .../features/logs/components/LogLabels.tsx | 6 +- .../app/features/logs/components/LogRow.tsx | 4 +- .../logs/components/LogRowMenuCell.tsx | 4 +- .../logs/components/LogRowMessage.tsx | 2 +- .../app/features/logs/components/LogRows.tsx | 4 +- .../log-context/LogContextButtons.tsx | 4 +- .../log-context/LogRowContextModal.tsx | 3 +- .../logs/components/panel/InfiniteScroll.tsx | 10 ++- .../logs/components/panel/LogLine.tsx | 4 +- .../logs/components/panel/LogLineMenu.tsx | 5 +- .../logs/components/panel/LogListControls.tsx | 8 +- .../manage-dashboards/DashboardImportPage.tsx | 3 +- .../components/ImportDashboardForm.tsx | 3 +- .../components/ImportDashboardOverview.tsx | 2 +- .../DeletePublicDashboardButton.tsx | 4 +- .../DeletePublicDashboardModal.tsx | 5 +- .../PublicDashboardListTable.tsx | 6 +- .../components/SnapshotListTable.tsx | 4 +- .../components/SnapshotListTableRow.tsx | 3 +- .../manage-dashboards/utils/validation.ts | 2 +- .../cloud/EmptyState/InfoPane.tsx | 4 +- .../cloud/EmptyState/MigrationStepsPane.tsx | 3 +- .../MigrationTokenPane/CreateTokenModal.tsx | 6 +- .../DeleteMigrationTokenModal.tsx | 4 +- .../DeleteTokenConfirmationModal.tsx | 3 +- .../MigrationTokenPane/MigrationTokenPane.tsx | 4 +- .../cloud/MigrationTokenPane/TokenStatus.tsx | 2 +- .../cloud/TokenErrorAlert.tsx | 4 +- .../onprem/ConfigureSnapshot.tsx | 2 +- .../onprem/DisconnectModal.tsx | 4 +- .../EmptyState/CallToAction/CallToAction.tsx | 2 +- .../EmptyState/CallToAction/ConnectModal.tsx | 9 ++- .../onprem/EmptyState/InfoPaneLeft.tsx | 3 +- .../onprem/EmptyState/InfoPaneRight.tsx | 4 +- .../onprem/MigrationSummary.tsx | 3 +- .../migrate-to-cloud/onprem/NameCell.tsx | 2 +- .../features/migrate-to-cloud/onprem/Page.tsx | 35 +++++---- .../onprem/ResourceDetailsModal.tsx | 10 ++- .../migrate-to-cloud/onprem/SnapshotCTAs.tsx | 4 +- .../migrate-to-cloud/onprem/StatusCell.tsx | 8 +- .../onprem/SupportedTypesDisclosure.tsx | 2 +- .../migrate-to-cloud/onprem/TypeCell.tsx | 8 +- .../migrate-to-cloud/onprem/resourceInfo.ts | 2 +- .../onprem/useNotifyOnSuccess.tsx | 11 +-- .../notifications/StoredNotifications.tsx | 4 +- public/app/features/org/NewOrgPage.tsx | 4 +- public/app/features/org/OrgProfile.tsx | 3 +- public/app/features/org/SelectOrgPage.tsx | 3 +- public/app/features/org/UserInviteForm.tsx | 4 +- public/app/features/org/UserInvitePage.tsx | 3 +- .../panel/components/PanelDataErrorView.tsx | 2 +- .../panel/components/PanelPluginError.tsx | 7 +- .../panel/components/PanelRenderer.tsx | 2 +- .../VizTypePicker/PanelTypeCard.tsx | 3 +- .../VisualizationSuggestions.tsx | 2 +- .../VizTypePicker/VizTypePicker.tsx | 2 +- public/app/features/playlist/PlaylistCard.tsx | 4 +- .../features/playlist/PlaylistEditPage.tsx | 4 +- public/app/features/playlist/PlaylistForm.tsx | 4 +- public/app/features/playlist/PlaylistPage.tsx | 4 +- .../app/features/playlist/PlaylistTable.tsx | 4 +- .../features/playlist/PlaylistTableRows.tsx | 4 +- public/app/features/playlist/ShareModal.tsx | 4 +- public/app/features/playlist/StartModal.tsx | 4 +- .../Badges/PluginDeprecatedBadge.tsx | 4 +- .../components/Badges/PluginDisabledBadge.tsx | 4 +- .../Badges/PluginEnterpriseBadge.tsx | 3 +- .../components/Badges/PluginInstallBadge.tsx | 4 +- .../Badges/PluginUpdateAvailableBadge.tsx | 2 +- .../admin/components/ConnectionsTab.tsx | 4 +- .../GetStartedWithApp.tsx | 2 +- .../GetStartedWithDataSource.tsx | 4 +- .../InstallControls/InstallControlsButton.tsx | 4 +- .../InstallControlsWarning.tsx | 3 +- .../admin/components/PluginActions.tsx | 2 +- .../admin/components/PluginDashboards.tsx | 2 +- .../admin/components/PluginDetailsBody.tsx | 2 +- .../PluginDetailsDeprecatedWarning.tsx | 3 +- .../components/PluginDetailsDisabledError.tsx | 3 +- .../PluginDetailsHeaderDependencies.tsx | 2 +- .../admin/components/PluginDetailsPage.tsx | 4 +- .../admin/components/PluginDetailsPanel.tsx | 2 +- .../components/PluginDetailsSignature.tsx | 3 +- .../plugins/admin/components/PluginList.tsx | 3 +- .../admin/components/PluginListItem.tsx | 4 +- .../PluginSignatureDetailsBadge.tsx | 2 +- .../plugins/admin/components/PluginUsage.tsx | 4 +- .../plugins/admin/components/RoadmapLinks.tsx | 2 +- .../plugins/admin/components/SearchField.tsx | 3 +- .../admin/components/UpdateAllButton.tsx | 2 +- .../admin/components/UpdateAllModal.tsx | 9 ++- .../admin/components/UpdateAllModalBody.tsx | 6 +- .../admin/components/VersionInstallButton.tsx | 4 +- .../plugins/admin/components/VersionList.tsx | 2 +- .../plugins/admin/hooks/usePluginInfo.tsx | 3 +- .../features/plugins/admin/pages/Browse.tsx | 3 +- .../plugins/components/AppRootPage.tsx | 4 +- .../plugins/components/PluginsErrorsInfo.tsx | 5 +- .../extensions/logs/LogViewFilters.tsx | 3 +- .../features/profile/ChangePasswordForm.tsx | 4 +- .../features/profile/FeatureTogglePage.tsx | 3 +- .../features/profile/UserOrganizations.tsx | 3 +- .../features/profile/UserProfileEditForm.tsx | 6 +- .../features/profile/UserProfileEditTabs.tsx | 6 +- public/app/features/profile/UserSessions.tsx | 3 +- public/app/features/profile/UserTeams.tsx | 3 +- .../provisioning/Config/ConfigForm.tsx | 8 +- .../Config/ConfigFormGithubCollapse.tsx | 3 +- .../provisioning/File/FileHistoryPage.tsx | 2 +- .../provisioning/File/FileStatusPage.tsx | 5 +- .../features/provisioning/File/FilesView.tsx | 4 +- .../GettingStarted/EnhancedFeatures.tsx | 2 +- .../GettingStarted/FeaturesList.tsx | 2 +- .../GettingStarted/GettingStarted.tsx | 9 ++- .../GettingStarted/GettingStartedPage.tsx | 4 +- .../GettingStarted/SetupModal.tsx | 2 +- .../GettingStarted/SidebarItem.tsx | 4 +- public/app/features/provisioning/HomePage.tsx | 6 +- .../provisioning/Job/FinishedJobStatus.tsx | 4 +- .../features/provisioning/Job/JobContent.tsx | 4 +- .../features/provisioning/Job/JobStatus.tsx | 2 +- .../features/provisioning/Job/RecentJobs.tsx | 11 ++- .../Repository/CheckRepository.tsx | 2 +- .../Repository/DeleteRepositoryButton.tsx | 4 +- .../Repository/EditRepositoryPage.tsx | 2 +- .../Repository/RepositoryActions.tsx | 2 +- .../Repository/RepositoryCard.tsx | 2 +- .../Repository/RepositoryHealth.tsx | 4 +- .../Repository/RepositoryLink.tsx | 2 +- .../Repository/RepositoryOverview.tsx | 3 +- .../Repository/RepositoryResources.tsx | 3 +- .../Repository/RepositoryStatusPage.tsx | 5 +- .../Repository/SyncRepository.tsx | 3 +- .../Shared/BranchValidationError.tsx | 2 +- .../Shared/ConnectRepositoryButton.tsx | 3 +- .../provisioning/Shared/RepositoryList.tsx | 3 +- .../Shared/TokenPermissionsInfo.tsx | 2 +- .../provisioning/Wizard/BootstrapStep.tsx | 4 +- .../provisioning/Wizard/ConnectStep.tsx | 3 +- .../provisioning/Wizard/FinishStep.tsx | 4 +- .../Wizard/ProvisioningWizard.tsx | 12 +-- .../provisioning/Wizard/SynchronizeStep.tsx | 4 +- .../features/provisioning/Wizard/actions.ts | 6 +- .../query/components/QueryEditorRow.tsx | 3 +- .../query/components/QueryEditorRowHeader.tsx | 4 +- .../query/components/QueryErrorAlert.tsx | 3 +- .../features/query/components/QueryGroup.tsx | 5 +- .../query/components/QueryGroupOptions.tsx | 4 +- public/app/features/sandbox/TestStuffPage.tsx | 2 +- .../scopes/dashboards/ScopesDashboards.tsx | 4 +- .../ScopesDashboardsTreeFolderItem.tsx | 4 +- .../dashboards/ScopesDashboardsTreeSearch.tsx | 4 +- .../features/scopes/selector/RecentScopes.tsx | 2 +- .../features/scopes/selector/ScopesInput.tsx | 6 +- .../scopes/selector/ScopesSelector.tsx | 4 +- .../scopes/selector/ScopesTreeHeadline.tsx | 2 +- .../scopes/selector/ScopesTreeItem.tsx | 4 +- .../scopes/selector/ScopesTreeSearch.tsx | 4 +- .../search/page/components/ActionRow.tsx | 8 +- .../page/components/SearchResultsTable.tsx | 4 +- .../search/page/components/columns.tsx | 3 +- public/app/features/search/tempI18nPhrases.ts | 2 +- .../ServiceAccountCreatePage.tsx | 4 +- .../serviceaccounts/ServiceAccountPage.tsx | 4 +- .../ServiceAccountPermissions.tsx | 4 +- .../serviceaccounts/ServiceAccountTable.tsx | 4 +- .../ServiceAccountsListPage.tsx | 4 +- .../components/CreateTokenModal.tsx | 4 +- .../components/ServiceAccountProfile.tsx | 4 +- .../components/ServiceAccountProfileRow.tsx | 5 +- .../components/ServiceAccountRoleRow.tsx | 3 +- .../components/ServiceAccountTokensTable.tsx | 6 +- .../components/ServiceAccountsListItem.tsx | 3 +- .../support-bundles/SupportBundles.tsx | 4 +- .../support-bundles/SupportBundlesCreate.tsx | 2 +- public/app/features/teams/CreateTeam.tsx | 3 +- public/app/features/teams/TeamGroupSync.tsx | 3 +- public/app/features/teams/TeamList.tsx | 6 +- public/app/features/teams/TeamSettings.tsx | 4 +- .../FilterByValueFilterEditor.tsx | 3 +- .../FilterByValueTransformerEditor.tsx | 3 +- .../ValueMatchers/BasicMatcherEditor.tsx | 3 +- .../ValueMatchers/RangeMatcherEditor.tsx | 4 +- .../ValueMatchers/RegexMatcherEditor.tsx | 3 +- .../calculateHeatmap/editor/AxisEditor.tsx | 4 +- .../ConfigFromQueryTransformerEditor.tsx | 4 +- .../BinaryOperationOptionsEditor.tsx | 3 +- .../CalculateFieldTransformerEditor.tsx | 5 +- .../CumulativeOptionsEditor.tsx | 3 +- .../IndexOptionsEditor.tsx | 3 +- .../ReduceRowOptionsEditor.tsx | 3 +- .../UnaryOperationEditor.tsx | 3 +- .../WindowOptionsEditor.tsx | 3 +- .../editors/ConcatenateTransformerEditor.tsx | 2 +- .../ConvertFieldTypeTransformerEditor.tsx | 3 +- .../editors/EnumMappingEditor.tsx | 2 +- .../transformers/editors/EnumMappingRow.tsx | 4 +- .../editors/FilterByNameTransformerEditor.tsx | 2 +- .../editors/FormatStringTransformerEditor.tsx | 4 +- .../editors/FormatTimeTransformerEditor.tsx | 3 +- .../editors/GroupByTransformerEditor.tsx | 4 +- .../GroupToNestedTableTransformerEditor.tsx | 6 +- .../GroupingToMatrixTransformerEditor.tsx | 4 +- .../editors/HistogramTransformerEditor.tsx | 4 +- .../editors/JoinByFieldTransformerEditor.tsx | 4 +- .../LabelsToFieldsTransformerEditor.tsx | 4 +- .../editors/LimitTransformerEditor.tsx | 4 +- .../editors/MergeTransformerEditor.tsx | 2 +- .../OrganizeFieldsTransformerEditor.tsx | 4 +- .../editors/ReduceTransformerEditor.tsx | 4 +- .../editors/RenameByRegexTransformer.tsx | 2 +- .../editors/SortByTransformerEditor.tsx | 4 +- .../editors/TransposeTransformerEditor.tsx | 4 +- .../ExtractFieldsTransformerEditor.tsx | 4 +- .../components/JSONPathEditor.tsx | 3 +- ...eldConfigMappingHandlerArgumentsEditor.tsx | 3 +- .../FieldToConfigMappingEditor.tsx | 2 +- .../JoinByLabelsTransformerEditor.tsx | 6 +- .../FieldLookupTransformerEditor.tsx | 4 +- .../PartitionByValuesEditor.tsx | 3 +- .../PrepareTimeSeriesEditor.tsx | 4 +- .../regression/regressionEditor.tsx | 4 +- .../TimeSeriesTableTransformEditor.tsx | 4 +- .../app/features/users/TokenRevokedModal.tsx | 3 +- public/app/features/users/UsersActionBar.tsx | 4 +- .../variables/adhoc/picker/AdHocFilter.tsx | 2 +- .../adhoc/picker/AdHocFilterBuilder.tsx | 4 +- .../variables/adhoc/picker/AdHocFilterKey.tsx | 4 +- .../variables/editor/ConfirmDeleteModal.tsx | 4 +- .../editor/LegacyVariableQueryEditor.tsx | 3 +- .../variables/editor/VariableEditorEditor.tsx | 3 +- .../variables/editor/VariableEditorList.tsx | 4 +- .../editor/VariableEditorListRow.tsx | 4 +- .../inspect/VariableUsagesButton.tsx | 3 +- .../inspect/VariablesDependenciesButton.tsx | 4 +- .../inspect/VariablesUnknownButton.tsx | 4 +- .../inspect/VariablesUnknownTable.tsx | 4 +- .../variables/pickers/PickerRenderer.tsx | 2 +- .../pickers/shared/VariableInput.tsx | 2 +- .../variables/pickers/shared/VariableLink.tsx | 4 +- .../pickers/shared/VariableOptions.tsx | 3 +- .../query/QueryVariableRefreshSelect.tsx | 3 +- .../query/QueryVariableSortSelect.tsx | 3 +- .../textbox/TextBoxVariableEditor.tsx | 4 +- .../textbox/TextBoxVariablePicker.tsx | 4 +- .../data-hover/DataHoverView.tsx | 2 +- .../grafana/components/TimeRegionEditor.tsx | 3 +- public/swagger/SwaggerPage.tsx | 3 +- 1112 files changed, 2910 insertions(+), 1877 deletions(-) delete mode 100644 public/app/core/internationalization/index.tsx diff --git a/contribute/internationalization.md b/contribute/internationalization.md index 8729f8175f5..331c36b1710 100644 --- a/contribute/internationalization.md +++ b/contribute/internationalization.md @@ -17,10 +17,10 @@ Grafana uses the [i18next](https://www.i18next.com/) framework for managing tran ### JSX -1. For JSX children, use the `` component from `app/core/internationalization` with the `i18nKey`, ensuring it conforms to the following guidelines, with the default English translation. For example: +1. For JSX children, use the `` component from `@grafana/i18n` with the `i18nKey`, ensuring it conforms to the following guidelines, with the default English translation. For example: ```jsx -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; const SearchTitle = ({ term }) => Results for {{ term }}; ``` @@ -32,7 +32,7 @@ There may be cases where you need to interpolate variables inside other componen If the nested component is displaying the variable only (e.g. to add emphasis or color), the best solution is to create a new wrapping component: ```jsx -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; import { Text } from '@grafana/ui'; const SearchTerm = ({ term }) => {term}; @@ -47,7 +47,7 @@ const SearchTitle = ({ term }) => ( However there are also cases where the nested component might be displaying additional text which also needs to be translated. In this case, you can use the `values` prop to explicitly pass variables to the translation, and reference them as templated strings in the markup. For example: ```jsx -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; import { Text } from '@grafana/ui'; const SearchTitle = ({ term }) => ( @@ -75,8 +75,9 @@ const ErrorMessage = ({ id, message }) => There Sometimes you may need to translate a string cannot be represented in JSX, such as `placeholder` props. Use the `t` macro for this. ```jsx -import { t } from "app/core/internationalization" +import { useTranslate } from "@grafana/i18n" +const { t } = useTranslate(); const placeholder = t('form.username-placeholder','Username'); return @@ -146,7 +147,7 @@ Refer to the [i18next](https://www.i18next.com/) and [react-i18next](https://rea For fixed phrases: ```jsx -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; Hello user!; ``` @@ -154,7 +155,7 @@ import { Trans } from 'app/core/internationalization'; To interpolate a variable, include it as an object child. It's a weird syntax, but `Trans` will do its magic to make it work: ```jsx -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; Hello {{ name: user.name }}!; @@ -165,7 +166,7 @@ const userName = user.name; Variables must be strings (or, must support calling `.toString()`, which we almost never want). For example: ```jsx -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; // This will not work const userName = user.name; @@ -183,7 +184,7 @@ const userName = user.name; Both HTML tags and React components can be included in a phase. The `Trans` function handles interpolating for its children. ```js -import { Trans } from "app/core/internationalization" +import { Trans } from "@grafana/i18n" Click to learn more. @@ -202,7 +203,7 @@ import { Trans } from "app/core/internationalization" Plurals require special handling to make sure they can be translated according to the rules of each locale (which may be more complex than you think). Use either the `` component or the `t` function, with the `count` prop to provide a singular form. For example: ```js -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; You got {{ count: messages.length }} messages @@ -210,8 +211,9 @@ import { Trans } from 'app/core/internationalization'; ``` ```js -import { t } from 'app/core/internationalization'; +import { useTranslate } from '@grafana/i18n'; +const { t } = useTranslate(); const translatedString = t('inbox.heading', 'You got {{count}} messages', { count: messages.length }); ``` diff --git a/packages/grafana-i18n/src/i18n.tsx b/packages/grafana-i18n/src/i18n.tsx index a0459c73e26..02f2396c403 100644 --- a/packages/grafana-i18n/src/i18n.tsx +++ b/packages/grafana-i18n/src/i18n.tsx @@ -119,7 +119,8 @@ export function getNamespaces() { } export async function changeLanguage(language?: string) { - await getI18nInstance().changeLanguage(language ?? DEFAULT_LANGUAGE); + const validLanguage = LANGUAGES.find((lang) => lang.code === language)?.code ?? DEFAULT_LANGUAGE; + await getI18nInstance().changeLanguage(validLanguage); } type ResourceKey = string; diff --git a/packages/grafana-i18n/src/internal/index.ts b/packages/grafana-i18n/src/internal/index.ts index 5e1174e6437..ad39e9cb4d1 100644 --- a/packages/grafana-i18n/src/internal/index.ts +++ b/packages/grafana-i18n/src/internal/index.ts @@ -9,6 +9,13 @@ * preventing the code from being importable by plugins or other npm packages making it truly "internal". * */ +import { t } from '../i18n'; + +type TFunction = typeof t; + +export type { TFunction }; +export { t }; + export { addResourceBundle, changeLanguage, @@ -16,5 +23,4 @@ export { getLanguage, getResolvedLanguage, initTranslations, - t, } from '../i18n'; diff --git a/public/app/api/clients/provisioning/index.ts b/public/app/api/clients/provisioning/index.ts index 5695306ad6e..bbddc1ae363 100644 --- a/public/app/api/clients/provisioning/index.ts +++ b/public/app/api/clients/provisioning/index.ts @@ -1,7 +1,7 @@ +import { t } from '@grafana/i18n/internal'; import { isFetchError } from '@grafana/runtime'; import { notifyApp } from 'app/core/actions'; import { createSuccessNotification, createErrorNotification } from 'app/core/copy/appNotification'; -import { t } from 'app/core/internationalization'; import { generatedAPI, diff --git a/public/app/app.ts b/public/app/app.ts index 6244e79df41..4fbfe064bf8 100644 --- a/public/app/app.ts +++ b/public/app/app.ts @@ -18,6 +18,7 @@ import { standardFieldConfigEditorRegistry, standardTransformersRegistry, } from '@grafana/data'; +import { initTranslations } from '@grafana/i18n/internal'; import { locationService, registerEchoBackend, @@ -61,7 +62,8 @@ import { getAllOptionEditors, getAllStandardFieldConfigs } from './core/componen import { PluginPage } from './core/components/Page/PluginPage'; import { GrafanaContextType, useReturnToPreviousInternal } from './core/context/GrafanaContext'; import { initializeCrashDetection } from './core/crash'; -import { initializeI18n } from './core/internationalization'; +import { NAMESPACES } from './core/internationalization/constants'; +import { loadTranslations } from './core/internationalization/loadTranslations'; import { postInitTasks, preInitTasks } from './core/lifecycle-hooks'; import { setMonacoEnv } from './core/monacoEnv'; import { interceptLinkClicks } from './core/navigation/patch/interceptLinkClicks'; @@ -124,7 +126,14 @@ export class GrafanaApp { // Let iframe container know grafana has started loading window.parent.postMessage('GrafanaAppInit', '*'); - const initI18nPromise = initializeI18n(config.bootData.user.language); + // This is a placeholder so we can put a 'comment' in the message json files. + // Starts with an underscore so it's sorted to the top of the file. Even though it is in a comment the following line is still extracted + // t('_comment', 'The code is the source of truth for English phrases. They should be updated in the components directly, and additional plurals specified in this file.'); + const initI18nPromise = initTranslations({ + language: config.bootData.user.language, + ns: NAMESPACES, + module: loadTranslations, + }); initI18nPromise.then(({ language }) => updateConfig({ language })); setBackendSrv(backendSrv); diff --git a/public/app/core/components/AccessControl/AddPermission.tsx b/public/app/core/components/AccessControl/AddPermission.tsx index 3a7b8628ff9..3b2cde7838b 100644 --- a/public/app/core/components/AccessControl/AddPermission.tsx +++ b/public/app/core/components/AccessControl/AddPermission.tsx @@ -1,11 +1,12 @@ import { useEffect, useMemo, useState } from 'react'; +import { Trans } from '@grafana/i18n'; +import { t } from '@grafana/i18n/internal'; import { Button, Select, Stack } from '@grafana/ui'; import { CloseButton } from 'app/core/components/CloseButton/CloseButton'; import { ServiceAccountPicker } from 'app/core/components/Select/ServiceAccountPicker'; import { TeamPicker } from 'app/core/components/Select/TeamPicker'; import { UserPicker } from 'app/core/components/Select/UserPicker'; -import { Trans, t } from 'app/core/internationalization'; import { OrgRole } from 'app/types/acl'; import { Assignments, PermissionTarget, SetPermission } from './types'; diff --git a/public/app/core/components/AccessControl/PermissionList.tsx b/public/app/core/components/AccessControl/PermissionList.tsx index 9468a4bf5a1..8fcef15408a 100644 --- a/public/app/core/components/AccessControl/PermissionList.tsx +++ b/public/app/core/components/AccessControl/PermissionList.tsx @@ -1,6 +1,6 @@ import { useMemo } from 'react'; -import { Trans } from 'app/core/internationalization'; +import { Trans } from '@grafana/i18n'; import { PermissionListItem } from './PermissionListItem'; import { ResourcePermission } from './types'; diff --git a/public/app/core/components/AccessControl/PermissionListItem.tsx b/public/app/core/components/AccessControl/PermissionListItem.tsx index 0b9930cbc07..5a18bd566b6 100644 --- a/public/app/core/components/AccessControl/PermissionListItem.tsx +++ b/public/app/core/components/AccessControl/PermissionListItem.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; +import { Trans, useTranslate } from '@grafana/i18n'; import { Box, Button, Icon, Select, Tooltip, useStyles2 } from '@grafana/ui'; -import { t, Trans } from 'app/core/internationalization'; import { ResourcePermission } from './types'; @@ -16,7 +16,7 @@ interface Props { export const PermissionListItem = ({ item, permissionLevels, canSet, onRemove, onChange }: Props) => { const styles = useStyles2(getStyles); - + const { t } = useTranslate(); return ( {getAvatar(item)} diff --git a/public/app/core/components/AccessControl/Permissions.tsx b/public/app/core/components/AccessControl/Permissions.tsx index 939c179901e..36b32270160 100644 --- a/public/app/core/components/AccessControl/Permissions.tsx +++ b/public/app/core/components/AccessControl/Permissions.tsx @@ -4,9 +4,10 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; import * as React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; +import { Trans } from '@grafana/i18n'; +import { t } from '@grafana/i18n/internal'; import { Text, Box, Button, useStyles2, Space } from '@grafana/ui'; import { SlideDown } from 'app/core/components/Animations/SlideDown'; -import { Trans, t } from 'app/core/internationalization'; import { getBackendSrv } from 'app/core/services/backend_srv'; import { DescendantCount } from 'app/features/browse-dashboards/components/BrowseActions/DescendantCount'; diff --git a/public/app/core/components/AppChrome/AppChrome.tsx b/public/app/core/components/AppChrome/AppChrome.tsx index 6497973d7ae..bc017c618b8 100644 --- a/public/app/core/components/AppChrome/AppChrome.tsx +++ b/public/app/core/components/AppChrome/AppChrome.tsx @@ -4,11 +4,11 @@ import { Resizable } from 're-resizable'; import { PropsWithChildren, useEffect } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; +import { Trans } from '@grafana/i18n'; import { locationSearchToObject, locationService, useScopes } from '@grafana/runtime'; import { ErrorBoundaryAlert, getDragStyles, LinkButton, useStyles2 } from '@grafana/ui'; import { useGrafana } from 'app/core/context/GrafanaContext'; import { useMediaQueryMinWidth } from 'app/core/hooks/useMediaQueryMinWidth'; -import { Trans } from 'app/core/internationalization'; import store from 'app/core/store'; import { CommandPalette } from 'app/features/commandPalette/CommandPalette'; import { ScopesDashboards } from 'app/features/scopes/dashboards/ScopesDashboards'; diff --git a/public/app/core/components/AppChrome/AppChromeService.tsx b/public/app/core/components/AppChrome/AppChromeService.tsx index f3de83d38a5..68a98eef634 100644 --- a/public/app/core/components/AppChrome/AppChromeService.tsx +++ b/public/app/core/components/AppChrome/AppChromeService.tsx @@ -2,9 +2,9 @@ import { useObservable } from 'react-use'; import { BehaviorSubject } from 'rxjs'; import { AppEvents, NavModel, NavModelItem, PageLayoutType, UrlQueryValue } from '@grafana/data'; +import { t } from '@grafana/i18n/internal'; import { config, locationService, reportInteraction } from '@grafana/runtime'; import appEvents from 'app/core/app_events'; -import { t } from 'app/core/internationalization'; import store from 'app/core/store'; import { isShallowEqual } from 'app/core/utils/isShallowEqual'; import { KioskMode } from 'app/types'; diff --git a/public/app/core/components/AppChrome/ExtensionSidebar/ExtensionToolbarItem.tsx b/public/app/core/components/AppChrome/ExtensionSidebar/ExtensionToolbarItem.tsx index c8c638ea512..10144d70031 100644 --- a/public/app/core/components/AppChrome/ExtensionSidebar/ExtensionToolbarItem.tsx +++ b/public/app/core/components/AppChrome/ExtensionSidebar/ExtensionToolbarItem.tsx @@ -2,8 +2,8 @@ import { css, cx } from '@emotion/css'; import { useCallback } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; +import { useTranslate } from '@grafana/i18n'; import { Dropdown, Menu, ToolbarButton, useTheme2 } from '@grafana/ui'; -import { t } from 'app/core/internationalization'; import { NavToolbarSeparator } from '../NavToolbar/NavToolbarSeparator'; @@ -17,6 +17,7 @@ export function ExtensionToolbarItem() { const styles = getStyles(useTheme2()); const { availableComponents, dockedComponentId, setDockedComponentId, isOpen, isEnabled } = useExtensionSidebarContext(); + const { t } = useTranslate(); let dockedComponentTitle = ''; if (dockedComponentId) { @@ -72,7 +73,7 @@ export function ExtensionToolbarItem() { /> ); }, - [setDockedComponentId, styles.button, styles.buttonActive] + [setDockedComponentId, styles.button, styles.buttonActive, t] ); if (components.length === 1) { diff --git a/public/app/core/components/AppChrome/History/HistoryContainer.tsx b/public/app/core/components/AppChrome/History/HistoryContainer.tsx index 95d95e708b2..d2e677f3b12 100644 --- a/public/app/core/components/AppChrome/History/HistoryContainer.tsx +++ b/public/app/core/components/AppChrome/History/HistoryContainer.tsx @@ -3,9 +3,9 @@ import { useEffect } from 'react'; import { useToggle } from 'react-use'; import { GrafanaTheme2, store } from '@grafana/data'; +import { useTranslate } from '@grafana/i18n'; import { Drawer, ToolbarButton, useStyles2 } from '@grafana/ui'; import { appEvents } from 'app/core/app_events'; -import { t } from 'app/core/internationalization'; import { RecordHistoryEntryEvent } from 'app/types/events'; import { HISTORY_LOCAL_STORAGE_KEY } from '../AppChromeService'; @@ -47,6 +47,7 @@ export function HistoryContainer() { }; }); }, []); + const { t } = useTranslate(); return ( <> diff --git a/public/app/core/components/AppChrome/History/HistoryWrapper.tsx b/public/app/core/components/AppChrome/History/HistoryWrapper.tsx index 53aec15c77a..479580d6cfb 100644 --- a/public/app/core/components/AppChrome/History/HistoryWrapper.tsx +++ b/public/app/core/components/AppChrome/History/HistoryWrapper.tsx @@ -3,8 +3,8 @@ import moment from 'moment'; import { useState } from 'react'; import { FieldType, GrafanaTheme2, store } from '@grafana/data'; +import { useTranslate } from '@grafana/i18n'; import { Button, Card, IconButton, Space, Stack, Text, useStyles2, Box, Sparkline, useTheme2, Icon } from '@grafana/ui'; -import { t } from 'app/core/internationalization'; import { formatDate } from 'app/core/internationalization/dates'; import { HISTORY_LOCAL_STORAGE_KEY } from '../AppChromeService'; @@ -13,6 +13,7 @@ import { HistoryEntry } from '../types'; import { logClickUnifiedHistoryEntryEvent, logUnifiedHistoryShowMoreEvent } from './eventsTracking'; export function HistoryWrapper({ onClose }: { onClose: () => void }) { + const { t } = useTranslate(); const history = store.getObject(HISTORY_LOCAL_STORAGE_KEY, []).filter((entry) => { return moment(entry.time).isAfter(moment().subtract(2, 'day').startOf('day')); }); @@ -88,6 +89,7 @@ function HistoryEntryAppView({ entry, isSelected, onClick }: ItemProps) { const styles = useStyles2(getStyles); const theme = useTheme2(); const [isExpanded, setIsExpanded] = useState(isSelected && entry.views.length > 0); + const { t } = useTranslate(); const { breadcrumbs, views, time, url, sparklineData } = entry; const expandedLabel = isExpanded ? t('nav.history-wrapper.collapse', 'Collapse') diff --git a/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx b/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx index 88d61ad0665..4e68c1b8f18 100644 --- a/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx +++ b/public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx @@ -5,10 +5,10 @@ import { useLocation } from 'react-router-dom-v5-compat'; import { GrafanaTheme2, NavModelItem } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; +import { useTranslate } from '@grafana/i18n'; import { config, reportInteraction } from '@grafana/runtime'; import { ScrollContainer, useStyles2 } from '@grafana/ui'; import { useGrafana } from 'app/core/context/GrafanaContext'; -import { t } from 'app/core/internationalization'; import { setBookmark } from 'app/core/reducers/navBarTree'; import { usePatchUserPreferencesMutation } from 'app/features/preferences/api/index'; import { useDispatch, useSelector } from 'app/types'; @@ -37,7 +37,7 @@ export const MegaMenu = memo( const state = chrome.useState(); const [patchPreferences] = usePatchUserPreferencesMutation(); const pinnedItems = usePinnedItems(); - + const { t } = useTranslate(); // Remove profile + help from tree const navItems = navTree .filter((item) => item.id !== 'profile' && item.id !== 'help') diff --git a/public/app/core/components/AppChrome/MegaMenu/MegaMenuHeader.tsx b/public/app/core/components/AppChrome/MegaMenu/MegaMenuHeader.tsx index 91f476bdef1..b44c3e62745 100644 --- a/public/app/core/components/AppChrome/MegaMenu/MegaMenuHeader.tsx +++ b/public/app/core/components/AppChrome/MegaMenu/MegaMenuHeader.tsx @@ -1,9 +1,9 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; +import { useTranslate } from '@grafana/i18n'; import { IconButton, Stack, ToolbarButton, useTheme2 } from '@grafana/ui'; import { useGrafana } from 'app/core/context/GrafanaContext'; -import { t } from 'app/core/internationalization'; import { Branding } from '../../Branding/Branding'; import { OrganizationSwitcher } from '../OrganizationSwitcher/OrganizationSwitcher'; @@ -22,6 +22,7 @@ export function MegaMenuHeader({ handleMegaMenu, handleDockedMenu, onClose }: Pr const theme = useTheme2(); const { chrome } = useGrafana(); const state = chrome.useState(); + const { t } = useTranslate(); const styles = getStyles(theme); return ( diff --git a/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx b/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx index a64b26d474d..fe99a1efad8 100644 --- a/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx +++ b/public/app/core/components/AppChrome/MegaMenu/MegaMenuItem.tsx @@ -5,10 +5,10 @@ import { useLocation } from 'react-router-dom-v5-compat'; import { useLocalStorage } from 'react-use'; import { FeatureState, GrafanaTheme2, NavModelItem, toIconName } from '@grafana/data'; +import { useTranslate } from '@grafana/i18n'; import { useStyles2, Text, IconButton, Icon, Stack, FeatureBadge } from '@grafana/ui'; import { useGrafana } from 'app/core/context/GrafanaContext'; -import { t } from '../../../internationalization'; import { Indent } from '../../Indent/Indent'; import { FeatureHighlight } from './FeatureHighlight'; @@ -58,6 +58,7 @@ export function MegaMenuItem({ link, activeItem, level = 0, onClick, onPin, isPi }); } }, [isActive]); + const { t } = useTranslate(); if (!link.url) { return null; diff --git a/public/app/core/components/AppChrome/MegaMenu/MegaMenuItemText.tsx b/public/app/core/components/AppChrome/MegaMenu/MegaMenuItemText.tsx index b6d18b50d9d..1b9434aa313 100644 --- a/public/app/core/components/AppChrome/MegaMenu/MegaMenuItemText.tsx +++ b/public/app/core/components/AppChrome/MegaMenu/MegaMenuItemText.tsx @@ -3,9 +3,9 @@ import * as React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; +import { useTranslate } from '@grafana/i18n'; import { config } from '@grafana/runtime'; import { Icon, IconButton, Link, useTheme2 } from '@grafana/ui'; -import { t } from 'app/core/internationalization'; import { contextSrv } from 'app/core/services/context_srv'; export interface Props { @@ -20,6 +20,7 @@ export interface Props { export function MegaMenuItemText({ children, isActive, onClick, target, url, onPin, isPinned }: Props) { const theme = useTheme2(); + const { t } = useTranslate(); const styles = getStyles(theme, isActive); const LinkComponent = !target && url.startsWith('/') ? Link : 'a'; diff --git a/public/app/core/components/AppChrome/MegaMenu/utils.ts b/public/app/core/components/AppChrome/MegaMenu/utils.ts index 178d6604dca..55ec4af5389 100644 --- a/public/app/core/components/AppChrome/MegaMenu/utils.ts +++ b/public/app/core/components/AppChrome/MegaMenu/utils.ts @@ -1,9 +1,9 @@ import { useEffect } from 'react'; import { NavModelItem } from '@grafana/data'; +import { t } from '@grafana/i18n/internal'; import { config, reportInteraction } from '@grafana/runtime'; import { MEGA_MENU_TOGGLE_ID } from 'app/core/constants'; -import { t } from 'app/core/internationalization'; import { HOME_NAV_ID } from 'app/core/reducers/navModel'; import { ShowModalReactEvent } from '../../../../types/events'; diff --git a/public/app/core/components/AppChrome/News/NewsDrawer.tsx b/public/app/core/components/AppChrome/News/NewsDrawer.tsx index 71aef1bac3b..d582a5267b4 100644 --- a/public/app/core/components/AppChrome/News/NewsDrawer.tsx +++ b/public/app/core/components/AppChrome/News/NewsDrawer.tsx @@ -2,8 +2,8 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; +import { useTranslate } from '@grafana/i18n'; import { IconButton, Drawer, useStyles2, Text } from '@grafana/ui'; -import { t } from 'app/core/internationalization'; import { DEFAULT_FEED_URL } from 'app/plugins/panel/news/constants'; import grotNewsSvg from 'img/grot-news.svg'; @@ -16,7 +16,7 @@ interface NewsContainerProps { export function NewsContainer({ onClose }: NewsContainerProps) { const styles = useStyles2(getStyles); - + const { t } = useTranslate(); return ( { getNews(); }, [getNews]); + const { t } = useTranslate(); if (state.error) { return
{state.error && state.error.message}
; diff --git a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx index 8f0f9b89574..b75688a9c8c 100644 --- a/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx +++ b/public/app/core/components/AppChrome/OrganizationSwitcher/OrganizationSelect.tsx @@ -2,16 +2,16 @@ import { css } from '@emotion/css'; import { useMemo, useState } from 'react'; import { SelectableValue, GrafanaTheme2 } from '@grafana/data'; +import { useTranslate } from '@grafana/i18n'; import { Icon, Select, useStyles2 } from '@grafana/ui'; import { contextSrv } from 'app/core/services/context_srv'; import { UserOrg } from 'app/types'; -import { t } from '../../../internationalization'; - import { OrganizationBaseProps } from './types'; export function OrganizationSelect({ orgs, onSelectChange }: OrganizationBaseProps) { const styles = useStyles2(getStyles); + const { t } = useTranslate(); const { orgId } = contextSrv.user; const options = useMemo( diff --git a/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx b/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx index 269ce8f9471..74b8749144a 100644 --- a/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx +++ b/public/app/core/components/AppChrome/QuickAdd/QuickAdd.tsx @@ -1,11 +1,11 @@ import { useMemo, useState } from 'react'; +import { useTranslate } from '@grafana/i18n'; import { reportInteraction } from '@grafana/runtime'; import { Menu, Dropdown, ToolbarButton } from '@grafana/ui'; import { getExternalUserMngLinkUrl } from 'app/features/users/utils'; import { useSelector } from 'app/types'; -import { t } from '../../../internationalization'; import { performInviteUserClick, shouldRenderInviteUserButton } from '../../InviteUserButton/utils'; import { NavToolbarSeparator } from '../NavToolbar/NavToolbarSeparator'; @@ -16,6 +16,7 @@ export interface Props {} export const QuickAdd = ({}: Props) => { const navBarTree = useSelector((state) => state.navBarTree); const [isOpen, setIsOpen] = useState(false); + const { t } = useTranslate(); const createActions = useMemo(() => { const actions = findCreateActions(navBarTree); @@ -32,7 +33,7 @@ export const QuickAdd = ({}: Props) => { } return actions; - }, [navBarTree]); + }, [navBarTree, t]); const showQuickAdd = createActions.length > 0; if (!showQuickAdd) { diff --git a/public/app/core/components/AppChrome/ReturnToPrevious/DismissableButton.tsx b/public/app/core/components/AppChrome/ReturnToPrevious/DismissableButton.tsx index fbc0dcc3803..b618f69c291 100644 --- a/public/app/core/components/AppChrome/ReturnToPrevious/DismissableButton.tsx +++ b/public/app/core/components/AppChrome/ReturnToPrevious/DismissableButton.tsx @@ -2,8 +2,8 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; +import { useTranslate } from '@grafana/i18n'; import { Button, ButtonGroup, useStyles2 } from '@grafana/ui'; -import { t } from 'app/core/internationalization'; export interface DismissableButtonProps { label: string; @@ -13,7 +13,7 @@ export interface DismissableButtonProps { export const DismissableButton = ({ label, onClick, onDismiss }: DismissableButtonProps) => { const styles = useStyles2(getStyles); - + const { t } = useTranslate(); return (