Skip to content

Commit 784c5b3

Browse files
fix(QueryEditor): rename actions (#741)
1 parent 823709d commit 784c5b3

File tree

4 files changed

+13
-38
lines changed

4 files changed

+13
-38
lines changed

src/containers/Tenant/Query/QueryEditor/QueryEditor.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import type {ExplainQueryState} from '../../../../types/store/explainQuery';
4444
import type {ValueOf} from '../../../../types/common';
4545
import type {EPathType} from '../../../../types/api/schema';
4646
import type {RootState} from '../../../../store';
47+
import i18n from '../i18n';
4748

4849
import './QueryEditor.scss';
4950

@@ -282,7 +283,7 @@ function QueryEditor(props: QueryEditorProps) {
282283
editor.focus();
283284
editor.addAction({
284285
id: 'sendQuery',
285-
label: 'Send query',
286+
label: i18n('action.send-query'),
286287
keybindings: [
287288
// eslint-disable-next-line no-bitwise
288289
monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter,
@@ -308,7 +309,7 @@ function QueryEditor(props: QueryEditorProps) {
308309
});
309310
editor.addAction({
310311
id: 'sendSelectedQuery',
311-
label: 'Send selected query',
312+
label: i18n('action.send-selected-query'),
312313
keybindings: [
313314
// eslint-disable-next-line no-bitwise
314315
monaco.KeyMod.CtrlCmd | monaco.KeyMod.Shift | monaco.KeyCode.Enter,
@@ -321,7 +322,7 @@ function QueryEditor(props: QueryEditorProps) {
321322

322323
editor.addAction({
323324
id: 'previous-query',
324-
label: 'Previous query',
325+
label: i18n('action.previous-query'),
325326
keybindings: [
326327
// eslint-disable-next-line no-bitwise
327328
monaco.KeyMod.CtrlCmd | monaco.KeyCode.UpArrow,
@@ -334,7 +335,7 @@ function QueryEditor(props: QueryEditorProps) {
334335
});
335336
editor.addAction({
336337
id: 'next-query',
337-
label: 'Next query',
338+
label: i18n('action.next-query'),
338339
keybindings: [
339340
// eslint-disable-next-line no-bitwise
340341
monaco.KeyMod.CtrlCmd | monaco.KeyCode.DownArrow,

src/containers/Tenant/Query/i18n/en.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,10 @@
2323
"method-description.query": "Any query. An experimental API call supposed to replace all existing methods.\nAPI Call: query.ExecuteScript",
2424
"method-description.pg": "Queries in postgresql syntax.\nAPI call: query.ExecuteScript",
2525

26-
"query-duration.description": "Duration of server-side query execution"
26+
"query-duration.description": "Duration of server-side query execution",
27+
28+
"action.send-query": "Send query",
29+
"action.send-selected-query": "Send selected query",
30+
"action.previous-query": "Previous query in history",
31+
"action.next-query": "Next query in history"
2732
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import {i18n, Lang} from '../../../../utils/i18n';
1+
import {registerKeysets} from '../../../../utils/i18n';
22

33
import en from './en.json';
4-
import ru from './ru.json';
54

65
const COMPONENT = 'ydb-query-editor';
76

8-
i18n.registerKeyset(Lang.En, COMPONENT, en);
9-
i18n.registerKeyset(Lang.Ru, COMPONENT, ru);
10-
11-
export default i18n.keyset(COMPONENT);
7+
export default registerKeysets(COMPONENT, {en});

src/containers/Tenant/Query/i18n/ru.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)