From af9b071a78e99eca82f2040b31fac5e0297810da Mon Sep 17 00:00:00 2001 From: RoxanaAnamariaTurc <106086831+RoxanaAnamariaTurc@users.noreply.github.com> Date: Fri, 30 Jun 2023 11:27:19 +0100 Subject: [PATCH] I18n: Mark up strings on Navigation - Connections section (#70914) --- .../MegaMenu/navBarItem-translations.ts | 10 ++++++++ .../tabs/ConnectData/ConnectData.tsx | 4 +++- .../tabs/ConnectData/Search/Search.tsx | 5 +++- .../components/DataSourceAddButton.tsx | 3 ++- public/locales/de-DE/grafana.json | 24 +++++++++++++++++++ public/locales/en-US/grafana.json | 24 +++++++++++++++++++ public/locales/es-ES/grafana.json | 24 +++++++++++++++++++ public/locales/fr-FR/grafana.json | 24 +++++++++++++++++++ public/locales/pseudo-LOCALE/grafana.json | 24 +++++++++++++++++++ public/locales/zh-Hans/grafana.json | 24 +++++++++++++++++++ 10 files changed, 163 insertions(+), 3 deletions(-) diff --git a/public/app/core/components/AppChrome/MegaMenu/navBarItem-translations.ts b/public/app/core/components/AppChrome/MegaMenu/navBarItem-translations.ts index 1b1ca51d8da..51b6b9ac6fa 100644 --- a/public/app/core/components/AppChrome/MegaMenu/navBarItem-translations.ts +++ b/public/app/core/components/AppChrome/MegaMenu/navBarItem-translations.ts @@ -118,6 +118,12 @@ export function getNavTitle(navId: string | undefined) { return t('nav.sign-out.title', 'Sign out'); case 'search': return t('nav.search-dashboards.title', 'Search dashboards'); + case 'connections': + return t('nav.connections.title', 'Connections'); + case 'connections-add-new-connection': + return t('nav.add-new-connections.title', 'Add new connection'); + case 'connections-datasources': + return t('nav.data-sources.title', 'Data sources'); default: return undefined; } @@ -192,6 +198,10 @@ export function getNavSubTitle(navId: string | undefined) { return t('nav.monitoring.subtitle', 'Monitoring and infrastructure apps'); case 'alerts-and-incidents': return t('nav.alerts-and-incidents.subtitle', 'Alerting and incident management apps'); + case 'connections-add-new-connection': + return t('nav.connections.subtitle', 'Browse and create new connections'); + case 'connections-datasources': + return t('nav.data-sources.subtitle', 'View and manage your connected data source connections'); default: return undefined; } diff --git a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx index cbd2d0a3264..0dea5414030 100644 --- a/public/app/features/connections/tabs/ConnectData/ConnectData.tsx +++ b/public/app/features/connections/tabs/ConnectData/ConnectData.tsx @@ -4,6 +4,7 @@ import React, { useMemo, useState } from 'react'; import { PluginType } from '@grafana/data'; import { useStyles2, LoadingPlaceholder } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; +import { t } from 'app/core/internationalization'; import { useGetAll } from 'app/features/plugins/admin/state/hooks'; import { AccessControlAction } from 'app/types'; @@ -75,6 +76,7 @@ export function AddNewConnection() { }; const showNoResults = useMemo(() => !isLoading && !error && plugins.length < 1, [isLoading, error, plugins]); + const categoryHeaderLabel = t('connections.connect-data.category-header-label', 'Data sources'); return ( <> @@ -82,7 +84,7 @@ export function AddNewConnection() { {/* We need this extra spacing when there are no filters */}
- + {isLoading ? ( ) : !!error ? ( diff --git a/public/app/features/connections/tabs/ConnectData/Search/Search.tsx b/public/app/features/connections/tabs/ConnectData/Search/Search.tsx index bbe14d8e107..626f3b14350 100644 --- a/public/app/features/connections/tabs/ConnectData/Search/Search.tsx +++ b/public/app/features/connections/tabs/ConnectData/Search/Search.tsx @@ -3,6 +3,7 @@ import React, { FC } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Icon, Input, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; const getStyles = (theme: GrafanaTheme2) => ({ searchContainer: css` @@ -19,12 +20,14 @@ const getStyles = (theme: GrafanaTheme2) => ({ `, }); +const placeholder = t('connections.search.placeholder', 'Search all'); + export const Search: FC<{ onChange: (e: React.FormEvent) => void }> = ({ onChange }) => { const styles = useStyles2(getStyles); return (
- } placeholder="Search all" aria-label="Search all" /> + } placeholder={placeholder} aria-label="Search all" />
); }; diff --git a/public/app/features/datasources/components/DataSourceAddButton.tsx b/public/app/features/datasources/components/DataSourceAddButton.tsx index 54acd193748..c236d1fc447 100644 --- a/public/app/features/datasources/components/DataSourceAddButton.tsx +++ b/public/app/features/datasources/components/DataSourceAddButton.tsx @@ -3,6 +3,7 @@ import React from 'react'; import { config } from '@grafana/runtime'; import { LinkButton } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; +import { Trans } from 'app/core/internationalization'; import { AccessControlAction } from 'app/types'; import { useDataSourcesRoutes } from '../state'; @@ -13,7 +14,7 @@ export function DataSourceAddButton(): JSX.Element | null { return canCreateDataSource ? ( - Add new data source + Add new data source ) : null; } diff --git a/public/locales/de-DE/grafana.json b/public/locales/de-DE/grafana.json index 5e5bc64c89d..4ca7563c22d 100644 --- a/public/locales/de-DE/grafana.json +++ b/public/locales/de-DE/grafana.json @@ -72,6 +72,14 @@ }, "save": "Speichern" }, + "connections": { + "connect-data": { + "category-header-label": "" + }, + "search": { + "placeholder": "" + } + }, "dashboard": { "add-menu": { "import": "Aus Bibliothek importieren", @@ -157,6 +165,11 @@ "unmark-favorite": "Markierung als Favorit entfernen" } }, + "data-sources": { + "datasource-add-button": { + "label": "" + } + }, "folder-picker": { "loading": "Ordner werden geladen …" }, @@ -198,6 +211,9 @@ } }, "nav": { + "add-new-connections": { + "title": "" + }, "admin": { "subtitle": "Serverweite Einstellungen und Zugriff auf Ressourcen wie Organisationen, Benutzer und Lizenzen verwalten", "title": "Server-Administrator" @@ -253,6 +269,10 @@ "config": { "title": "Verwaltung" }, + "connections": { + "subtitle": "", + "title": "" + }, "correlations": { "subtitle": "Füge Korrelationen hinzu und konfiguriere sie", "title": "Korrelationen" @@ -276,6 +296,10 @@ "subtitle": "Erstelle und verwalte Dashboards, um deine Daten zu visualisieren", "title": "Dashboards" }, + "data-sources": { + "subtitle": "", + "title": "" + }, "datasources": { "subtitle": "Füge Datenquellen hinzu und konfiguriere sie", "title": "Datenquellen" diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index b4fbd81bd3c..e6de8de84e0 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -72,6 +72,14 @@ }, "save": "Save" }, + "connections": { + "connect-data": { + "category-header-label": "Data sources" + }, + "search": { + "placeholder": "Search all" + } + }, "dashboard": { "add-menu": { "import": "Import from library", @@ -157,6 +165,11 @@ "unmark-favorite": "Unmark as favorite" } }, + "data-sources": { + "datasource-add-button": { + "label": "Add new data source" + } + }, "folder-picker": { "loading": "Loading folders..." }, @@ -198,6 +211,9 @@ } }, "nav": { + "add-new-connections": { + "title": "Add new connection" + }, "admin": { "subtitle": "Manage server-wide settings and access to resources such as organizations, users, and licenses", "title": "Server admin" @@ -253,6 +269,10 @@ "config": { "title": "Administration" }, + "connections": { + "subtitle": "Browse and create new connections", + "title": "Connections" + }, "correlations": { "subtitle": "Add and configure correlations", "title": "Correlations" @@ -276,6 +296,10 @@ "subtitle": "Create and manage dashboards to visualize your data", "title": "Dashboards" }, + "data-sources": { + "subtitle": "View and manage your connected data source connections", + "title": "Data sources" + }, "datasources": { "subtitle": "Add and configure data sources", "title": "Data sources" diff --git a/public/locales/es-ES/grafana.json b/public/locales/es-ES/grafana.json index 6f6f0799e9d..e2b089bd445 100644 --- a/public/locales/es-ES/grafana.json +++ b/public/locales/es-ES/grafana.json @@ -72,6 +72,14 @@ }, "save": "Guardar" }, + "connections": { + "connect-data": { + "category-header-label": "" + }, + "search": { + "placeholder": "" + } + }, "dashboard": { "add-menu": { "import": "Importar de la biblioteca", @@ -157,6 +165,11 @@ "unmark-favorite": "Deshacer marca como favorito" } }, + "data-sources": { + "datasource-add-button": { + "label": "" + } + }, "folder-picker": { "loading": "Cargando carpetas..." }, @@ -198,6 +211,9 @@ } }, "nav": { + "add-new-connections": { + "title": "" + }, "admin": { "subtitle": "Administrar la configuración de todo el servidor y el acceso a recursos como organizaciones, usuarios y licencias", "title": "Administrador del servidor" @@ -253,6 +269,10 @@ "config": { "title": "Administración" }, + "connections": { + "subtitle": "", + "title": "" + }, "correlations": { "subtitle": "Añadir y configurar correlaciones", "title": "Correlaciones" @@ -276,6 +296,10 @@ "subtitle": "Cree y administre paneles de control para visualizar sus datos", "title": "Paneles de control" }, + "data-sources": { + "subtitle": "", + "title": "" + }, "datasources": { "subtitle": "Añadir y configurar orígenes de datos", "title": "Orígenes de datos" diff --git a/public/locales/fr-FR/grafana.json b/public/locales/fr-FR/grafana.json index 23343ff53ee..bcdceac212a 100644 --- a/public/locales/fr-FR/grafana.json +++ b/public/locales/fr-FR/grafana.json @@ -72,6 +72,14 @@ }, "save": "Enregistrer" }, + "connections": { + "connect-data": { + "category-header-label": "" + }, + "search": { + "placeholder": "" + } + }, "dashboard": { "add-menu": { "import": "Importer depuis la bibliothèque", @@ -157,6 +165,11 @@ "unmark-favorite": "Supprimer des favoris" } }, + "data-sources": { + "datasource-add-button": { + "label": "" + } + }, "folder-picker": { "loading": "Chargement des dossiers..." }, @@ -198,6 +211,9 @@ } }, "nav": { + "add-new-connections": { + "title": "" + }, "admin": { "subtitle": "Gérer les paramètres à l'échelle du serveur et l'accès aux ressources telles que les organisations, les utilisateurs et les licences", "title": "Administrateur de serveur" @@ -253,6 +269,10 @@ "config": { "title": "Administration" }, + "connections": { + "subtitle": "", + "title": "" + }, "correlations": { "subtitle": "Ajouter et configurer des corrélations", "title": "Corrélations" @@ -276,6 +296,10 @@ "subtitle": "Créer et gérer des tableaux de bord pour visualiser vos données", "title": "Tableaux de bord" }, + "data-sources": { + "subtitle": "", + "title": "" + }, "datasources": { "subtitle": "Ajouter et configurer des sources de données", "title": "Sources de données" diff --git a/public/locales/pseudo-LOCALE/grafana.json b/public/locales/pseudo-LOCALE/grafana.json index 995022e1898..a84c2203331 100644 --- a/public/locales/pseudo-LOCALE/grafana.json +++ b/public/locales/pseudo-LOCALE/grafana.json @@ -72,6 +72,14 @@ }, "save": "Ŝävę" }, + "connections": { + "connect-data": { + "category-header-label": "Đäŧä şőūřčęş" + }, + "search": { + "placeholder": "Ŝęäřčĥ äľľ" + } + }, "dashboard": { "add-menu": { "import": "Ĩmpőřŧ ƒřőm ľįþřäřy", @@ -157,6 +165,11 @@ "unmark-favorite": "Ůʼnmäřĸ äş ƒävőřįŧę" } }, + "data-sources": { + "datasource-add-button": { + "label": "Åđđ ʼnęŵ đäŧä şőūřčę" + } + }, "folder-picker": { "loading": "Ŀőäđįʼnģ ƒőľđęřş..." }, @@ -198,6 +211,9 @@ } }, "nav": { + "add-new-connections": { + "title": "Åđđ ʼnęŵ čőʼnʼnęčŧįőʼn" + }, "admin": { "subtitle": "Mäʼnäģę şęřvęř-ŵįđę şęŧŧįʼnģş äʼnđ äččęşş ŧő řęşőūřčęş şūčĥ äş őřģäʼnįžäŧįőʼnş, ūşęřş, äʼnđ ľįčęʼnşęş", "title": "Ŝęřvęř äđmįʼn" @@ -253,6 +269,10 @@ "config": { "title": "Åđmįʼnįşŧřäŧįőʼn" }, + "connections": { + "subtitle": "ßřőŵşę äʼnđ čřęäŧę ʼnęŵ čőʼnʼnęčŧįőʼnş", + "title": "Cőʼnʼnęčŧįőʼnş" + }, "correlations": { "subtitle": "Åđđ äʼnđ čőʼnƒįģūřę čőřřęľäŧįőʼnş", "title": "Cőřřęľäŧįőʼnş" @@ -276,6 +296,10 @@ "subtitle": "Cřęäŧę äʼnđ mäʼnäģę đäşĥþőäřđş ŧő vįşūäľįžę yőūř đäŧä", "title": "Đäşĥþőäřđş" }, + "data-sources": { + "subtitle": "Vįęŵ äʼnđ mäʼnäģę yőūř čőʼnʼnęčŧęđ đäŧä şőūřčę čőʼnʼnęčŧįőʼnş", + "title": "Đäŧä şőūřčęş" + }, "datasources": { "subtitle": "Åđđ äʼnđ čőʼnƒįģūřę đäŧä şőūřčęş", "title": "Đäŧä şőūřčęş" diff --git a/public/locales/zh-Hans/grafana.json b/public/locales/zh-Hans/grafana.json index 08db34d60e0..7cee00ecc5f 100644 --- a/public/locales/zh-Hans/grafana.json +++ b/public/locales/zh-Hans/grafana.json @@ -72,6 +72,14 @@ }, "save": "保存" }, + "connections": { + "connect-data": { + "category-header-label": "" + }, + "search": { + "placeholder": "" + } + }, "dashboard": { "add-menu": { "import": "从库导入", @@ -157,6 +165,11 @@ "unmark-favorite": "取消标记为收藏" } }, + "data-sources": { + "datasource-add-button": { + "label": "" + } + }, "folder-picker": { "loading": "正在加载文件夹..." }, @@ -198,6 +211,9 @@ } }, "nav": { + "add-new-connections": { + "title": "" + }, "admin": { "subtitle": "管理整个服务器范围的设置,以及对组织、用户和许可证等资源的访问权限", "title": "服务器管理员" @@ -253,6 +269,10 @@ "config": { "title": "管理" }, + "connections": { + "subtitle": "", + "title": "" + }, "correlations": { "subtitle": "添加并配置相关性", "title": "相关性" @@ -276,6 +296,10 @@ "subtitle": "创建并管理仪表板,以将您的数据可视化", "title": "仪表板" }, + "data-sources": { + "subtitle": "", + "title": "" + }, "datasources": { "subtitle": "添加并配置数据源", "title": "数据源"