translation-connections,sqlObject,column,filter

This commit is contained in:
Stela Augustinova
2025-10-27 15:04:04 +01:00
committed by SPRINX0\prochazka
parent 8663ab2d28
commit 0e211dc91b
16 changed files with 619 additions and 168 deletions

View File

@@ -47,6 +47,7 @@
getOpenDetailOnArrowsSettings,
} from '../settings/settingsTools';
import DropDownButton from '../buttons/DropDownButton.svelte';
import { _t } from '../translations';
const connections = useConnectionList();
const serverStatus = useServerStatus();
@@ -58,7 +59,7 @@
let domContainer = null;
let domFilter = null;
const RECENT_AND_UNSAVED_LABEL = 'Recent & unsaved';
const RECENT_AND_UNSAVED_LABEL = _t('connection.recentUnsaved', { defaultMessage: 'Recent & unsaved' });
function extractConnectionParent(data, openedConnections, openedSingleDatabaseConnections) {
if (data.parent) {
@@ -193,12 +194,12 @@
function createSearchMenu() {
const res = [];
res.push({ label: 'Search by:', isBold: true, disabled: true });
res.push({ label: 'Display name', switchValue: 'displayName' });
res.push({ label: 'Server', switchValue: 'server' });
res.push({ label: 'User', switchValue: 'user' });
res.push({ label: 'Database engine', switchValue: 'engine' });
res.push({ label: 'Database name', switchValue: 'database' });
res.push({ label: _t('common.searchBy', { defaultMessage: 'Search by:' }), isBold: true, disabled: true });
res.push({ label: _t('connection.displayName', { defaultMessage: 'Display name' }), switchValue: 'displayName' });
res.push({ label: _t('connection.server', { defaultMessage: 'Server' }), switchValue: 'server' });
res.push({ label: _t('connection.user', { defaultMessage: 'User' }), switchValue: 'user' });
res.push({ label: _t('connection.engine', { defaultMessage: 'Database engine' }), switchValue: 'engine' });
res.push({ label: _t('connection.database', { defaultMessage: 'Database name' }), switchValue: 'database' });
return res.map(item => ({
...item,
switchStore: connectionAppObjectSearchSettings,
@@ -209,7 +210,7 @@
<SearchBoxWrapper>
<SearchInput
placeholder="Search connection or database"
placeholder= {_t('connection.search.placeholder', { defaultMessage: 'Search connection or database' })}
bind:value={filter}
bind:this={domFilter}
onFocusFilteredList={() => {
@@ -227,16 +228,16 @@
{#if $commandsCustomized['new.connection']?.enabled}
<InlineButton
on:click={() => runCommand('new.connection')}
title="Add new connection"
title={_t('connection.new.title', { defaultMessage: 'Add new connection' })}
data-testid="ConnectionList_buttonNewConnection"
>
<FontIcon icon="icon plus-thick" />
</InlineButton>
<InlineButton on:click={() => runCommand('new.connection.folder')} title="Add new connection folder">
<InlineButton on:click={() => runCommand('new.connection.folder')} title={_t('connection.new.folder.title', { defaultMessage: 'Add new connection folder' })}>
<FontIcon icon="icon add-folder" />
</InlineButton>
{/if}
<InlineButton on:click={handleRefreshConnections} title="Refresh connection list">
<InlineButton on:click={handleRefreshConnections} title={_t('connection.refresh.title', { defaultMessage: 'Refresh connection list' })}>
<FontIcon icon="icon refresh" />
</InlineButton>
</SearchBoxWrapper>

View File

@@ -56,6 +56,7 @@
import FocusedConnectionInfoWidget from './FocusedConnectionInfoWidget.svelte';
import SubProcedureParamList from '../appobj/SubProcedureParamList.svelte';
import SubProcedureLineList from '../appobj/SubProcedureLineList.svelte';
import { _t } from '../translations';
export let conid;
export let database;
@@ -130,20 +131,20 @@
function createSearchMenu() {
const res = [];
res.push({ label: 'Search by:', isBold: true, disabled: true });
res.push({ label: _t('sqlObject.searchBy', { defaultMessage: 'Search by:' }), isBold: true, disabled: true });
if (driver?.databaseEngineTypes?.includes('document')) {
res.push({ label: 'Collection name', switchValue: 'pureName' });
res.push({ label: _t('sqlObject.collectionName', { defaultMessage: 'Collection name' }), switchValue: 'pureName' });
}
if (driver?.databaseEngineTypes?.includes('sql')) {
res.push({ label: 'Table/view/procedure name', switchValue: 'pureName' });
res.push({ label: 'Schema', switchValue: 'schemaName' });
res.push({ label: 'Column name', switchValue: 'columnName' });
res.push({ label: 'Column data type', switchValue: 'columnDataType' });
res.push({ label: 'Table comment', switchValue: 'tableComment' });
res.push({ label: 'Column comment', switchValue: 'columnComment' });
res.push({ label: 'View/procedure/trigger text', switchValue: 'sqlObjectText' });
res.push({ label: 'Table engine', switchValue: 'tableEngine' });
res.push({ label: 'Only tables with rows', switchValue: 'tablesWithRows' });
res.push({ label: _t('sqlObject.tableViewProcedureName', { defaultMessage: 'Table/view/procedure name' }), switchValue: 'pureName' });
res.push({ label: _t('sqlObject.schemaName', { defaultMessage: 'Schema' }), switchValue: 'schemaName' });
res.push({ label: _t('sqlObject.columnName', { defaultMessage: 'Column name' }), switchValue: 'columnName' });
res.push({ label: _t('sqlObject.columnDataType', { defaultMessage: 'Column data type' }), switchValue: 'columnDataType' });
res.push({ label: _t('sqlObject.tableComment', { defaultMessage: 'Table comment' }), switchValue: 'tableComment' });
res.push({ label: _t('sqlObject.columnComment', { defaultMessage: 'Column comment' }), switchValue: 'columnComment' });
res.push({ label: _t('sqlObject.viewProcedureTriggerText', { defaultMessage: 'View/procedure/trigger text' }), switchValue: 'sqlObjectText' });
res.push({ label: _t('sqlObject.tableEngine', { defaultMessage: 'Table engine' }), switchValue: 'tableEngine' });
res.push({ label: _t('sqlObject.tablesWithRows', { defaultMessage: 'Only tables with rows' }), switchValue: 'tablesWithRows' });
}
return res.map(item => ({
...item,
@@ -175,7 +176,7 @@
<WidgetsInnerContainer hideContent={differentFocusedDb}>
<ErrorInfo message={$status.message} icon="img error" />
<InlineButton on:click={handleRefreshDatabase}>Refresh</InlineButton>
<InlineButton on:click={handleRefreshDatabase}>{_t('common.refresh', { defaultMessage: 'Refresh' })}</InlineButton>
</WidgetsInnerContainer>
{:else if objectList.length == 0 && $status && $status.name != 'pending' && $status.name != 'checkStructure' && $status.name != 'loadStructure' && $objects}
<SchemaSelector
@@ -192,14 +193,14 @@
<WidgetsInnerContainer hideContent={differentFocusedDb}>
<ErrorInfo
message={`Database ${database} is empty or structure is not loaded, press Refresh button to reload structure`}
message={_t('sqlObject.databaseEmpty', { defaultMessage: `Database ${database} is empty or structure is not loaded, press Refresh button to reload structure` })}
icon="img alert"
/>
<div class="m-1" />
<InlineButton on:click={handleRefreshDatabase}>Refresh</InlineButton>
<InlineButton on:click={handleRefreshDatabase}>{_t('common.refresh', { defaultMessage: 'Refresh' })}</InlineButton>
{#if driver?.databaseEngineTypes?.includes('sql')}
<div class="m-1" />
<InlineButton on:click={() => runCommand('new.table')}>New table</InlineButton>
<InlineButton on:click={() => runCommand('new.table')}>{_t('database.newTable', { defaultMessage: 'New table' })}</InlineButton>
{/if}
{#if driver?.databaseEngineTypes?.includes('document')}
<div class="m-1" />
@@ -211,7 +212,7 @@
{:else}
<SearchBoxWrapper>
<SearchInput
placeholder="Search in tables, views, procedures"
placeholder={_t('sqlObject.search.placeholder', { defaultMessage: 'Search in tables, views, procedures' })}
bind:value={filter}
bind:this={domFilter}
onFocusFilteredList={() => {
@@ -259,7 +260,7 @@
data-testid="SqlObjectList_container"
>
{#if ($status && ($status.name == 'pending' || $status.name == 'checkStructure' || $status.name == 'loadStructure') && $objects) || !$objects}
<LoadingInfo message={$status?.feedback?.analysingMessage || 'Loading database structure'} />
<LoadingInfo message={$status?.feedback?.analysingMessage || _t('sqlObject.loadingStructure', { defaultMessage: 'Loading database structure' })} />
{:else}
<AppObjectListHandler
bind:this={domListHandler}