diff --git a/public/app/features/browse-dashboards/components/BrowseActions/DeleteModal.tsx b/public/app/features/browse-dashboards/components/BrowseActions/DeleteModal.tsx index bd8af238f280..551938b71664 100644 --- a/public/app/features/browse-dashboards/components/BrowseActions/DeleteModal.tsx +++ b/public/app/features/browse-dashboards/components/BrowseActions/DeleteModal.tsx @@ -3,6 +3,7 @@ import React, { useState } from 'react'; import { Space } from '@grafana/experimental'; import { ConfirmModal } from '@grafana/ui'; import { P } from '@grafana/ui/src/unstable'; +import { Trans, t } from 'app/core/internationalization'; import { DashboardTreeSelection } from '../../types'; @@ -32,16 +33,24 @@ export const DeleteModal = ({ onConfirm, onDismiss, selectedItems, ...props }: P -

This action will delete the following content:

+

+ + This action will delete the following content: + +

} confirmationText="Delete" - confirmText={isDeleting ? 'Deleting...' : 'Delete'} + confirmText={ + isDeleting + ? t('browse-dashboards.action.deleting', 'Deleting...') + : t('browse-dashboards.action.delete-button', 'Delete') + } onDismiss={onDismiss} onConfirm={onDelete} - title="Delete" + title={t('browse-dashboards.action.delete-modal-title', 'Delete')} {...props} /> ); diff --git a/public/app/features/browse-dashboards/components/BrowseActions/MoveModal.tsx b/public/app/features/browse-dashboards/components/BrowseActions/MoveModal.tsx index 8f6d30efda23..cf6674bd49cd 100644 --- a/public/app/features/browse-dashboards/components/BrowseActions/MoveModal.tsx +++ b/public/app/features/browse-dashboards/components/BrowseActions/MoveModal.tsx @@ -7,6 +7,7 @@ import { P } from '@grafana/ui/src/unstable'; import { NestedFolderPicker } from 'app/core/components/NestedFolderPicker/NestedFolderPicker'; import { FolderChange, ROOT_FOLDER } from 'app/core/components/NestedFolderPicker/types'; import { FolderPicker } from 'app/core/components/Select/FolderPicker'; +import { t, Trans } from 'app/core/internationalization'; import { DashboardTreeSelection } from '../../types'; @@ -42,16 +43,23 @@ export const MoveModal = ({ onConfirm, onDismiss, selectedItems, ...props }: Pro }; return ( - - {selectedFolders.length > 0 && } + + {selectedFolders.length > 0 && ( + + )} -

This action will move the following content:

+

+ This action will move the following content: +

- + {config.featureToggles.nestedFolderPicker ? ( ) : ( @@ -61,10 +69,12 @@ export const MoveModal = ({ onConfirm, onDismiss, selectedItems, ...props }: Pro
diff --git a/public/app/features/browse-dashboards/components/FolderActionsButton.test.tsx b/public/app/features/browse-dashboards/components/FolderActionsButton.test.tsx index 6ad0f7ad5a00..9b5e51bf6a91 100644 --- a/public/app/features/browse-dashboards/components/FolderActionsButton.test.tsx +++ b/public/app/features/browse-dashboards/components/FolderActionsButton.test.tsx @@ -94,7 +94,7 @@ describe('browse-dashboards FolderActionsButton', () => { await userEvent.click(screen.getByRole('button', { name: 'Folder actions' })); await userEvent.click(screen.getByRole('menuitem', { name: 'Manage permissions' })); - expect(screen.getByRole('dialog', { name: 'Drawer title Permissions' })).toBeInTheDocument(); + expect(screen.getByRole('dialog', { name: 'Drawer title Manage permissions' })).toBeInTheDocument(); }); it('clicking the "Move" option opens the move modal', async () => { diff --git a/public/app/features/browse-dashboards/components/FolderActionsButton.tsx b/public/app/features/browse-dashboards/components/FolderActionsButton.tsx index 8fd6bc0d531b..ff665ef3d312 100644 --- a/public/app/features/browse-dashboards/components/FolderActionsButton.tsx +++ b/public/app/features/browse-dashboards/components/FolderActionsButton.tsx @@ -112,7 +112,7 @@ export function FolderActionsButton({ folder }: Props) { {showPermissionsDrawer && ( setShowPermissionsDrawer(false)} diff --git a/public/app/features/browse-dashboards/components/NewFolderForm.tsx b/public/app/features/browse-dashboards/components/NewFolderForm.tsx index 835fc20514a8..a4eb5933640f 100644 --- a/public/app/features/browse-dashboards/components/NewFolderForm.tsx +++ b/public/app/features/browse-dashboards/components/NewFolderForm.tsx @@ -17,6 +17,10 @@ interface FormModel { const initialFormModel: FormModel = { folderName: '' }; export function NewFolderForm({ onCancel, onConfirm }: Props) { + const translatedFolderNameRequiredPhrase = t( + 'browse-dashboards.action.new-folder-name-required-phrase', + 'Folder name is required.' + ); const validateFolderName = async (folderName: string) => { try { await validationSrv.validateNewFolderName(folderName); @@ -44,7 +48,7 @@ export function NewFolderForm({ onCancel, onConfirm }: Props) { await validateFolderName(v), })} /> diff --git a/public/app/features/folders/state/navModel.ts b/public/app/features/folders/state/navModel.ts index be84f848a029..75b7d13549c7 100644 --- a/public/app/features/folders/state/navModel.ts +++ b/public/app/features/folders/state/navModel.ts @@ -1,5 +1,6 @@ import { NavModel, NavModelItem } from '@grafana/data'; import { config } from '@grafana/runtime'; +import { getNavSubTitle } from 'app/core/components/AppChrome/MegaMenu/navBarItem-translations'; import { t } from 'app/core/internationalization'; import { contextSrv } from 'app/core/services/context_srv'; import { AccessControlAction, FolderDTO } from 'app/types'; @@ -16,7 +17,7 @@ export function buildNavModel(folder: FolderDTO, parents = folder.parents): NavM const model: NavModelItem = { icon: 'folder', id: FOLDER_ID, - subTitle: t('state.nav-models.manage-folder-subtitle', 'Manage folder dashboards and permissions'), + subTitle: getNavSubTitle('manage-folder'), url: folder.url, text: folder.title, children: [ @@ -24,7 +25,7 @@ export function buildNavModel(folder: FolderDTO, parents = folder.parents): NavM active: false, icon: 'apps', id: getDashboardsTabID(folder.uid), - text: t('state.nav-model.dashboards', 'Dashboards'), + text: t('browse-dashboards.manage-folder-nav.dashboards', 'Dashboards'), url: folder.url, }, ], @@ -40,7 +41,7 @@ export function buildNavModel(folder: FolderDTO, parents = folder.parents): NavM active: false, icon: 'library-panel', id: getLibraryPanelsTabID(folder.uid), - text: t('state.nav-model.panels', 'Panels'), + text: t('browse-dashboards.manage-folder-nav.panels', 'Panels'), url: `${folder.url}/library-panels`, }); @@ -49,7 +50,7 @@ export function buildNavModel(folder: FolderDTO, parents = folder.parents): NavM active: false, icon: 'bell', id: getAlertingTabID(folder.uid), - text: t('state.nav-models.alert-rules', 'Alert rules'), + text: t('browse-dashboards.manage-folder-nav.alert-rules', 'Alert rules'), url: `${folder.url}/alerting`, }); } @@ -60,7 +61,7 @@ export function buildNavModel(folder: FolderDTO, parents = folder.parents): NavM active: false, icon: 'lock', id: getPermissionsTabID(folder.uid), - text: 'Permissions', + text: t('browse-dashboards.manage-folder-nav.permissions', 'Permissions'), url: `${folder.url}/permissions`, }); } @@ -70,7 +71,7 @@ export function buildNavModel(folder: FolderDTO, parents = folder.parents): NavM active: false, icon: 'cog', id: getSettingsTabID(folder.uid), - text: 'Settings', + text: t('browse-dashboards.manage-folder-nav.settings', 'Settings'), url: `${folder.url}/settings`, }); } diff --git a/public/locales/de-DE/grafana.json b/public/locales/de-DE/grafana.json index da7e2a9b153c..75a658db6502 100644 --- a/public/locales/de-DE/grafana.json +++ b/public/locales/de-DE/grafana.json @@ -25,8 +25,19 @@ }, "browse-dashboards": { "action": { + "cancel-button": "", "delete-button": "", - "move-button": "" + "delete-modal-text": "", + "delete-modal-title": "", + "deleting": "", + "manage-permissions-button": "", + "move-button": "", + "move-modal-alert": "", + "move-modal-field-label": "", + "move-modal-text": "", + "move-modal-title": "", + "moving": "", + "new-folder-name-required-phrase": "" }, "dashboards-tree": { "name-column": "", @@ -38,6 +49,13 @@ "manage-permissions": "", "move": "" }, + "manage-folder-nav": { + "alert-rules": "", + "dashboards": "", + "panels": "", + "permissions": "", + "settings": "" + }, "new-folder-form": { "cancel-label": "", "create-label": "", @@ -630,16 +648,6 @@ }, "title": "Einstellungen" }, - "state": { - "nav-model": { - "dashboards": "", - "panels": "" - }, - "nav-models": { - "alert-rules": "", - "manage-folder-subtitle": "" - } - }, "tag-filter": { "loading": "Wird geladen ...", "no-tags": "Keine Tags gefunden", diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index a5f0d4e77127..abd98721106d 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -25,8 +25,19 @@ }, "browse-dashboards": { "action": { + "cancel-button": "Cancel", "delete-button": "Delete", - "move-button": "Move" + "delete-modal-text": "This action will delete the following content:", + "delete-modal-title": "Delete", + "deleting": "Deleting...", + "manage-permissions-button": "Manage permissions", + "move-button": "Move", + "move-modal-alert": "Moving this item may change its permissions.", + "move-modal-field-label": "Folder name", + "move-modal-text": "This action will move the following content:", + "move-modal-title": "Move", + "moving": "Moving...", + "new-folder-name-required-phrase": "Folder name is required." }, "dashboards-tree": { "name-column": "Name", @@ -38,6 +49,13 @@ "manage-permissions": "Manage permissions", "move": "Move" }, + "manage-folder-nav": { + "alert-rules": "Alert rules", + "dashboards": "Dashboards", + "panels": "Panels", + "permissions": "Permissions", + "settings": "Settings" + }, "new-folder-form": { "cancel-label": "Cancel", "create-label": "Create", @@ -630,16 +648,6 @@ }, "title": "Preferences" }, - "state": { - "nav-model": { - "dashboards": "Dashboards", - "panels": "Panels" - }, - "nav-models": { - "alert-rules": "Alert rules", - "manage-folder-subtitle": "Manage folder dashboards and permissions" - } - }, "tag-filter": { "loading": "Loading...", "no-tags": "No tags found", diff --git a/public/locales/es-ES/grafana.json b/public/locales/es-ES/grafana.json index b9f70e753f8f..7ab005bbca6b 100644 --- a/public/locales/es-ES/grafana.json +++ b/public/locales/es-ES/grafana.json @@ -25,8 +25,19 @@ }, "browse-dashboards": { "action": { + "cancel-button": "", "delete-button": "", - "move-button": "" + "delete-modal-text": "", + "delete-modal-title": "", + "deleting": "", + "manage-permissions-button": "", + "move-button": "", + "move-modal-alert": "", + "move-modal-field-label": "", + "move-modal-text": "", + "move-modal-title": "", + "moving": "", + "new-folder-name-required-phrase": "" }, "dashboards-tree": { "name-column": "", @@ -38,6 +49,13 @@ "manage-permissions": "", "move": "" }, + "manage-folder-nav": { + "alert-rules": "", + "dashboards": "", + "panels": "", + "permissions": "", + "settings": "" + }, "new-folder-form": { "cancel-label": "", "create-label": "", @@ -630,16 +648,6 @@ }, "title": "Preferencias" }, - "state": { - "nav-model": { - "dashboards": "", - "panels": "" - }, - "nav-models": { - "alert-rules": "", - "manage-folder-subtitle": "" - } - }, "tag-filter": { "loading": "Cargando...", "no-tags": "No se ha encontrado ninguna etiqueta", diff --git a/public/locales/fr-FR/grafana.json b/public/locales/fr-FR/grafana.json index 4e34f1ee0887..f1dcc70e2f68 100644 --- a/public/locales/fr-FR/grafana.json +++ b/public/locales/fr-FR/grafana.json @@ -25,8 +25,19 @@ }, "browse-dashboards": { "action": { + "cancel-button": "", "delete-button": "", - "move-button": "" + "delete-modal-text": "", + "delete-modal-title": "", + "deleting": "", + "manage-permissions-button": "", + "move-button": "", + "move-modal-alert": "", + "move-modal-field-label": "", + "move-modal-text": "", + "move-modal-title": "", + "moving": "", + "new-folder-name-required-phrase": "" }, "dashboards-tree": { "name-column": "", @@ -38,6 +49,13 @@ "manage-permissions": "", "move": "" }, + "manage-folder-nav": { + "alert-rules": "", + "dashboards": "", + "panels": "", + "permissions": "", + "settings": "" + }, "new-folder-form": { "cancel-label": "", "create-label": "", @@ -630,16 +648,6 @@ }, "title": "Préférences" }, - "state": { - "nav-model": { - "dashboards": "", - "panels": "" - }, - "nav-models": { - "alert-rules": "", - "manage-folder-subtitle": "" - } - }, "tag-filter": { "loading": "Chargement en cours...", "no-tags": "Aucune étiquette trouvée", diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 584cb5364b5c..b156cc16b4c8 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -25,8 +25,19 @@ }, "browse-dashboards": { "action": { + "cancel-button": "Cäʼnčęľ", "delete-button": "Đęľęŧę", - "move-button": "Mővę" + "delete-modal-text": "Ŧĥįş äčŧįőʼn ŵįľľ đęľęŧę ŧĥę ƒőľľőŵįʼnģ čőʼnŧęʼnŧ:", + "delete-modal-title": "Đęľęŧę", + "deleting": "Đęľęŧįʼnģ...", + "manage-permissions-button": "Mäʼnäģę pęřmįşşįőʼnş", + "move-button": "Mővę", + "move-modal-alert": "Mővįʼnģ ŧĥįş įŧęm mäy čĥäʼnģę įŧş pęřmįşşįőʼnş.", + "move-modal-field-label": "Főľđęř ʼnämę", + "move-modal-text": "Ŧĥįş äčŧįőʼn ŵįľľ mővę ŧĥę ƒőľľőŵįʼnģ čőʼnŧęʼnŧ:", + "move-modal-title": "Mővę", + "moving": "Mővįʼnģ...", + "new-folder-name-required-phrase": "Főľđęř ʼnämę įş řęqūįřęđ." }, "dashboards-tree": { "name-column": "Ńämę", @@ -38,6 +49,13 @@ "manage-permissions": "Mäʼnäģę pęřmįşşįőʼnş", "move": "Mővę" }, + "manage-folder-nav": { + "alert-rules": "Åľęřŧ řūľęş", + "dashboards": "Đäşĥþőäřđş", + "panels": "Päʼnęľş", + "permissions": "Pęřmįşşįőʼnş", + "settings": "Ŝęŧŧįʼnģş" + }, "new-folder-form": { "cancel-label": "Cäʼnčęľ", "create-label": "Cřęäŧę", @@ -630,16 +648,6 @@ }, "title": "Přęƒęřęʼnčęş" }, - "state": { - "nav-model": { - "dashboards": "Đäşĥþőäřđş", - "panels": "Päʼnęľş" - }, - "nav-models": { - "alert-rules": "Åľęřŧ řūľęş", - "manage-folder-subtitle": "Mäʼnäģę ƒőľđęř đäşĥþőäřđş äʼnđ pęřmįşşįőʼnş" - } - }, "tag-filter": { "loading": "Ŀőäđįʼnģ...", "no-tags": "Ńő ŧäģş ƒőūʼnđ", diff --git a/public/locales/zh-Hans/grafana.json b/public/locales/zh-Hans/grafana.json index 6e5d60048a5d..35a2f471416e 100644 --- a/public/locales/zh-Hans/grafana.json +++ b/public/locales/zh-Hans/grafana.json @@ -25,8 +25,19 @@ }, "browse-dashboards": { "action": { + "cancel-button": "", "delete-button": "", - "move-button": "" + "delete-modal-text": "", + "delete-modal-title": "", + "deleting": "", + "manage-permissions-button": "", + "move-button": "", + "move-modal-alert": "", + "move-modal-field-label": "", + "move-modal-text": "", + "move-modal-title": "", + "moving": "", + "new-folder-name-required-phrase": "" }, "dashboards-tree": { "name-column": "", @@ -38,6 +49,13 @@ "manage-permissions": "", "move": "" }, + "manage-folder-nav": { + "alert-rules": "", + "dashboards": "", + "panels": "", + "permissions": "", + "settings": "" + }, "new-folder-form": { "cancel-label": "", "create-label": "", @@ -630,16 +648,6 @@ }, "title": "首选项" }, - "state": { - "nav-model": { - "dashboards": "", - "panels": "" - }, - "nav-models": { - "alert-rules": "", - "manage-folder-subtitle": "" - } - }, "tag-filter": { "loading": "加载中...", "no-tags": "未找到标签",