Internationalisation: Translates the panel header menu (#52168)

pull/52203/head
eledobleefe 3 years ago committed by GitHub
parent 1d077e84ce
commit e565f69711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 41
      public/app/features/dashboard/utils/getPanelMenu.ts
  2. 7
      public/app/plugins/panel/graph/module.ts
  3. 46
      public/locales/en/messages.po
  4. 46
      public/locales/es/messages.po
  5. 46
      public/locales/fr/messages.po
  6. 46
      public/locales/pseudo-LOCALE/messages.po

@ -1,3 +1,5 @@
import { t } from '@lingui/macro';
import { PanelMenuItem } from '@grafana/data'; import { PanelMenuItem } from '@grafana/data';
import { AngularComponent, getDataSourceSrv, locationService } from '@grafana/runtime'; import { AngularComponent, getDataSourceSrv, locationService } from '@grafana/runtime';
import { PanelCtrl } from 'app/angular/panel/panel_ctrl'; import { PanelCtrl } from 'app/angular/panel/panel_ctrl';
@ -90,8 +92,12 @@ export function getPanelMenu(
const menu: PanelMenuItem[] = []; const menu: PanelMenuItem[] = [];
if (!panel.isEditing) { if (!panel.isEditing) {
const viewTextTranslation = t({
id: 'panel.header-menu.view',
message: `View`,
});
menu.push({ menu.push({
text: 'View', text: viewTextTranslation,
iconClassName: 'eye', iconClassName: 'eye',
onClick: onViewPanel, onClick: onViewPanel,
shortcut: 'v', shortcut: 'v',
@ -107,8 +113,13 @@ export function getPanelMenu(
}); });
} }
const shareTextTranslation = t({
id: 'panel.header-menu.share',
message: `Share`,
});
menu.push({ menu.push({
text: 'Share', text: shareTextTranslation,
iconClassName: 'share-alt', iconClassName: 'share-alt',
onClick: onSharePanel, onClick: onSharePanel,
shortcut: 'p s', shortcut: 'p s',
@ -127,8 +138,13 @@ export function getPanelMenu(
// Only show these inspect actions for data plugins // Only show these inspect actions for data plugins
if (panel.plugin && !panel.plugin.meta.skipDataQuery) { if (panel.plugin && !panel.plugin.meta.skipDataQuery) {
const dataTextTranslation = t({
id: 'panel.header-menu.inspect-data',
message: `Data`,
});
inspectMenu.push({ inspectMenu.push({
text: 'Data', text: dataTextTranslation,
onClick: (e: React.MouseEvent<any>) => onInspectPanel('data'), onClick: (e: React.MouseEvent<any>) => onInspectPanel('data'),
}); });
@ -140,14 +156,23 @@ export function getPanelMenu(
} }
} }
const jsonTextTranslation = t({
id: 'panel.header-menu.inspect-json',
message: `Panel JSON`,
});
inspectMenu.push({ inspectMenu.push({
text: 'Panel JSON', text: jsonTextTranslation,
onClick: (e: React.MouseEvent<any>) => onInspectPanel('json'), onClick: (e: React.MouseEvent<any>) => onInspectPanel('json'),
}); });
const inspectTextTranslation = t({
id: 'panel.header-menu.inspect',
message: `Inspect`,
});
menu.push({ menu.push({
type: 'submenu', type: 'submenu',
text: 'Inspect', text: inspectTextTranslation,
iconClassName: 'info-circle', iconClassName: 'info-circle',
onClick: (e: React.MouseEvent<any>) => onInspectPanel(), onClick: (e: React.MouseEvent<any>) => onInspectPanel(),
shortcut: 'i', shortcut: 'i',
@ -205,9 +230,13 @@ export function getPanelMenu(
} }
if (!panel.isEditing && subMenu.length) { if (!panel.isEditing && subMenu.length) {
const moreTextTranslation = t({
id: 'panel.header-menu.more',
message: `More...`,
});
menu.push({ menu.push({
type: 'submenu', type: 'submenu',
text: 'More...', text: moreTextTranslation,
iconClassName: 'cube', iconClassName: 'cube',
subMenu, subMenu,
onClick: onMore, onClick: onMore,

@ -5,6 +5,7 @@ import './time_regions_form';
import './annotation_tooltip'; import './annotation_tooltip';
import './event_editor'; import './event_editor';
import { t } from '@lingui/macro';
import { auto } from 'angular'; import { auto } from 'angular';
import { defaults, find, without } from 'lodash'; import { defaults, find, without } from 'lodash';
@ -183,7 +184,11 @@ export class GraphCtrl extends MetricsPanelCtrl {
} }
onInitPanelActions(actions: any[]) { 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) { zoomOut(evt: any) {

@ -74,10 +74,6 @@ msgstr "Silences"
msgid "nav.api-keys" msgid "nav.api-keys"
msgstr "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 #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.config" msgid "nav.config"
msgstr "Configuration" msgstr "Configuration"
@ -114,10 +110,6 @@ msgstr "Data sources"
msgid "nav.explore" msgid "nav.explore"
msgstr "Explore" msgstr "Explore"
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.folder"
#~ msgstr "New folder"
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.help" msgid "nav.help"
msgstr "Help" msgstr "Help"
@ -126,10 +118,6 @@ msgstr "Help"
msgid "nav.home" msgid "nav.home"
msgstr "Home" msgstr "Home"
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.import"
#~ msgstr "Import"
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.library-panels" msgid "nav.library-panels"
msgstr "Library panels" msgstr "Library panels"
@ -175,7 +163,11 @@ msgid "nav.plugins"
msgstr "Plugins" msgstr "Plugins"
#: public/app/core/components/NavBar/navBarItem-translations.ts #: 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" msgstr "Preferences"
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
@ -206,6 +198,34 @@ msgstr "Teams"
msgid "nav.users" msgid "nav.users"
msgstr "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 #: public/app/core/components/SharedPreferences/SharedPreferences.tsx
msgid "shared-dashboard.fields.timezone-label" msgid "shared-dashboard.fields.timezone-label"
msgstr "Timezone" msgstr "Timezone"

@ -74,10 +74,6 @@ msgstr ""
msgid "nav.api-keys" msgid "nav.api-keys"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.change-password"
msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.config" msgid "nav.config"
msgstr "" msgstr ""
@ -114,10 +110,6 @@ msgstr ""
msgid "nav.explore" msgid "nav.explore"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.folder"
#~ msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.help" msgid "nav.help"
msgstr "" msgstr ""
@ -126,10 +118,6 @@ msgstr ""
msgid "nav.home" msgid "nav.home"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.import"
#~ msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.library-panels" msgid "nav.library-panels"
msgstr "" msgstr ""
@ -175,7 +163,11 @@ msgid "nav.plugins"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: 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 "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
@ -206,6 +198,34 @@ msgstr ""
msgid "nav.users" msgid "nav.users"
msgstr "" 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 #: public/app/core/components/SharedPreferences/SharedPreferences.tsx
msgid "shared-dashboard.fields.timezone-label" msgid "shared-dashboard.fields.timezone-label"
msgstr "" msgstr ""

@ -74,10 +74,6 @@ msgstr ""
msgid "nav.api-keys" msgid "nav.api-keys"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.change-password"
msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.config" msgid "nav.config"
msgstr "" msgstr ""
@ -114,10 +110,6 @@ msgstr ""
msgid "nav.explore" msgid "nav.explore"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.folder"
#~ msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.help" msgid "nav.help"
msgstr "" msgstr ""
@ -126,10 +118,6 @@ msgstr ""
msgid "nav.home" msgid "nav.home"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.import"
#~ msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.library-panels" msgid "nav.library-panels"
msgstr "" msgstr ""
@ -175,7 +163,11 @@ msgid "nav.plugins"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: 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 "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
@ -206,6 +198,34 @@ msgstr ""
msgid "nav.users" msgid "nav.users"
msgstr "" 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 #: public/app/core/components/SharedPreferences/SharedPreferences.tsx
msgid "shared-dashboard.fields.timezone-label" msgid "shared-dashboard.fields.timezone-label"
msgstr "" msgstr ""

@ -74,10 +74,6 @@ msgstr ""
msgid "nav.api-keys" msgid "nav.api-keys"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.change-password"
msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.config" msgid "nav.config"
msgstr "" msgstr ""
@ -114,10 +110,6 @@ msgstr ""
msgid "nav.explore" msgid "nav.explore"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.folder"
#~ msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.help" msgid "nav.help"
msgstr "" msgstr ""
@ -126,10 +118,6 @@ msgstr ""
msgid "nav.home" msgid "nav.home"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/NavBarItem.tsx
#~ msgid "nav.import"
#~ msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
msgid "nav.library-panels" msgid "nav.library-panels"
msgstr "" msgstr ""
@ -175,7 +163,11 @@ msgid "nav.plugins"
msgstr "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: 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 "" msgstr ""
#: public/app/core/components/NavBar/navBarItem-translations.ts #: public/app/core/components/NavBar/navBarItem-translations.ts
@ -206,6 +198,34 @@ msgstr ""
msgid "nav.users" msgid "nav.users"
msgstr "" 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 #: public/app/core/components/SharedPreferences/SharedPreferences.tsx
msgid "shared-dashboard.fields.timezone-label" msgid "shared-dashboard.fields.timezone-label"
msgstr "" msgstr ""

Loading…
Cancel
Save