i18n: dashboard settings (#75854)

* feat: i18n dashboard settings

* run i18n extract

* rename titles and use vars

* json editor title

---------

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
This commit is contained in:
Abhi Shandilya 2023-10-03 10:12:44 -04:00 committed by GitHub
parent e8a708c16e
commit 6150d1370c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 141 additions and 16 deletions

View File

@ -9,6 +9,7 @@ import { Button, ToolbarButtonRow } from '@grafana/ui';
import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate';
import { Page } from 'app/core/components/Page/Page';
import config from 'app/core/config';
import { t } from 'app/core/internationalization';
import { contextSrv } from 'app/core/services/context_srv';
import { AccessControlAction } from 'app/types';
import { DashboardMetaChangedEvent } from 'app/types/events';
@ -91,16 +92,18 @@ export function DashboardSettings({ dashboard, editview, pageNav, sectionNav }:
function getSettingsPages(dashboard: DashboardModel) {
const pages: SettingsPage[] = [];
const generalTitle = t('dashboard-settings.general.title', 'General');
if (dashboard.meta.canEdit) {
pages.push({
title: 'General',
title: generalTitle,
id: 'settings',
icon: 'sliders-v-alt',
component: GeneralSettings,
});
pages.push({
title: 'Annotations',
title: t('dashboard-settings.annotations.title', 'Annotations'),
id: 'annotations',
icon: 'comment-alt',
component: AnnotationsSettings,
@ -109,7 +112,7 @@ function getSettingsPages(dashboard: DashboardModel) {
});
pages.push({
title: 'Variables',
title: t('dashboard-settings.variables.title', 'Variables'),
id: 'templating',
icon: 'calculator-alt',
component: VariableEditorContainer,
@ -117,7 +120,7 @@ function getSettingsPages(dashboard: DashboardModel) {
});
pages.push({
title: 'Links',
title: t('dashboard-settings.links.title', 'Links'),
id: 'links',
icon: 'link',
component: LinksSettings,
@ -126,7 +129,7 @@ function getSettingsPages(dashboard: DashboardModel) {
if (dashboard.meta.canMakeEditable) {
pages.push({
title: 'General',
title: generalTitle,
icon: 'sliders-v-alt',
id: 'settings',
component: MakeEditable,
@ -135,24 +138,26 @@ function getSettingsPages(dashboard: DashboardModel) {
if (dashboard.id && dashboard.meta.canSave) {
pages.push({
title: 'Versions',
title: t('dashboard-settings.versions.title', 'Versions'),
id: 'versions',
icon: 'history',
component: VersionsSettings,
});
}
const permissionsTitle = t('dashboard-settings.permissions.title', 'Permissions');
if (dashboard.id && dashboard.meta.canAdmin) {
if (!config.rbacEnabled) {
pages.push({
title: 'Permissions',
title: permissionsTitle,
id: 'permissions',
icon: 'lock',
component: DashboardPermissions,
});
} else if (contextSrv.hasPermission(AccessControlAction.DashboardsPermissionsRead)) {
pages.push({
title: 'Permissions',
title: permissionsTitle,
id: 'permissions',
icon: 'lock',
component: AccessControlDashboardPermissions,
@ -161,7 +166,7 @@ function getSettingsPages(dashboard: DashboardModel) {
}
pages.push({
title: 'JSON Model',
title: t('dashboard-settings.json-editor.title', 'JSON Model'),
id: 'dashboard_json',
icon: 'arrow',
component: JsonEditorSettings,
@ -185,7 +190,7 @@ function getSectionNav(
location: H.Location
): NavModel {
const main: NavModelItem = {
text: 'Settings',
text: t('dashboard-settings.settings.title', 'Settings'),
children: [],
icon: 'apps',
hideFromBreadcrumbs: true,

View File

@ -260,6 +260,9 @@
}
},
"dashboard-settings": {
"annotations": {
"title": ""
},
"dashboard-delete-button": "",
"general": {
"auto-refresh-description": "",
@ -272,11 +275,22 @@
"panel-options-graph-tooltip-label": "",
"panel-options-label": "",
"tags-label": "",
"title": "",
"title-label": ""
},
"json-editor": {
"save-button": "",
"subtitle": ""
"subtitle": "",
"title": ""
},
"links": {
"title": ""
},
"permissions": {
"title": ""
},
"settings": {
"title": ""
},
"time-picker": {
"hide-time-picker": "",
@ -287,6 +301,12 @@
"time-options-label": "",
"time-zone-label": "",
"week-start-label": ""
},
"variables": {
"title": ""
},
"versions": {
"title": ""
}
},
"data-source-picker": {

View File

@ -260,6 +260,9 @@
}
},
"dashboard-settings": {
"annotations": {
"title": "Annotations"
},
"dashboard-delete-button": "Delete Dashboard",
"general": {
"auto-refresh-description": "Define the auto refresh intervals that should be available in the auto refresh list.",
@ -272,11 +275,22 @@
"panel-options-graph-tooltip-label": "Graph tooltip",
"panel-options-label": "Panel options",
"tags-label": "Tags",
"title": "General",
"title-label": "Title"
},
"json-editor": {
"save-button": "Save changes",
"subtitle": "The JSON model below is the data structure that defines the dashboard. This includes dashboard settings, panel settings, layout, queries, and so on."
"subtitle": "The JSON model below is the data structure that defines the dashboard. This includes dashboard settings, panel settings, layout, queries, and so on.",
"title": "JSON Model"
},
"links": {
"title": "Links"
},
"permissions": {
"title": "Permissions"
},
"settings": {
"title": "Settings"
},
"time-picker": {
"hide-time-picker": "Hide time picker",
@ -287,6 +301,12 @@
"time-options-label": "Time options",
"time-zone-label": "Time zone",
"week-start-label": "Week start"
},
"variables": {
"title": "Variables"
},
"versions": {
"title": "Versions"
}
},
"data-source-picker": {

View File

@ -265,6 +265,9 @@
}
},
"dashboard-settings": {
"annotations": {
"title": ""
},
"dashboard-delete-button": "",
"general": {
"auto-refresh-description": "",
@ -277,11 +280,22 @@
"panel-options-graph-tooltip-label": "",
"panel-options-label": "",
"tags-label": "",
"title": "",
"title-label": ""
},
"json-editor": {
"save-button": "",
"subtitle": ""
"subtitle": "",
"title": ""
},
"links": {
"title": ""
},
"permissions": {
"title": ""
},
"settings": {
"title": ""
},
"time-picker": {
"hide-time-picker": "",
@ -292,6 +306,12 @@
"time-options-label": "",
"time-zone-label": "",
"week-start-label": ""
},
"variables": {
"title": ""
},
"versions": {
"title": ""
}
},
"data-source-picker": {

View File

@ -265,6 +265,9 @@
}
},
"dashboard-settings": {
"annotations": {
"title": ""
},
"dashboard-delete-button": "",
"general": {
"auto-refresh-description": "",
@ -277,11 +280,22 @@
"panel-options-graph-tooltip-label": "",
"panel-options-label": "",
"tags-label": "",
"title": "",
"title-label": ""
},
"json-editor": {
"save-button": "",
"subtitle": ""
"subtitle": "",
"title": ""
},
"links": {
"title": ""
},
"permissions": {
"title": ""
},
"settings": {
"title": ""
},
"time-picker": {
"hide-time-picker": "",
@ -292,6 +306,12 @@
"time-options-label": "",
"time-zone-label": "",
"week-start-label": ""
},
"variables": {
"title": ""
},
"versions": {
"title": ""
}
},
"data-source-picker": {

View File

@ -260,6 +260,9 @@
}
},
"dashboard-settings": {
"annotations": {
"title": "Åʼnʼnőŧäŧįőʼnş"
},
"dashboard-delete-button": "Đęľęŧę Đäşĥþőäřđ",
"general": {
"auto-refresh-description": "Đęƒįʼnę ŧĥę äūŧő řęƒřęşĥ įʼnŧęřväľş ŧĥäŧ şĥőūľđ þę äväįľäþľę įʼn ŧĥę äūŧő řęƒřęşĥ ľįşŧ.",
@ -272,11 +275,22 @@
"panel-options-graph-tooltip-label": "Ğřäpĥ ŧőőľŧįp",
"panel-options-label": "Päʼnęľ őpŧįőʼnş",
"tags-label": "Ŧäģş",
"title": "Ğęʼnęřäľ",
"title-label": "Ŧįŧľę"
},
"json-editor": {
"save-button": "Ŝävę čĥäʼnģęş",
"subtitle": "Ŧĥę ĴŜØŃ mőđęľ þęľőŵ įş ŧĥę đäŧä şŧřūčŧūřę ŧĥäŧ đęƒįʼnęş ŧĥę đäşĥþőäřđ. Ŧĥįş įʼnčľūđęş đäşĥþőäřđ şęŧŧįʼnģş, päʼnęľ şęŧŧįʼnģş, ľäyőūŧ, qūęřįęş, äʼnđ şő őʼn."
"subtitle": "Ŧĥę ĴŜØŃ mőđęľ þęľőŵ įş ŧĥę đäŧä şŧřūčŧūřę ŧĥäŧ đęƒįʼnęş ŧĥę đäşĥþőäřđ. Ŧĥįş įʼnčľūđęş đäşĥþőäřđ şęŧŧįʼnģş, päʼnęľ şęŧŧįʼnģş, ľäyőūŧ, qūęřįęş, äʼnđ şő őʼn.",
"title": "ĴŜØŃ Mőđęľ"
},
"links": {
"title": "Ŀįʼnĸş"
},
"permissions": {
"title": "Pęřmįşşįőʼnş"
},
"settings": {
"title": "Ŝęŧŧįʼnģş"
},
"time-picker": {
"hide-time-picker": "Ħįđę ŧįmę pįčĸęř",
@ -287,6 +301,12 @@
"time-options-label": "Ŧįmę őpŧįőʼnş",
"time-zone-label": "Ŧįmę žőʼnę",
"week-start-label": "Ŵęęĸ şŧäřŧ"
},
"variables": {
"title": "Väřįäþľęş"
},
"versions": {
"title": "Vęřşįőʼnş"
}
},
"data-source-picker": {

View File

@ -255,6 +255,9 @@
}
},
"dashboard-settings": {
"annotations": {
"title": ""
},
"dashboard-delete-button": "",
"general": {
"auto-refresh-description": "",
@ -267,11 +270,22 @@
"panel-options-graph-tooltip-label": "",
"panel-options-label": "",
"tags-label": "",
"title": "",
"title-label": ""
},
"json-editor": {
"save-button": "",
"subtitle": ""
"subtitle": "",
"title": ""
},
"links": {
"title": ""
},
"permissions": {
"title": ""
},
"settings": {
"title": ""
},
"time-picker": {
"hide-time-picker": "",
@ -282,6 +296,12 @@
"time-options-label": "",
"time-zone-label": "",
"week-start-label": ""
},
"variables": {
"title": ""
},
"versions": {
"title": ""
}
},
"data-source-picker": {