mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 00:56:02 +00:00
translation - settings, menu
This commit is contained in:
committed by
SPRINX0\prochazka
parent
7bb9414be8
commit
edf9f3a2be
@@ -719,7 +719,11 @@
|
||||
|
||||
const filteredSumenus = coreMenus.map(item => {
|
||||
if (!item.submenu) {
|
||||
return { ...item , label: _val(item.label)};
|
||||
if (!item) return item;
|
||||
|
||||
return {...item,
|
||||
label: _val(item.label)
|
||||
};
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
|
||||
@@ -27,7 +27,7 @@ registerCommand({
|
||||
id: 'database.switch',
|
||||
category: __t('command.database', { defaultMessage: 'Database' }),
|
||||
name: __t('command.database.changeRecent', { defaultMessage: 'Change to recent' }),
|
||||
menuName: 'Switch recent database',
|
||||
menuName: __t('command.database.switchRecent', { defaultMessage: 'Switch recent database' }),
|
||||
keyText: 'CtrlOrCommand+D',
|
||||
getSubCommands: () => getRecentDatabases().map(switchDatabaseCommand),
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface GlobalCommand {
|
||||
enabled?: boolean;
|
||||
showDisabled?: boolean;
|
||||
toolbarName?: string | (() => string);
|
||||
menuName?: string;
|
||||
menuName?: string | (() => string);
|
||||
toolbarOrder?: number;
|
||||
disableHandleKeyText?: string;
|
||||
isRelatedToTab?: boolean;
|
||||
|
||||
@@ -192,7 +192,7 @@ registerCommand({
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img shell',
|
||||
name: __t('command.new.shell', { defaultMessage: 'JavaScript Shell' }),
|
||||
menuName: 'New JavaScript shell',
|
||||
menuName: __t('command.new.JSShell', { defaultMessage: 'New JavaScript shell' }),
|
||||
onClick: () => {
|
||||
openNewTab({
|
||||
title: 'Shell #',
|
||||
@@ -208,7 +208,7 @@ if (isProApp()) {
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img query-design',
|
||||
name: __t('command.new.queryDesign', { defaultMessage: 'Query design' }),
|
||||
menuName: 'New query design',
|
||||
menuName: __t('command.new.newQueryDesign', { defaultMessage: 'New query design' }),
|
||||
onClick: () => newQueryDesign(),
|
||||
testEnabled: () =>
|
||||
getCurrentDatabase() &&
|
||||
@@ -222,7 +222,7 @@ if (isProApp()) {
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img transform',
|
||||
name: __t('command.new.modelTransform', { defaultMessage: 'Model transform' }),
|
||||
menuName: 'New model transform',
|
||||
menuName: __t('command.new.newModelTransform', { defaultMessage: 'New model transform' }),
|
||||
onClick: () => {
|
||||
openNewTab(
|
||||
{
|
||||
@@ -266,7 +266,7 @@ if (isProApp()) {
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img perspective',
|
||||
name: __t('command.new.perspective', { defaultMessage: 'Perspective' }),
|
||||
menuName: 'New perspective',
|
||||
menuName: __t('command.new.newPerspective', { defaultMessage: 'New perspective' }),
|
||||
onClick: () => newPerspective(),
|
||||
});
|
||||
}
|
||||
@@ -277,7 +277,7 @@ if (isProApp()) {
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img app',
|
||||
name: __t('command.new.application', { defaultMessage: 'Application' }),
|
||||
menuName: 'New application',
|
||||
menuName: __t('command.new.newApplication', { defaultMessage: 'New application' }),
|
||||
onClick: () => {
|
||||
openNewTab({
|
||||
title: 'Application #',
|
||||
@@ -293,7 +293,7 @@ registerCommand({
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img diagram',
|
||||
name: __t('command.new.diagram', { defaultMessage: 'ER Diagram' }),
|
||||
menuName: 'New ER diagram',
|
||||
menuName: __t('command.new.newDiagram', { defaultMessage: 'New ER diagram' }),
|
||||
testEnabled: () =>
|
||||
getCurrentDatabase() &&
|
||||
findEngineDriver(getCurrentDatabase()?.connection, getExtensions())?.databaseEngineTypes?.includes('sql'),
|
||||
@@ -416,7 +416,7 @@ registerCommand({
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img archive',
|
||||
name: __t('command.new.jsonl', { defaultMessage: 'JSON Lines' }),
|
||||
menuName: 'New JSON lines file',
|
||||
menuName: __t('command.new.newJsonl', { defaultMessage: 'New JSON lines file' }),
|
||||
onClick: () => {
|
||||
openNewTab(
|
||||
{
|
||||
@@ -436,7 +436,7 @@ registerCommand({
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img sqlite-database',
|
||||
name: __t('command.new.sqliteDatabase', { defaultMessage: 'SQLite database' }),
|
||||
menuName: _t('command.new.sqliteDatabase', { defaultMessage: 'New SQLite database' }),
|
||||
menuName: __t('command.new.sqliteDatabase', { defaultMessage: 'New SQLite database' }),
|
||||
onClick: () => {
|
||||
showModal(InputTextModal, {
|
||||
value: 'newdb',
|
||||
@@ -456,7 +456,7 @@ registerCommand({
|
||||
category: __t('command.new', { defaultMessage: 'New' }),
|
||||
icon: 'img sqlite-database',
|
||||
name: __t('command.new.duckdbDatabase', { defaultMessage: 'DuckDB database' }),
|
||||
menuName: _t('command.new.duckdbDatabase', { defaultMessage: 'New DuckDB database' }),
|
||||
menuName: __t('command.new.duckdbDatabase', { defaultMessage: 'New DuckDB database' }),
|
||||
onClick: () => {
|
||||
showModal(InputTextModal, {
|
||||
value: 'newdb',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { commandsCustomized, currentDropDownMenu } from '../stores';
|
||||
import { prepareMenuItems } from '../utility/contextMenu';
|
||||
import DropDownMenu from './DropDownMenu.svelte';
|
||||
import { _t } from '../translations';
|
||||
|
||||
export let items;
|
||||
|
||||
@@ -37,7 +38,7 @@
|
||||
}
|
||||
}}
|
||||
>
|
||||
{item.text || item.label}
|
||||
{item.text || _t(item.label.id, item.label.defaultMessage)}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import FormSelectField from '../forms/FormSelectField.svelte';
|
||||
import SelectField from '../forms/SelectField.svelte';
|
||||
import { lastUsedDefaultActions } from '../stores';
|
||||
import { _val } from '../translations';
|
||||
|
||||
export let label;
|
||||
export let objectTypeField;
|
||||
@@ -18,7 +19,7 @@
|
||||
defaultValue={defaultDatabaseObjectAppObjectActions[objectTypeField][0]?.defaultActionId}
|
||||
options={defaultDatabaseObjectAppObjectActions[objectTypeField].map(x => ({
|
||||
value: x.defaultActionId,
|
||||
label: x.label,
|
||||
label: _val(x.label),
|
||||
}))}
|
||||
value={$lastUsedDefaultActions[objectTypeField]}
|
||||
on:change={e => {
|
||||
|
||||
@@ -126,7 +126,7 @@ ORDER BY
|
||||
<div class="heading">{_t('settings.appearance', { defaultMessage: 'Appearance' })}</div>
|
||||
<FormCheckboxField
|
||||
name="app.useNativeMenu"
|
||||
label={isMac() ? 'Use native window title' : 'Use system native menu'}
|
||||
label={isMac() ? _t('settings.useNativeWindowTitle', { defaultMessage: 'Use native window title' }) : _t('settings.useSystemNativeMenu', { defaultMessage: 'Use system native menu' })}
|
||||
on:change={() => {
|
||||
restartWarning = true;
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user