diff --git a/public/app/features/dashboard/utils/getPanelMenu.ts b/public/app/features/dashboard/utils/getPanelMenu.ts index f5921d734b3..ef99116806e 100644 --- a/public/app/features/dashboard/utils/getPanelMenu.ts +++ b/public/app/features/dashboard/utils/getPanelMenu.ts @@ -1,3 +1,5 @@ +import { t } from '@lingui/macro'; + import { PanelMenuItem } from '@grafana/data'; import { AngularComponent, getDataSourceSrv, locationService } from '@grafana/runtime'; import { PanelCtrl } from 'app/angular/panel/panel_ctrl'; @@ -90,8 +92,12 @@ export function getPanelMenu( const menu: PanelMenuItem[] = []; if (!panel.isEditing) { + const viewTextTranslation = t({ + id: 'panel.header-menu.view', + message: `View`, + }); menu.push({ - text: 'View', + text: viewTextTranslation, iconClassName: 'eye', onClick: onViewPanel, shortcut: 'v', @@ -107,8 +113,13 @@ export function getPanelMenu( }); } + const shareTextTranslation = t({ + id: 'panel.header-menu.share', + message: `Share`, + }); + menu.push({ - text: 'Share', + text: shareTextTranslation, iconClassName: 'share-alt', onClick: onSharePanel, shortcut: 'p s', @@ -127,8 +138,13 @@ export function getPanelMenu( // Only show these inspect actions for data plugins if (panel.plugin && !panel.plugin.meta.skipDataQuery) { + const dataTextTranslation = t({ + id: 'panel.header-menu.inspect-data', + message: `Data`, + }); + inspectMenu.push({ - text: 'Data', + text: dataTextTranslation, onClick: (e: React.MouseEvent) => onInspectPanel('data'), }); @@ -140,14 +156,23 @@ export function getPanelMenu( } } + const jsonTextTranslation = t({ + id: 'panel.header-menu.inspect-json', + message: `Panel JSON`, + }); + inspectMenu.push({ - text: 'Panel JSON', + text: jsonTextTranslation, onClick: (e: React.MouseEvent) => onInspectPanel('json'), }); + const inspectTextTranslation = t({ + id: 'panel.header-menu.inspect', + message: `Inspect`, + }); menu.push({ type: 'submenu', - text: 'Inspect', + text: inspectTextTranslation, iconClassName: 'info-circle', onClick: (e: React.MouseEvent) => onInspectPanel(), shortcut: 'i', @@ -205,9 +230,13 @@ export function getPanelMenu( } if (!panel.isEditing && subMenu.length) { + const moreTextTranslation = t({ + id: 'panel.header-menu.more', + message: `More...`, + }); menu.push({ type: 'submenu', - text: 'More...', + text: moreTextTranslation, iconClassName: 'cube', subMenu, onClick: onMore, diff --git a/public/app/plugins/panel/graph/module.ts b/public/app/plugins/panel/graph/module.ts index 7c2d7ade2e9..18a901a2c9f 100644 --- a/public/app/plugins/panel/graph/module.ts +++ b/public/app/plugins/panel/graph/module.ts @@ -5,6 +5,7 @@ import './time_regions_form'; import './annotation_tooltip'; import './event_editor'; +import { t } from '@lingui/macro'; import { auto } from 'angular'; import { defaults, find, without } from 'lodash'; @@ -183,7 +184,11 @@ export class GraphCtrl extends MetricsPanelCtrl { } onInitPanelActions(actions: any[]) { - actions.push({ text: 'Toggle legend', click: 'ctrl.toggleLegend()', shortcut: 'p l' }); + const toggleTextTranslation = t({ + id: 'panel.header-menu.more-toggle', + message: `Toggle legend`, + }); + actions.push({ text: toggleTextTranslation, click: 'ctrl.toggleLegend()', shortcut: 'p l' }); } zoomOut(evt: any) { diff --git a/public/locales/en/messages.po b/public/locales/en/messages.po index 8f3ed98c01e..bc3ef72515a 100644 --- a/public/locales/en/messages.po +++ b/public/locales/en/messages.po @@ -74,10 +74,6 @@ msgstr "Silences" msgid "nav.api-keys" msgstr "API keys" -#: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.change-password" -msgstr "Change password" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.config" msgstr "Configuration" @@ -114,10 +110,6 @@ msgstr "Data sources" msgid "nav.explore" msgstr "Explore" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.folder" -#~ msgstr "New folder" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.help" msgstr "Help" @@ -126,10 +118,6 @@ msgstr "Help" msgid "nav.home" msgstr "Home" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.import" -#~ msgstr "Import" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.library-panels" msgstr "Library panels" @@ -175,7 +163,11 @@ msgid "nav.plugins" msgstr "Plugins" #: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.profile-settings" +msgid "nav.profile/password" +msgstr "Change password" + +#: public/app/core/components/NavBar/navBarItem-translations.ts +msgid "nav.profile/settings" msgstr "Preferences" #: public/app/core/components/NavBar/navBarItem-translations.ts @@ -206,6 +198,34 @@ msgstr "Teams" msgid "nav.users" msgstr "Users" +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect" +msgstr "Inspect" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-data" +msgstr "Data" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-json" +msgstr "Panel JSON" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.more" +msgstr "More..." + +#: public/app/plugins/panel/graph/module.ts +msgid "panel.header-menu.more-toggle" +msgstr "Toggle legend" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.share" +msgstr "Share" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.view" +msgstr "View" + #: public/app/core/components/SharedPreferences/SharedPreferences.tsx msgid "shared-dashboard.fields.timezone-label" msgstr "Timezone" diff --git a/public/locales/es/messages.po b/public/locales/es/messages.po index 02cc5dbd234..17211becec3 100644 --- a/public/locales/es/messages.po +++ b/public/locales/es/messages.po @@ -74,10 +74,6 @@ msgstr "" msgid "nav.api-keys" msgstr "" -#: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.change-password" -msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.config" msgstr "" @@ -114,10 +110,6 @@ msgstr "" msgid "nav.explore" msgstr "" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.folder" -#~ msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.help" msgstr "" @@ -126,10 +118,6 @@ msgstr "" msgid "nav.home" msgstr "" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.import" -#~ msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.library-panels" msgstr "" @@ -175,7 +163,11 @@ msgid "nav.plugins" msgstr "" #: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.profile-settings" +msgid "nav.profile/password" +msgstr "" + +#: public/app/core/components/NavBar/navBarItem-translations.ts +msgid "nav.profile/settings" msgstr "" #: public/app/core/components/NavBar/navBarItem-translations.ts @@ -206,6 +198,34 @@ msgstr "" msgid "nav.users" msgstr "" +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-data" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-json" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.more" +msgstr "" + +#: public/app/plugins/panel/graph/module.ts +msgid "panel.header-menu.more-toggle" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.share" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.view" +msgstr "" + #: public/app/core/components/SharedPreferences/SharedPreferences.tsx msgid "shared-dashboard.fields.timezone-label" msgstr "" diff --git a/public/locales/fr/messages.po b/public/locales/fr/messages.po index 60c0e697e5a..b9d4af98d71 100644 --- a/public/locales/fr/messages.po +++ b/public/locales/fr/messages.po @@ -74,10 +74,6 @@ msgstr "" msgid "nav.api-keys" msgstr "" -#: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.change-password" -msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.config" msgstr "" @@ -114,10 +110,6 @@ msgstr "" msgid "nav.explore" msgstr "" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.folder" -#~ msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.help" msgstr "" @@ -126,10 +118,6 @@ msgstr "" msgid "nav.home" msgstr "" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.import" -#~ msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.library-panels" msgstr "" @@ -175,7 +163,11 @@ msgid "nav.plugins" msgstr "" #: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.profile-settings" +msgid "nav.profile/password" +msgstr "" + +#: public/app/core/components/NavBar/navBarItem-translations.ts +msgid "nav.profile/settings" msgstr "" #: public/app/core/components/NavBar/navBarItem-translations.ts @@ -206,6 +198,34 @@ msgstr "" msgid "nav.users" msgstr "" +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-data" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-json" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.more" +msgstr "" + +#: public/app/plugins/panel/graph/module.ts +msgid "panel.header-menu.more-toggle" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.share" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.view" +msgstr "" + #: public/app/core/components/SharedPreferences/SharedPreferences.tsx msgid "shared-dashboard.fields.timezone-label" msgstr "" diff --git a/public/locales/pseudo-LOCALE/messages.po b/public/locales/pseudo-LOCALE/messages.po index 68a87f8afcb..1c32ef4a32c 100644 --- a/public/locales/pseudo-LOCALE/messages.po +++ b/public/locales/pseudo-LOCALE/messages.po @@ -74,10 +74,6 @@ msgstr "" msgid "nav.api-keys" msgstr "" -#: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.change-password" -msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.config" msgstr "" @@ -114,10 +110,6 @@ msgstr "" msgid "nav.explore" msgstr "" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.folder" -#~ msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.help" msgstr "" @@ -126,10 +118,6 @@ msgstr "" msgid "nav.home" msgstr "" -#: public/app/core/components/NavBar/NavBarItem.tsx -#~ msgid "nav.import" -#~ msgstr "" - #: public/app/core/components/NavBar/navBarItem-translations.ts msgid "nav.library-panels" msgstr "" @@ -175,7 +163,11 @@ msgid "nav.plugins" msgstr "" #: public/app/core/components/NavBar/navBarItem-translations.ts -msgid "nav.profile-settings" +msgid "nav.profile/password" +msgstr "" + +#: public/app/core/components/NavBar/navBarItem-translations.ts +msgid "nav.profile/settings" msgstr "" #: public/app/core/components/NavBar/navBarItem-translations.ts @@ -206,6 +198,34 @@ msgstr "" msgid "nav.users" msgstr "" +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-data" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.inspect-json" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.more" +msgstr "" + +#: public/app/plugins/panel/graph/module.ts +msgid "panel.header-menu.more-toggle" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.share" +msgstr "" + +#: public/app/features/dashboard/utils/getPanelMenu.ts +msgid "panel.header-menu.view" +msgstr "" + #: public/app/core/components/SharedPreferences/SharedPreferences.tsx msgid "shared-dashboard.fields.timezone-label" msgstr ""