i18n: Markup Explore's Query Inspector for translations (#76157)

This commit is contained in:
Stefan Mitic 2023-10-13 13:36:43 -04:00 committed by GitHub
parent 1e3254bb43
commit 4d8560d9a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 72 additions and 7 deletions

View File

@ -7,6 +7,7 @@ import { selectors } from '@grafana/e2e-selectors';
import { Stack } from '@grafana/experimental';
import { config } from '@grafana/runtime';
import { Button, ClipboardButton, JSONFormatter, LoadingPlaceholder } from '@grafana/ui';
import { Trans } from 'app/core/internationalization';
import { backendSrv } from 'app/core/services/backend_srv';
import { getPanelInspectorStyles } from './styles';
@ -221,8 +222,10 @@ export class QueryInspector extends PureComponent<Props, State> {
<div aria-label={selectors.components.PanelInspector.Query.content}>
<h3 className="section-heading">Query inspector</h3>
<p className="small muted">
Query inspector allows you to view raw request and response. To collect this data Grafana needs to issue a
new query. Click refresh button below to trigger a new query.
<Trans i18nKey="inspector.query.description">
Query inspector allows you to view raw request and response. To collect this data Grafana needs to issue a
new query. Click refresh button below to trigger a new query.
</Trans>
</p>
</div>
{this.renderExecutedQueries(executedQueries)}
@ -232,17 +235,17 @@ export class QueryInspector extends PureComponent<Props, State> {
onClick={onRefreshQuery}
aria-label={selectors.components.PanelInspector.Query.refreshButton}
>
Refresh
<Trans i18nKey="inspector.query.refresh">Refresh</Trans>
</Button>
{haveData && allNodesExpanded && (
<Button icon="minus" variant="secondary" className={styles.toolbarItem} onClick={this.onToggleExpand}>
Collapse all
<Trans i18nKey="inspector.query.collapse-all">Collapse all</Trans>
</Button>
)}
{haveData && !allNodesExpanded && (
<Button icon="plus" variant="secondary" className={styles.toolbarItem} onClick={this.onToggleExpand}>
Expand all
<Trans i18nKey="inspector.query.expand-all">Expand all</Trans>
</Button>
)}
@ -253,7 +256,7 @@ export class QueryInspector extends PureComponent<Props, State> {
icon="copy"
variant="secondary"
>
Copy to clipboard
<Trans i18nKey="inspector.query.copy-to-clipboard">Copy to clipboard</Trans>
</ClipboardButton>
)}
<div className="flex-grow-1" />
@ -264,7 +267,9 @@ export class QueryInspector extends PureComponent<Props, State> {
<JSONFormatter json={response} open={openNodes} onDidRender={this.setFormattedJson} />
)}
{!isLoading && !haveData && (
<p className="muted">No request and response collected yet. Hit refresh button</p>
<p className="muted">
<Trans i18nKey="inspector.query.no-data">No request and response collected yet. Hit refresh button</Trans>
</p>
)}
</div>
</div>

View File

@ -422,6 +422,16 @@
},
"title": ""
},
"inspector": {
"query": {
"collapse-all": "",
"copy-to-clipboard": "",
"description": "",
"expand-all": "",
"no-data": "",
"refresh": ""
}
},
"library-panel": {
"add-modal": {
"cancel": "Abbrechen",

View File

@ -422,6 +422,16 @@
},
"title": "Shortcuts"
},
"inspector": {
"query": {
"collapse-all": "Collapse all",
"copy-to-clipboard": "Copy to clipboard",
"description": "Query inspector allows you to view raw request and response. To collect this data Grafana needs to issue a new query. Click refresh button below to trigger a new query.",
"expand-all": "Expand all",
"no-data": "No request and response collected yet. Hit refresh button",
"refresh": "Refresh"
}
},
"library-panel": {
"add-modal": {
"cancel": "Cancel",

View File

@ -427,6 +427,16 @@
},
"title": ""
},
"inspector": {
"query": {
"collapse-all": "",
"copy-to-clipboard": "",
"description": "",
"expand-all": "",
"no-data": "",
"refresh": ""
}
},
"library-panel": {
"add-modal": {
"cancel": "Cancelar",

View File

@ -427,6 +427,16 @@
},
"title": ""
},
"inspector": {
"query": {
"collapse-all": "",
"copy-to-clipboard": "",
"description": "",
"expand-all": "",
"no-data": "",
"refresh": ""
}
},
"library-panel": {
"add-modal": {
"cancel": "Annuler",

View File

@ -422,6 +422,16 @@
},
"title": "Ŝĥőřŧčūŧş"
},
"inspector": {
"query": {
"collapse-all": "Cőľľäpşę äľľ",
"copy-to-clipboard": "Cőpy ŧő čľįpþőäřđ",
"description": "Qūęřy įʼnşpęčŧőř äľľőŵş yőū ŧő vįęŵ řäŵ řęqūęşŧ äʼnđ řęşpőʼnşę. Ŧő čőľľęčŧ ŧĥįş đäŧä Ğřäƒäʼnä ʼnęęđş ŧő įşşūę ä ʼnęŵ qūęřy. Cľįčĸ řęƒřęşĥ þūŧŧőʼn þęľőŵ ŧő ŧřįģģęř ä ʼnęŵ qūęřy.",
"expand-all": "Ēχpäʼnđ äľľ",
"no-data": "Ńő řęqūęşŧ äʼnđ řęşpőʼnşę čőľľęčŧęđ yęŧ. Ħįŧ řęƒřęşĥ þūŧŧőʼn",
"refresh": "Ŗęƒřęşĥ"
}
},
"library-panel": {
"add-modal": {
"cancel": "Cäʼnčęľ",

View File

@ -417,6 +417,16 @@
},
"title": ""
},
"inspector": {
"query": {
"collapse-all": "",
"copy-to-clipboard": "",
"description": "",
"expand-all": "",
"no-data": "",
"refresh": ""
}
},
"library-panel": {
"add-modal": {
"cancel": "取消",