mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
Internationalization: Translate page headers and Search dashboard actions (#60727)
* Fix: PageHeader & PageHeaderTabs & NavBarItem & DashboardActions & PanelMenu is displayed in default_language (#60719) * I18N: update strings (#60719) Co-authored-by: TaitChan <1441645821@qq.coom>
This commit is contained in:
@@ -2,6 +2,7 @@ import React, { FC } from 'react';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Menu, Dropdown, Button, Icon } from '@grafana/ui';
|
||||
import { t } from 'app/core/internationalization';
|
||||
|
||||
export interface Props {
|
||||
folderUid?: string;
|
||||
@@ -28,11 +29,15 @@ export const DashboardActions: FC<Props> = ({ folderUid, canCreateFolders = fals
|
||||
const MenuActions = () => {
|
||||
return (
|
||||
<Menu>
|
||||
{canCreateDashboards && <Menu.Item url={actionUrl('new')} label="New Dashboard" />}
|
||||
{canCreateFolders && (config.featureToggles.nestedFolders || !folderUid) && (
|
||||
<Menu.Item url={actionUrl('new_folder')} label="New Folder" />
|
||||
{canCreateDashboards && (
|
||||
<Menu.Item url={actionUrl('new')} label={t('search.dashboard-actions.new-dashboard', 'New Dashboard')} />
|
||||
)}
|
||||
{canCreateFolders && (config.featureToggles.nestedFolders || !folderUid) && (
|
||||
<Menu.Item url={actionUrl('new_folder')} label={t('search.dashboard-actions.new-folder', 'New Folder')} />
|
||||
)}
|
||||
{canCreateDashboards && (
|
||||
<Menu.Item url={actionUrl('import')} label={t('search.dashboard-actions.import', 'Import')} />
|
||||
)}
|
||||
{canCreateDashboards && <Menu.Item url={actionUrl('import')} label="Import" />}
|
||||
</Menu>
|
||||
);
|
||||
};
|
||||
@@ -41,7 +46,7 @@ export const DashboardActions: FC<Props> = ({ folderUid, canCreateFolders = fals
|
||||
<div>
|
||||
<Dropdown overlay={MenuActions} placement="bottom-start">
|
||||
<Button variant="primary">
|
||||
New
|
||||
{t('search.dashboard-actions.new', 'New')}
|
||||
<Icon name="angle-down" />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
|
||||
Reference in New Issue
Block a user