I18n: Mark up strings on Navigation - Connections section (#70914)

This commit is contained in:
RoxanaAnamariaTurc 2023-06-30 11:27:19 +01:00 committed by GitHub
parent ea361f5db4
commit af9b071a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 163 additions and 3 deletions

View File

@ -118,6 +118,12 @@ export function getNavTitle(navId: string | undefined) {
return t('nav.sign-out.title', 'Sign out'); return t('nav.sign-out.title', 'Sign out');
case 'search': case 'search':
return t('nav.search-dashboards.title', 'Search dashboards'); 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: default:
return undefined; return undefined;
} }
@ -192,6 +198,10 @@ export function getNavSubTitle(navId: string | undefined) {
return t('nav.monitoring.subtitle', 'Monitoring and infrastructure apps'); return t('nav.monitoring.subtitle', 'Monitoring and infrastructure apps');
case 'alerts-and-incidents': case 'alerts-and-incidents':
return t('nav.alerts-and-incidents.subtitle', 'Alerting and incident management apps'); 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: default:
return undefined; return undefined;
} }

View File

@ -4,6 +4,7 @@ import React, { useMemo, useState } from 'react';
import { PluginType } from '@grafana/data'; import { PluginType } from '@grafana/data';
import { useStyles2, LoadingPlaceholder } from '@grafana/ui'; import { useStyles2, LoadingPlaceholder } from '@grafana/ui';
import { contextSrv } from 'app/core/core'; import { contextSrv } from 'app/core/core';
import { t } from 'app/core/internationalization';
import { useGetAll } from 'app/features/plugins/admin/state/hooks'; import { useGetAll } from 'app/features/plugins/admin/state/hooks';
import { AccessControlAction } from 'app/types'; import { AccessControlAction } from 'app/types';
@ -75,6 +76,7 @@ export function AddNewConnection() {
}; };
const showNoResults = useMemo(() => !isLoading && !error && plugins.length < 1, [isLoading, error, plugins]); const showNoResults = useMemo(() => !isLoading && !error && plugins.length < 1, [isLoading, error, plugins]);
const categoryHeaderLabel = t('connections.connect-data.category-header-label', 'Data sources');
return ( return (
<> <>
@ -82,7 +84,7 @@ export function AddNewConnection() {
<Search onChange={handleSearchChange} /> <Search onChange={handleSearchChange} />
{/* We need this extra spacing when there are no filters */} {/* We need this extra spacing when there are no filters */}
<div className={styles.spacer} /> <div className={styles.spacer} />
<CategoryHeader iconName="database" label="Data sources" /> <CategoryHeader iconName="database" label={categoryHeaderLabel} />
{isLoading ? ( {isLoading ? (
<LoadingPlaceholder text="Loading..." /> <LoadingPlaceholder text="Loading..." />
) : !!error ? ( ) : !!error ? (

View File

@ -3,6 +3,7 @@ import React, { FC } from 'react';
import { GrafanaTheme2 } from '@grafana/data'; import { GrafanaTheme2 } from '@grafana/data';
import { Icon, Input, useStyles2 } from '@grafana/ui'; import { Icon, Input, useStyles2 } from '@grafana/ui';
import { t } from 'app/core/internationalization';
const getStyles = (theme: GrafanaTheme2) => ({ const getStyles = (theme: GrafanaTheme2) => ({
searchContainer: css` 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<HTMLInputElement>) => void }> = ({ onChange }) => { export const Search: FC<{ onChange: (e: React.FormEvent<HTMLInputElement>) => void }> = ({ onChange }) => {
const styles = useStyles2(getStyles); const styles = useStyles2(getStyles);
return ( return (
<div className={styles.searchContainer}> <div className={styles.searchContainer}>
<Input onChange={onChange} prefix={<Icon name="search" />} placeholder="Search all" aria-label="Search all" /> <Input onChange={onChange} prefix={<Icon name="search" />} placeholder={placeholder} aria-label="Search all" />
</div> </div>
); );
}; };

View File

@ -3,6 +3,7 @@ import React from 'react';
import { config } from '@grafana/runtime'; import { config } from '@grafana/runtime';
import { LinkButton } from '@grafana/ui'; import { LinkButton } from '@grafana/ui';
import { contextSrv } from 'app/core/core'; import { contextSrv } from 'app/core/core';
import { Trans } from 'app/core/internationalization';
import { AccessControlAction } from 'app/types'; import { AccessControlAction } from 'app/types';
import { useDataSourcesRoutes } from '../state'; import { useDataSourcesRoutes } from '../state';
@ -13,7 +14,7 @@ export function DataSourceAddButton(): JSX.Element | null {
return canCreateDataSource ? ( return canCreateDataSource ? (
<LinkButton icon="plus" href={config.appSubUrl + dataSourcesRoutes.New}> <LinkButton icon="plus" href={config.appSubUrl + dataSourcesRoutes.New}>
Add new data source <Trans i18nKey="data-sources.datasource-add-button.label">Add new data source</Trans>
</LinkButton> </LinkButton>
) : null; ) : null;
} }

View File

@ -72,6 +72,14 @@
}, },
"save": "Speichern" "save": "Speichern"
}, },
"connections": {
"connect-data": {
"category-header-label": ""
},
"search": {
"placeholder": ""
}
},
"dashboard": { "dashboard": {
"add-menu": { "add-menu": {
"import": "Aus Bibliothek importieren", "import": "Aus Bibliothek importieren",
@ -157,6 +165,11 @@
"unmark-favorite": "Markierung als Favorit entfernen" "unmark-favorite": "Markierung als Favorit entfernen"
} }
}, },
"data-sources": {
"datasource-add-button": {
"label": ""
}
},
"folder-picker": { "folder-picker": {
"loading": "Ordner werden geladen …" "loading": "Ordner werden geladen …"
}, },
@ -198,6 +211,9 @@
} }
}, },
"nav": { "nav": {
"add-new-connections": {
"title": ""
},
"admin": { "admin": {
"subtitle": "Serverweite Einstellungen und Zugriff auf Ressourcen wie Organisationen, Benutzer und Lizenzen verwalten", "subtitle": "Serverweite Einstellungen und Zugriff auf Ressourcen wie Organisationen, Benutzer und Lizenzen verwalten",
"title": "Server-Administrator" "title": "Server-Administrator"
@ -253,6 +269,10 @@
"config": { "config": {
"title": "Verwaltung" "title": "Verwaltung"
}, },
"connections": {
"subtitle": "",
"title": ""
},
"correlations": { "correlations": {
"subtitle": "Füge Korrelationen hinzu und konfiguriere sie", "subtitle": "Füge Korrelationen hinzu und konfiguriere sie",
"title": "Korrelationen" "title": "Korrelationen"
@ -276,6 +296,10 @@
"subtitle": "Erstelle und verwalte Dashboards, um deine Daten zu visualisieren", "subtitle": "Erstelle und verwalte Dashboards, um deine Daten zu visualisieren",
"title": "Dashboards" "title": "Dashboards"
}, },
"data-sources": {
"subtitle": "",
"title": ""
},
"datasources": { "datasources": {
"subtitle": "Füge Datenquellen hinzu und konfiguriere sie", "subtitle": "Füge Datenquellen hinzu und konfiguriere sie",
"title": "Datenquellen" "title": "Datenquellen"

View File

@ -72,6 +72,14 @@
}, },
"save": "Save" "save": "Save"
}, },
"connections": {
"connect-data": {
"category-header-label": "Data sources"
},
"search": {
"placeholder": "Search all"
}
},
"dashboard": { "dashboard": {
"add-menu": { "add-menu": {
"import": "Import from library", "import": "Import from library",
@ -157,6 +165,11 @@
"unmark-favorite": "Unmark as favorite" "unmark-favorite": "Unmark as favorite"
} }
}, },
"data-sources": {
"datasource-add-button": {
"label": "Add new data source"
}
},
"folder-picker": { "folder-picker": {
"loading": "Loading folders..." "loading": "Loading folders..."
}, },
@ -198,6 +211,9 @@
} }
}, },
"nav": { "nav": {
"add-new-connections": {
"title": "Add new connection"
},
"admin": { "admin": {
"subtitle": "Manage server-wide settings and access to resources such as organizations, users, and licenses", "subtitle": "Manage server-wide settings and access to resources such as organizations, users, and licenses",
"title": "Server admin" "title": "Server admin"
@ -253,6 +269,10 @@
"config": { "config": {
"title": "Administration" "title": "Administration"
}, },
"connections": {
"subtitle": "Browse and create new connections",
"title": "Connections"
},
"correlations": { "correlations": {
"subtitle": "Add and configure correlations", "subtitle": "Add and configure correlations",
"title": "Correlations" "title": "Correlations"
@ -276,6 +296,10 @@
"subtitle": "Create and manage dashboards to visualize your data", "subtitle": "Create and manage dashboards to visualize your data",
"title": "Dashboards" "title": "Dashboards"
}, },
"data-sources": {
"subtitle": "View and manage your connected data source connections",
"title": "Data sources"
},
"datasources": { "datasources": {
"subtitle": "Add and configure data sources", "subtitle": "Add and configure data sources",
"title": "Data sources" "title": "Data sources"

View File

@ -72,6 +72,14 @@
}, },
"save": "Guardar" "save": "Guardar"
}, },
"connections": {
"connect-data": {
"category-header-label": ""
},
"search": {
"placeholder": ""
}
},
"dashboard": { "dashboard": {
"add-menu": { "add-menu": {
"import": "Importar de la biblioteca", "import": "Importar de la biblioteca",
@ -157,6 +165,11 @@
"unmark-favorite": "Deshacer marca como favorito" "unmark-favorite": "Deshacer marca como favorito"
} }
}, },
"data-sources": {
"datasource-add-button": {
"label": ""
}
},
"folder-picker": { "folder-picker": {
"loading": "Cargando carpetas..." "loading": "Cargando carpetas..."
}, },
@ -198,6 +211,9 @@
} }
}, },
"nav": { "nav": {
"add-new-connections": {
"title": ""
},
"admin": { "admin": {
"subtitle": "Administrar la configuración de todo el servidor y el acceso a recursos como organizaciones, usuarios y licencias", "subtitle": "Administrar la configuración de todo el servidor y el acceso a recursos como organizaciones, usuarios y licencias",
"title": "Administrador del servidor" "title": "Administrador del servidor"
@ -253,6 +269,10 @@
"config": { "config": {
"title": "Administración" "title": "Administración"
}, },
"connections": {
"subtitle": "",
"title": ""
},
"correlations": { "correlations": {
"subtitle": "Añadir y configurar correlaciones", "subtitle": "Añadir y configurar correlaciones",
"title": "Correlaciones" "title": "Correlaciones"
@ -276,6 +296,10 @@
"subtitle": "Cree y administre paneles de control para visualizar sus datos", "subtitle": "Cree y administre paneles de control para visualizar sus datos",
"title": "Paneles de control" "title": "Paneles de control"
}, },
"data-sources": {
"subtitle": "",
"title": ""
},
"datasources": { "datasources": {
"subtitle": "Añadir y configurar orígenes de datos", "subtitle": "Añadir y configurar orígenes de datos",
"title": "Orígenes de datos" "title": "Orígenes de datos"

View File

@ -72,6 +72,14 @@
}, },
"save": "Enregistrer" "save": "Enregistrer"
}, },
"connections": {
"connect-data": {
"category-header-label": ""
},
"search": {
"placeholder": ""
}
},
"dashboard": { "dashboard": {
"add-menu": { "add-menu": {
"import": "Importer depuis la bibliothèque", "import": "Importer depuis la bibliothèque",
@ -157,6 +165,11 @@
"unmark-favorite": "Supprimer des favoris" "unmark-favorite": "Supprimer des favoris"
} }
}, },
"data-sources": {
"datasource-add-button": {
"label": ""
}
},
"folder-picker": { "folder-picker": {
"loading": "Chargement des dossiers..." "loading": "Chargement des dossiers..."
}, },
@ -198,6 +211,9 @@
} }
}, },
"nav": { "nav": {
"add-new-connections": {
"title": ""
},
"admin": { "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", "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" "title": "Administrateur de serveur"
@ -253,6 +269,10 @@
"config": { "config": {
"title": "Administration" "title": "Administration"
}, },
"connections": {
"subtitle": "",
"title": ""
},
"correlations": { "correlations": {
"subtitle": "Ajouter et configurer des corrélations", "subtitle": "Ajouter et configurer des corrélations",
"title": "Corrélations" "title": "Corrélations"
@ -276,6 +296,10 @@
"subtitle": "Créer et gérer des tableaux de bord pour visualiser vos données", "subtitle": "Créer et gérer des tableaux de bord pour visualiser vos données",
"title": "Tableaux de bord" "title": "Tableaux de bord"
}, },
"data-sources": {
"subtitle": "",
"title": ""
},
"datasources": { "datasources": {
"subtitle": "Ajouter et configurer des sources de données", "subtitle": "Ajouter et configurer des sources de données",
"title": "Sources de données" "title": "Sources de données"

View File

@ -72,6 +72,14 @@
}, },
"save": "Ŝävę" "save": "Ŝävę"
}, },
"connections": {
"connect-data": {
"category-header-label": "Đäŧä şőūřčęş"
},
"search": {
"placeholder": "Ŝęäřčĥ äľľ"
}
},
"dashboard": { "dashboard": {
"add-menu": { "add-menu": {
"import": "Ĩmpőřŧ ƒřőm ľįþřäřy", "import": "Ĩmpőřŧ ƒřőm ľįþřäřy",
@ -157,6 +165,11 @@
"unmark-favorite": "Ůʼnmäřĸ äş ƒävőřįŧę" "unmark-favorite": "Ůʼnmäřĸ äş ƒävőřįŧę"
} }
}, },
"data-sources": {
"datasource-add-button": {
"label": "Åđđ ʼnęŵ đäŧä şőūřčę"
}
},
"folder-picker": { "folder-picker": {
"loading": "Ŀőäđįʼnģ ƒőľđęřş..." "loading": "Ŀőäđįʼnģ ƒőľđęřş..."
}, },
@ -198,6 +211,9 @@
} }
}, },
"nav": { "nav": {
"add-new-connections": {
"title": "Åđđ ʼnęŵ čőʼnʼnęčŧįőʼn"
},
"admin": { "admin": {
"subtitle": "Mäʼnäģę şęřvęř-ŵįđę şęŧŧįʼnģş äʼnđ äččęşş ŧő řęşőūřčęş şūčĥ äş őřģäʼnįžäŧįőʼnş, ūşęřş, äʼnđ ľįčęʼnşęş", "subtitle": "Mäʼnäģę şęřvęř-ŵįđę şęŧŧįʼnģş äʼnđ äččęşş ŧő řęşőūřčęş şūčĥ äş őřģäʼnįžäŧįőʼnş, ūşęřş, äʼnđ ľįčęʼnşęş",
"title": "Ŝęřvęř äđmįʼn" "title": "Ŝęřvęř äđmįʼn"
@ -253,6 +269,10 @@
"config": { "config": {
"title": "Åđmįʼnįşŧřäŧįőʼn" "title": "Åđmįʼnįşŧřäŧįőʼn"
}, },
"connections": {
"subtitle": "ßřőŵşę äʼnđ čřęäŧę ʼnęŵ čőʼnʼnęčŧįőʼnş",
"title": "Cőʼnʼnęčŧįőʼnş"
},
"correlations": { "correlations": {
"subtitle": "Åđđ äʼnđ čőʼnƒįģūřę čőřřęľäŧįőʼnş", "subtitle": "Åđđ äʼnđ čőʼnƒįģūřę čőřřęľäŧįőʼnş",
"title": "Cőřřęľäŧįőʼnş" "title": "Cőřřęľäŧįőʼnş"
@ -276,6 +296,10 @@
"subtitle": "Cřęäŧę äʼnđ mäʼnäģę đäşĥþőäřđş ŧő vįşūäľįžę yőūř đäŧä", "subtitle": "Cřęäŧę äʼnđ mäʼnäģę đäşĥþőäřđş ŧő vįşūäľįžę yőūř đäŧä",
"title": "Đäşĥþőäřđş" "title": "Đäşĥþőäřđş"
}, },
"data-sources": {
"subtitle": "Vįęŵ äʼnđ mäʼnäģę yőūř čőʼnʼnęčŧęđ đäŧä şőūřčę čőʼnʼnęčŧįőʼnş",
"title": "Đäŧä şőūřčęş"
},
"datasources": { "datasources": {
"subtitle": "Åđđ äʼnđ čőʼnƒįģūřę đäŧä şőūřčęş", "subtitle": "Åđđ äʼnđ čőʼnƒįģūřę đäŧä şőūřčęş",
"title": "Đäŧä şőūřčęş" "title": "Đäŧä şőūřčęş"

View File

@ -72,6 +72,14 @@
}, },
"save": "保存" "save": "保存"
}, },
"connections": {
"connect-data": {
"category-header-label": ""
},
"search": {
"placeholder": ""
}
},
"dashboard": { "dashboard": {
"add-menu": { "add-menu": {
"import": "从库导入", "import": "从库导入",
@ -157,6 +165,11 @@
"unmark-favorite": "取消标记为收藏" "unmark-favorite": "取消标记为收藏"
} }
}, },
"data-sources": {
"datasource-add-button": {
"label": ""
}
},
"folder-picker": { "folder-picker": {
"loading": "正在加载文件夹..." "loading": "正在加载文件夹..."
}, },
@ -198,6 +211,9 @@
} }
}, },
"nav": { "nav": {
"add-new-connections": {
"title": ""
},
"admin": { "admin": {
"subtitle": "管理整个服务器范围的设置,以及对组织、用户和许可证等资源的访问权限", "subtitle": "管理整个服务器范围的设置,以及对组织、用户和许可证等资源的访问权限",
"title": "服务器管理员" "title": "服务器管理员"
@ -253,6 +269,10 @@
"config": { "config": {
"title": "管理" "title": "管理"
}, },
"connections": {
"subtitle": "",
"title": ""
},
"correlations": { "correlations": {
"subtitle": "添加并配置相关性", "subtitle": "添加并配置相关性",
"title": "相关性" "title": "相关性"
@ -276,6 +296,10 @@
"subtitle": "创建并管理仪表板,以将您的数据可视化", "subtitle": "创建并管理仪表板,以将您的数据可视化",
"title": "仪表板" "title": "仪表板"
}, },
"data-sources": {
"subtitle": "",
"title": ""
},
"datasources": { "datasources": {
"subtitle": "添加并配置数据源", "subtitle": "添加并配置数据源",
"title": "数据源" "title": "数据源"