mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Internationalization: Mark up phrases for translation on Dashboards page (#70361)
* Internationalization:Mark up phrases for translation on Dashboards page * Internationalization: Mark up phrases for translation on Dashboards page
This commit is contained in:
parent
9dd984a967
commit
3c88868fe5
@ -5,6 +5,7 @@ import { GrafanaTheme2 } from '@grafana/data';
|
|||||||
import { reportInteraction } from '@grafana/runtime';
|
import { reportInteraction } from '@grafana/runtime';
|
||||||
import { Button, useStyles2 } from '@grafana/ui';
|
import { Button, useStyles2 } from '@grafana/ui';
|
||||||
import appEvents from 'app/core/app_events';
|
import appEvents from 'app/core/app_events';
|
||||||
|
import { Trans } from 'app/core/internationalization';
|
||||||
import { useSearchStateManager } from 'app/features/search/state/SearchStateManager';
|
import { useSearchStateManager } from 'app/features/search/state/SearchStateManager';
|
||||||
import { useDispatch, useSelector } from 'app/types';
|
import { useDispatch, useSelector } from 'app/types';
|
||||||
import { ShowModalReactEvent } from 'app/types/events';
|
import { ShowModalReactEvent } from 'app/types/events';
|
||||||
@ -130,10 +131,11 @@ export function BrowseActions() {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.row} data-testid="manage-actions">
|
<div className={styles.row} data-testid="manage-actions">
|
||||||
<Button onClick={showMoveModal} variant="secondary">
|
<Button onClick={showMoveModal} variant="secondary">
|
||||||
Move
|
<Trans i18nKey="browse-dashboards.action.move-button">Move</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button onClick={showDeleteModal} variant="destructive">
|
<Button onClick={showDeleteModal} variant="destructive">
|
||||||
Delete
|
<Trans i18nKey="browse-dashboards.action.delete-button">Delete</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -7,6 +7,7 @@ import InfiniteLoader from 'react-window-infinite-loader';
|
|||||||
import { GrafanaTheme2, isTruthy } from '@grafana/data';
|
import { GrafanaTheme2, isTruthy } from '@grafana/data';
|
||||||
import { selectors } from '@grafana/e2e-selectors';
|
import { selectors } from '@grafana/e2e-selectors';
|
||||||
import { useStyles2 } from '@grafana/ui';
|
import { useStyles2 } from '@grafana/ui';
|
||||||
|
import { t, Trans } from 'app/core/internationalization';
|
||||||
import { DashboardViewItem } from 'app/features/search/types';
|
import { DashboardViewItem } from 'app/features/search/types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -76,21 +77,25 @@ export function DashboardsTree({
|
|||||||
const nameColumn: DashboardsTreeColumn = {
|
const nameColumn: DashboardsTreeColumn = {
|
||||||
id: 'name',
|
id: 'name',
|
||||||
width: 3,
|
width: 3,
|
||||||
Header: <span style={{ paddingLeft: 24 }}>Name</span>,
|
Header: (
|
||||||
|
<span style={{ paddingLeft: 24 }}>
|
||||||
|
<Trans i18nKey="browse-dashboards.dashboards-tree.name-column">Name</Trans>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
Cell: (props: DashboardsTreeCellProps) => <NameCell {...props} onFolderClick={onFolderClick} />,
|
Cell: (props: DashboardsTreeCellProps) => <NameCell {...props} onFolderClick={onFolderClick} />,
|
||||||
};
|
};
|
||||||
|
|
||||||
const typeColumn: DashboardsTreeColumn = {
|
const typeColumn: DashboardsTreeColumn = {
|
||||||
id: 'type',
|
id: 'type',
|
||||||
width: 1,
|
width: 1,
|
||||||
Header: 'Type',
|
Header: t('browse-dashboards.dashboards-tree.type-column', 'Type'),
|
||||||
Cell: TypeCell,
|
Cell: TypeCell,
|
||||||
};
|
};
|
||||||
|
|
||||||
const tagsColumns: DashboardsTreeColumn = {
|
const tagsColumns: DashboardsTreeColumn = {
|
||||||
id: 'tags',
|
id: 'tags',
|
||||||
width: 2,
|
width: 2,
|
||||||
Header: 'Tags',
|
Header: t('browse-dashboards.dashboards-tree.tags-column', 'Tags'),
|
||||||
Cell: TagsCell,
|
Cell: TagsCell,
|
||||||
};
|
};
|
||||||
const columns = [canSelect && checkboxColumn, nameColumn, typeColumn, tagsColumns].filter(isTruthy);
|
const columns = [canSelect && checkboxColumn, nameColumn, typeColumn, tagsColumns].filter(isTruthy);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
|
|
||||||
import { Button, Card, Spinner } from '@grafana/ui';
|
import { Button, Card, Spinner } from '@grafana/ui';
|
||||||
|
import { Trans } from 'app/core/internationalization';
|
||||||
import { useKeyNavigationListener } from 'app/features/search/hooks/useSearchKeyboardSelection';
|
import { useKeyNavigationListener } from 'app/features/search/hooks/useSearchKeyboardSelection';
|
||||||
import { SearchResultsProps, SearchResultsTable } from 'app/features/search/page/components/SearchResultsTable';
|
import { SearchResultsProps, SearchResultsTable } from 'app/features/search/page/components/SearchResultsTable';
|
||||||
import { useSearchStateManager } from 'app/features/search/state/SearchStateManager';
|
import { useSearchStateManager } from 'app/features/search/state/SearchStateManager';
|
||||||
@ -72,10 +73,12 @@ export function SearchView({ width, height, canSelect }: SearchViewProps) {
|
|||||||
return (
|
return (
|
||||||
<div style={{ width }}>
|
<div style={{ width }}>
|
||||||
<Card>
|
<Card>
|
||||||
<Card.Heading>No results found for your query.</Card.Heading>
|
<Card.Heading>
|
||||||
|
<Trans i18nKey="browse-dashboards.no-results.text">No results found for your query.</Trans>
|
||||||
|
</Card.Heading>
|
||||||
<Card.Actions>
|
<Card.Actions>
|
||||||
<Button variant="secondary" onClick={stateManager.onClearSearchAndFilters}>
|
<Button variant="secondary" onClick={stateManager.onClearSearchAndFilters}>
|
||||||
Clear search and filters
|
<Trans i18nKey="browse-dashboards.no-results.clear">Clear search and filters</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
</Card.Actions>
|
</Card.Actions>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -6,6 +6,7 @@ import { CellProps } from 'react-table';
|
|||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
import { Icon, useStyles2 } from '@grafana/ui';
|
import { Icon, useStyles2 } from '@grafana/ui';
|
||||||
import { Span } from '@grafana/ui/src/unstable';
|
import { Span } from '@grafana/ui/src/unstable';
|
||||||
|
import { Trans } from 'app/core/internationalization';
|
||||||
import { getIconForKind } from 'app/features/search/service/utils';
|
import { getIconForKind } from 'app/features/search/service/utils';
|
||||||
|
|
||||||
import { DashboardsTreeItem } from '../types';
|
import { DashboardsTreeItem } from '../types';
|
||||||
@ -20,7 +21,7 @@ export function TypeCell({ row: { original: data } }: CellProps<DashboardsTreeIt
|
|||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Icon name={iconName} />
|
<Icon name={iconName} />
|
||||||
<Span variant="body" color="secondary" truncate>
|
<Span variant="body" color="secondary" truncate>
|
||||||
Dashboard
|
<Trans i18nKey="browse-dashboards.type-cell.dashboard">Dashboard</Trans>
|
||||||
</Span>
|
</Span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -29,7 +30,7 @@ export function TypeCell({ row: { original: data } }: CellProps<DashboardsTreeIt
|
|||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Icon name={iconName} />
|
<Icon name={iconName} />
|
||||||
<Span variant="body" color="secondary" truncate>
|
<Span variant="body" color="secondary" truncate>
|
||||||
Folder
|
<Trans i18nKey="browse-dashboards.type-cell.folder">Folder</Trans>
|
||||||
</Span>
|
</Span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -38,7 +39,7 @@ export function TypeCell({ row: { original: data } }: CellProps<DashboardsTreeIt
|
|||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Icon name={iconName} />
|
<Icon name={iconName} />
|
||||||
<Span variant="body" color="secondary" truncate>
|
<Span variant="body" color="secondary" truncate>
|
||||||
Panel
|
<Trans i18nKey="browse-dashboards.type-cell.panel">Panel</Trans>
|
||||||
</Span>
|
</Span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -8,6 +8,7 @@ import { GrafanaTheme2 } from '@grafana/data';
|
|||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
import { useStyles2, Spinner, Button } from '@grafana/ui';
|
import { useStyles2, Spinner, Button } from '@grafana/ui';
|
||||||
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
||||||
|
import { Trans } from 'app/core/internationalization';
|
||||||
import { FolderDTO } from 'app/types';
|
import { FolderDTO } from 'app/types';
|
||||||
|
|
||||||
import { getGrafanaSearcher } from '../../service';
|
import { getGrafanaSearcher } from '../../service';
|
||||||
@ -75,10 +76,12 @@ export const SearchView = ({ showManage, folderDTO, hidePseudoFolders, keyboardE
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.noResults}>
|
<div className={styles.noResults}>
|
||||||
<div>No results found for your query.</div>
|
<div>
|
||||||
|
<Trans i18nKey="search-view.no-results.text">No results found for your query.</Trans>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<Button variant="secondary" onClick={stateManager.onClearSearchAndFilters}>
|
<Button variant="secondary" onClick={stateManager.onClearSearchAndFilters}>
|
||||||
Clear search and filters
|
<Trans i18nKey="search-view.no-results.clear">Clear search and filters</Trans>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"_comment": "Do not manually edit this file. Translations must be made in Crowdin which will sync them back into this file",
|
"_comment": "Do not manually edit this file. Translations must be made in Crowdin which will sync them back into this file",
|
||||||
|
"browse-dashboards": {
|
||||||
|
"action": {
|
||||||
|
"delete-button": "",
|
||||||
|
"move-button": ""
|
||||||
|
},
|
||||||
|
"dashboards-tree": {
|
||||||
|
"name-column": "",
|
||||||
|
"tags-column": "",
|
||||||
|
"type-column": ""
|
||||||
|
},
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
"type-cell": {
|
||||||
|
"dashboard": "",
|
||||||
|
"folder": "",
|
||||||
|
"panel": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"clipboard-button": {
|
"clipboard-button": {
|
||||||
"inline-toast": {
|
"inline-toast": {
|
||||||
"success": "Kopiert"
|
"success": "Kopiert"
|
||||||
@ -434,6 +454,12 @@
|
|||||||
"placeholder": "Nach Dashboards suchen"
|
"placeholder": "Nach Dashboards suchen"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"search-view": {
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"share-modal": {
|
"share-modal": {
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "Teilen"
|
"title": "Teilen"
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"_comment": "Do not manually edit this file, or update these source phrases in Crowdin. The source of truth for English strings are in the code source",
|
"_comment": "Do not manually edit this file, or update these source phrases in Crowdin. The source of truth for English strings are in the code source",
|
||||||
|
"browse-dashboards": {
|
||||||
|
"action": {
|
||||||
|
"delete-button": "Delete",
|
||||||
|
"move-button": "Move"
|
||||||
|
},
|
||||||
|
"dashboards-tree": {
|
||||||
|
"name-column": "Name",
|
||||||
|
"tags-column": "Tags",
|
||||||
|
"type-column": "Type"
|
||||||
|
},
|
||||||
|
"no-results": {
|
||||||
|
"clear": "Clear search and filters",
|
||||||
|
"text": "No results found for your query."
|
||||||
|
},
|
||||||
|
"type-cell": {
|
||||||
|
"dashboard": "Dashboard",
|
||||||
|
"folder": "Folder",
|
||||||
|
"panel": "Panel"
|
||||||
|
}
|
||||||
|
},
|
||||||
"clipboard-button": {
|
"clipboard-button": {
|
||||||
"inline-toast": {
|
"inline-toast": {
|
||||||
"success": "Copied"
|
"success": "Copied"
|
||||||
@ -434,6 +454,12 @@
|
|||||||
"placeholder": "Search for dashboards and folders"
|
"placeholder": "Search for dashboards and folders"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"search-view": {
|
||||||
|
"no-results": {
|
||||||
|
"clear": "Clear search and filters",
|
||||||
|
"text": "No results found for your query."
|
||||||
|
}
|
||||||
|
},
|
||||||
"share-modal": {
|
"share-modal": {
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "Share"
|
"title": "Share"
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"_comment": "Do not manually edit this file, or update these source phrases in Crowdin. The source of truth for English strings are in the code source",
|
"_comment": "Do not manually edit this file, or update these source phrases in Crowdin. The source of truth for English strings are in the code source",
|
||||||
|
"browse-dashboards": {
|
||||||
|
"action": {
|
||||||
|
"delete-button": "",
|
||||||
|
"move-button": ""
|
||||||
|
},
|
||||||
|
"dashboards-tree": {
|
||||||
|
"name-column": "",
|
||||||
|
"tags-column": "",
|
||||||
|
"type-column": ""
|
||||||
|
},
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
"type-cell": {
|
||||||
|
"dashboard": "",
|
||||||
|
"folder": "",
|
||||||
|
"panel": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"clipboard-button": {
|
"clipboard-button": {
|
||||||
"inline-toast": {
|
"inline-toast": {
|
||||||
"success": "Copiado"
|
"success": "Copiado"
|
||||||
@ -434,6 +454,12 @@
|
|||||||
"placeholder": "Buscar paneles de control"
|
"placeholder": "Buscar paneles de control"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"search-view": {
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"share-modal": {
|
"share-modal": {
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "Compartir"
|
"title": "Compartir"
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"_comment": "Do not manually edit this file. Translations must be made in Crowdin which will sync them back into this file",
|
"_comment": "Do not manually edit this file. Translations must be made in Crowdin which will sync them back into this file",
|
||||||
|
"browse-dashboards": {
|
||||||
|
"action": {
|
||||||
|
"delete-button": "",
|
||||||
|
"move-button": ""
|
||||||
|
},
|
||||||
|
"dashboards-tree": {
|
||||||
|
"name-column": "",
|
||||||
|
"tags-column": "",
|
||||||
|
"type-column": ""
|
||||||
|
},
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
"type-cell": {
|
||||||
|
"dashboard": "",
|
||||||
|
"folder": "",
|
||||||
|
"panel": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"clipboard-button": {
|
"clipboard-button": {
|
||||||
"inline-toast": {
|
"inline-toast": {
|
||||||
"success": "Copié"
|
"success": "Copié"
|
||||||
@ -434,6 +454,12 @@
|
|||||||
"placeholder": "Rechercher des tableaux de bord"
|
"placeholder": "Rechercher des tableaux de bord"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"search-view": {
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"share-modal": {
|
"share-modal": {
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "Partager"
|
"title": "Partager"
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"_comment": "Đő ʼnőŧ mäʼnūäľľy ęđįŧ ŧĥįş ƒįľę, őř ūpđäŧę ŧĥęşę şőūřčę pĥřäşęş įʼn Cřőŵđįʼn. Ŧĥę şőūřčę őƒ ŧřūŧĥ ƒőř Ēʼnģľįşĥ şŧřįʼnģş äřę įʼn ŧĥę čőđę şőūřčę",
|
"_comment": "Đő ʼnőŧ mäʼnūäľľy ęđįŧ ŧĥįş ƒįľę, őř ūpđäŧę ŧĥęşę şőūřčę pĥřäşęş įʼn Cřőŵđįʼn. Ŧĥę şőūřčę őƒ ŧřūŧĥ ƒőř Ēʼnģľįşĥ şŧřįʼnģş äřę įʼn ŧĥę čőđę şőūřčę",
|
||||||
|
"browse-dashboards": {
|
||||||
|
"action": {
|
||||||
|
"delete-button": "Đęľęŧę",
|
||||||
|
"move-button": "Mővę"
|
||||||
|
},
|
||||||
|
"dashboards-tree": {
|
||||||
|
"name-column": "Ńämę",
|
||||||
|
"tags-column": "Ŧäģş",
|
||||||
|
"type-column": "Ŧypę"
|
||||||
|
},
|
||||||
|
"no-results": {
|
||||||
|
"clear": "Cľęäř şęäřčĥ äʼnđ ƒįľŧęřş",
|
||||||
|
"text": "Ńő řęşūľŧş ƒőūʼnđ ƒőř yőūř qūęřy."
|
||||||
|
},
|
||||||
|
"type-cell": {
|
||||||
|
"dashboard": "Đäşĥþőäřđ",
|
||||||
|
"folder": "Főľđęř",
|
||||||
|
"panel": "Päʼnęľ"
|
||||||
|
}
|
||||||
|
},
|
||||||
"clipboard-button": {
|
"clipboard-button": {
|
||||||
"inline-toast": {
|
"inline-toast": {
|
||||||
"success": "Cőpįęđ"
|
"success": "Cőpįęđ"
|
||||||
@ -434,6 +454,12 @@
|
|||||||
"placeholder": "Ŝęäřčĥ ƒőř đäşĥþőäřđş äʼnđ ƒőľđęřş"
|
"placeholder": "Ŝęäřčĥ ƒőř đäşĥþőäřđş äʼnđ ƒőľđęřş"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"search-view": {
|
||||||
|
"no-results": {
|
||||||
|
"clear": "Cľęäř şęäřčĥ äʼnđ ƒįľŧęřş",
|
||||||
|
"text": "Ńő řęşūľŧş ƒőūʼnđ ƒőř yőūř qūęřy."
|
||||||
|
}
|
||||||
|
},
|
||||||
"share-modal": {
|
"share-modal": {
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "Ŝĥäřę"
|
"title": "Ŝĥäřę"
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
{
|
{
|
||||||
"_comment": "Do not manually edit this file. Translations must be made in Crowdin which will sync them back into this file",
|
"_comment": "Do not manually edit this file. Translations must be made in Crowdin which will sync them back into this file",
|
||||||
|
"browse-dashboards": {
|
||||||
|
"action": {
|
||||||
|
"delete-button": "",
|
||||||
|
"move-button": ""
|
||||||
|
},
|
||||||
|
"dashboards-tree": {
|
||||||
|
"name-column": "",
|
||||||
|
"tags-column": "",
|
||||||
|
"type-column": ""
|
||||||
|
},
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
},
|
||||||
|
"type-cell": {
|
||||||
|
"dashboard": "",
|
||||||
|
"folder": "",
|
||||||
|
"panel": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"clipboard-button": {
|
"clipboard-button": {
|
||||||
"inline-toast": {
|
"inline-toast": {
|
||||||
"success": "已复制"
|
"success": "已复制"
|
||||||
@ -434,6 +454,12 @@
|
|||||||
"placeholder": "搜索仪表板"
|
"placeholder": "搜索仪表板"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"search-view": {
|
||||||
|
"no-results": {
|
||||||
|
"clear": "",
|
||||||
|
"text": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"share-modal": {
|
"share-modal": {
|
||||||
"dashboard": {
|
"dashboard": {
|
||||||
"title": "分享"
|
"title": "分享"
|
||||||
|
Loading…
Reference in New Issue
Block a user