mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 23:55:47 -06:00
Internationalization: Translate ViewJSONmodal and ClipboardButton (#58807)
This commit is contained in:
parent
a62e437eb3
commit
8f567d57fa
@ -3,6 +3,7 @@ import React, { useCallback, useRef, useState, useEffect } from 'react';
|
|||||||
|
|
||||||
import { GrafanaTheme2 } from '@grafana/data';
|
import { GrafanaTheme2 } from '@grafana/data';
|
||||||
|
|
||||||
|
import { Trans } from '../../../src/utils/i18n';
|
||||||
import { useStyles2 } from '../../themes';
|
import { useStyles2 } from '../../themes';
|
||||||
import { Button, ButtonProps } from '../Button';
|
import { Button, ButtonProps } from '../Button';
|
||||||
import { Icon } from '../Icon/Icon';
|
import { Icon } from '../Icon/Icon';
|
||||||
@ -62,7 +63,7 @@ export function ClipboardButton({
|
|||||||
<>
|
<>
|
||||||
{showCopySuccess && (
|
{showCopySuccess && (
|
||||||
<InlineToast placement="top" referenceElement={buttonRef.current}>
|
<InlineToast placement="top" referenceElement={buttonRef.current}>
|
||||||
Copied
|
<Trans i18nKey="clipboard-button.inline-toast.success">Copied</Trans>
|
||||||
</InlineToast>
|
</InlineToast>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
|
|||||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||||
|
|
||||||
import { ClipboardButton, CodeEditor, Modal } from '@grafana/ui';
|
import { ClipboardButton, CodeEditor, Modal } from '@grafana/ui';
|
||||||
|
import { Trans } from 'app/core/internationalization';
|
||||||
|
|
||||||
export interface ViewJsonModalProps {
|
export interface ViewJsonModalProps {
|
||||||
json: string;
|
json: string;
|
||||||
@ -17,7 +18,7 @@ export function ViewJsonModal({ json, onDismiss }: ViewJsonModalProps): JSX.Elem
|
|||||||
</AutoSizer>
|
</AutoSizer>
|
||||||
<Modal.ButtonRow>
|
<Modal.ButtonRow>
|
||||||
<ClipboardButton icon="copy" getText={getClipboardText}>
|
<ClipboardButton icon="copy" getText={getClipboardText}>
|
||||||
Copy to Clipboard
|
<Trans i18nKey="share-modal.view-json.copy-button">Copy to Clipboard</Trans>
|
||||||
</ClipboardButton>
|
</ClipboardButton>
|
||||||
</Modal.ButtonRow>
|
</Modal.ButtonRow>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_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",
|
||||||
|
"clipboard-button": {
|
||||||
|
"inline-toast": {
|
||||||
|
"success": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"locale": {
|
"locale": {
|
||||||
"default": "Standard"
|
"default": "Standard"
|
||||||
@ -412,6 +417,9 @@
|
|||||||
"dark": "Dunkel",
|
"dark": "Dunkel",
|
||||||
"field-name": "Design",
|
"field-name": "Design",
|
||||||
"light": "Hell"
|
"light": "Hell"
|
||||||
|
},
|
||||||
|
"view-json": {
|
||||||
|
"copy-button": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared-dashboard": {
|
"shared-dashboard": {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_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",
|
||||||
|
"clipboard-button": {
|
||||||
|
"inline-toast": {
|
||||||
|
"success": "Copied"
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"locale": {
|
"locale": {
|
||||||
"default": "Default"
|
"default": "Default"
|
||||||
@ -412,6 +417,9 @@
|
|||||||
"dark": "Dark",
|
"dark": "Dark",
|
||||||
"field-name": "Theme",
|
"field-name": "Theme",
|
||||||
"light": "Light"
|
"light": "Light"
|
||||||
|
},
|
||||||
|
"view-json": {
|
||||||
|
"copy-button": "Copy to Clipboard"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared-dashboard": {
|
"shared-dashboard": {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_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",
|
||||||
|
"clipboard-button": {
|
||||||
|
"inline-toast": {
|
||||||
|
"success": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"locale": {
|
"locale": {
|
||||||
"default": "Por defecto"
|
"default": "Por defecto"
|
||||||
@ -412,6 +417,9 @@
|
|||||||
"dark": "Oscuro",
|
"dark": "Oscuro",
|
||||||
"field-name": "Tema",
|
"field-name": "Tema",
|
||||||
"light": "Claro"
|
"light": "Claro"
|
||||||
|
},
|
||||||
|
"view-json": {
|
||||||
|
"copy-button": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared-dashboard": {
|
"shared-dashboard": {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_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",
|
||||||
|
"clipboard-button": {
|
||||||
|
"inline-toast": {
|
||||||
|
"success": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"locale": {
|
"locale": {
|
||||||
"default": "Par défaut"
|
"default": "Par défaut"
|
||||||
@ -412,6 +417,9 @@
|
|||||||
"dark": "Sombre",
|
"dark": "Sombre",
|
||||||
"field-name": "Thème",
|
"field-name": "Thème",
|
||||||
"light": "Clair"
|
"light": "Clair"
|
||||||
|
},
|
||||||
|
"view-json": {
|
||||||
|
"copy-button": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared-dashboard": {
|
"shared-dashboard": {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_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 ŧĥę čőđę şőūřčę",
|
||||||
|
"clipboard-button": {
|
||||||
|
"inline-toast": {
|
||||||
|
"success": "Cőpįęđ"
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"locale": {
|
"locale": {
|
||||||
"default": "Đęƒäūľŧ"
|
"default": "Đęƒäūľŧ"
|
||||||
@ -412,6 +417,9 @@
|
|||||||
"dark": "Đäřĸ",
|
"dark": "Đäřĸ",
|
||||||
"field-name": "Ŧĥęmę",
|
"field-name": "Ŧĥęmę",
|
||||||
"light": "Ŀįģĥŧ"
|
"light": "Ŀįģĥŧ"
|
||||||
|
},
|
||||||
|
"view-json": {
|
||||||
|
"copy-button": "Cőpy ŧő Cľįpþőäřđ"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared-dashboard": {
|
"shared-dashboard": {
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"_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",
|
||||||
|
"clipboard-button": {
|
||||||
|
"inline-toast": {
|
||||||
|
"success": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"locale": {
|
"locale": {
|
||||||
"default": "默认"
|
"default": "默认"
|
||||||
@ -412,6 +417,9 @@
|
|||||||
"dark": "深色",
|
"dark": "深色",
|
||||||
"field-name": "主题",
|
"field-name": "主题",
|
||||||
"light": "浅色"
|
"light": "浅色"
|
||||||
|
},
|
||||||
|
"view-json": {
|
||||||
|
"copy-button": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"shared-dashboard": {
|
"shared-dashboard": {
|
||||||
|
Loading…
Reference in New Issue
Block a user