mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 21:56:00 +00:00
translated electron menu
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
import { getLocalStorage } from '../utility/storageCache';
|
||||
import registerCommand from './registerCommand';
|
||||
import { formatKeyText, switchCurrentDatabase } from '../utility/common';
|
||||
import { _val, __t } from '../translations';
|
||||
import { _tval, __t } from '../translations';
|
||||
|
||||
let domInput;
|
||||
let filter = '';
|
||||
@@ -118,7 +118,7 @@
|
||||
: sortedComands
|
||||
).filter(x => !x.isGroupCommand),
|
||||
{
|
||||
extract: x => _val(x.text),
|
||||
extract: x => _tval(x.text),
|
||||
pre: '<b>',
|
||||
post: '</b>',
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { commands } from '../stores';
|
||||
import { invalidateCommandDefinitions } from './invalidateCommands';
|
||||
import _ from 'lodash';
|
||||
import { _val } from '../translations';
|
||||
import { _tval, DefferedTranslationResult, isDefferedTranslationResult } from '../translations';
|
||||
|
||||
export interface SubCommand {
|
||||
text: string;
|
||||
@@ -10,10 +10,10 @@ export interface SubCommand {
|
||||
|
||||
export interface GlobalCommand {
|
||||
id: string;
|
||||
category: string | (() => string); // null for group commands
|
||||
category: string | DefferedTranslationResult; // null for group commands
|
||||
isGroupCommand?: boolean;
|
||||
name: string | (() => string);
|
||||
text?: string | (() => string);
|
||||
name: string | DefferedTranslationResult;
|
||||
text?: string | DefferedTranslationResult;
|
||||
keyText?: string;
|
||||
keyTextFromGroup?: string; // automatically filled from group
|
||||
group?: string;
|
||||
@@ -25,8 +25,8 @@ export interface GlobalCommand {
|
||||
toolbar?: boolean;
|
||||
enabled?: boolean;
|
||||
showDisabled?: boolean;
|
||||
toolbarName?: string | (() => string);
|
||||
menuName?: string | (() => string);
|
||||
toolbarName?: string | DefferedTranslationResult;
|
||||
menuName?: string | DefferedTranslationResult;
|
||||
toolbarOrder?: number;
|
||||
disableHandleKeyText?: string;
|
||||
isRelatedToTab?: boolean;
|
||||
@@ -44,8 +44,8 @@ export default function registerCommand(command: GlobalCommand) {
|
||||
...x,
|
||||
[command.id]: {
|
||||
text:
|
||||
_.isFunction(command.category) || _.isFunction(command.name)
|
||||
? () => `${_val(command.category)}: ${_val(command.name)}`
|
||||
isDefferedTranslationResult(command.category) || isDefferedTranslationResult(command.name)
|
||||
? () => `${_tval(command.category)}: ${_tval(command.name)}`
|
||||
: `${command.category}: ${command.name}`,
|
||||
...command,
|
||||
enabled: !testEnabled,
|
||||
|
||||
Reference in New Issue
Block a user