From 6150d1370c882f11eeb0f25a26a347e72908b83d Mon Sep 17 00:00:00 2001 From: Abhi Shandilya Date: Tue, 3 Oct 2023 10:12:44 -0400 Subject: [PATCH] i18n: dashboard settings (#75854) * feat: i18n dashboard settings * run i18n extract * rename titles and use vars * json editor title --------- Co-authored-by: Ashley Harrison --- .../DashboardSettings/DashboardSettings.tsx | 25 +++++++++++-------- public/locales/de-DE/grafana.json | 22 +++++++++++++++- public/locales/en-US/grafana.json | 22 +++++++++++++++- public/locales/es-ES/grafana.json | 22 +++++++++++++++- public/locales/fr-FR/grafana.json | 22 +++++++++++++++- public/locales/pseudo-LOCALE/grafana.json | 22 +++++++++++++++- public/locales/zh-Hans/grafana.json | 22 +++++++++++++++- 7 files changed, 141 insertions(+), 16 deletions(-) diff --git a/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx b/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx index 1dec8cc54eb..4cbf1393b14 100644 --- a/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/DashboardSettings.tsx @@ -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, diff --git a/public/locales/de-DE/grafana.json b/public/locales/de-DE/grafana.json index bb927adc9e2..9983480cfb8 100644 --- a/public/locales/de-DE/grafana.json +++ b/public/locales/de-DE/grafana.json @@ -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": { diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 06275996598..d7321924793 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -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": { diff --git a/public/locales/es-ES/grafana.json b/public/locales/es-ES/grafana.json index 5c37dee4944..2b3213c2267 100644 --- a/public/locales/es-ES/grafana.json +++ b/public/locales/es-ES/grafana.json @@ -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": { diff --git a/public/locales/fr-FR/grafana.json b/public/locales/fr-FR/grafana.json index 5fe33fe0e6f..1e46a7f9328 100644 --- a/public/locales/fr-FR/grafana.json +++ b/public/locales/fr-FR/grafana.json @@ -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": { diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 36835e932d7..567fd3a94bc 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -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": { diff --git a/public/locales/zh-Hans/grafana.json b/public/locales/zh-Hans/grafana.json index 84bde632b13..3935c235763 100644 --- a/public/locales/zh-Hans/grafana.json +++ b/public/locales/zh-Hans/grafana.json @@ -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": {