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 { 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<any>) => 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<any>) => 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<any>) => 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,

@ -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) {

@ -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"

@ -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 ""

@ -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 ""

@ -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 ""

Loading…
Cancel
Save