Merge pull request #1281 from dbgate/feature/translation4

Feature/translation4
This commit is contained in:
Jan Prochazka
2025-12-02 14:11:51 +01:00
committed by GitHub
66 changed files with 469 additions and 434 deletions

View File

@@ -161,8 +161,8 @@
const handleRename = () => {
showModal(InputTextModal, {
value: folder,
label: 'New folder name',
header: 'Rename folder',
label: _t('connection.newFolderName', { defaultMessage: 'New folder name' }),
header: _t('connection.renameFolder', { defaultMessage: 'Rename folder' }),
onConfirm: async newFolder => {
emptyConnectionGroupNames.update(folders => _.uniq(folders.map(fld => (fld == folder ? newFolder : fld))));
apiCall('connections/batch-change-folder', {
@@ -175,7 +175,7 @@
const handleDelete = () => {
showModal(ConfirmModal, {
message: `Really delete folder ${folder}? Connections in folder will be moved into root folder.`,
message: _t('connection.deleteFolderConfirm', { defaultMessage: 'Really delete folder {folder}? Connections in folder will be moved into root folder.', values: { folder } }),
onConfirm: () => {
emptyConnectionGroupNames.update(folders => folders.filter(fld => fld != folder));
apiCall('connections/batch-change-folder', {
@@ -187,8 +187,8 @@
};
return [
{ text: 'Rename', onClick: handleRename },
{ text: 'Delete', onClick: handleDelete },
{ text: _t('common.rename', { defaultMessage: 'Rename' }), onClick: handleRename },
{ text: _t('common.delete', { defaultMessage: 'Delete' }), onClick: handleDelete },
];
}

View File

@@ -19,6 +19,7 @@
import _ from 'lodash';
import openNewTab from '../utility/openNewTab';
import { showSnackbarError } from '../utility/snackbar';
import { _t } from '../translations';
import DbKeysSubTree from './DbKeysSubTree.svelte';
@@ -43,10 +44,10 @@
return [
item.key != null &&
!connection?.isReadOnly && {
label: 'Delete key',
label: _t('dbKeysTreeNode.deleteKey', { defaultMessage: 'Delete key' }),
onClick: () => {
showModal(ConfirmModal, {
message: `Really delete key ${item.key}?`,
message: _t('dbKeysTreeNode.deleteKeyConfirm', { defaultMessage: 'Really delete key {key}?', values: { key: item.key } }),
onConfirm: async () => {
await apiCall('database-connections/call-method', {
conid,
@@ -62,12 +63,12 @@
},
item.key != null &&
!connection?.isReadOnly && {
label: 'Rename key',
label: _t('dbKeysTreeNode.renameKey', { defaultMessage: 'Rename key' }),
onClick: () => {
showModal(InputTextModal, {
value: item.key,
label: 'New name',
header: 'Rename key',
label: _t('dbKeysTreeNode.newName', { defaultMessage: 'New name' }),
header: _t('dbKeysTreeNode.renameKey', { defaultMessage: 'Rename key' }),
onConfirm: async newName => {
await apiCall('database-connections/call-method', {
conid,
@@ -90,11 +91,11 @@
// },
item.type == 'dir' &&
!connection?.isReadOnly && {
label: 'Delete branch',
label: _t('dbKeysTreeNode.deleteBranch', { defaultMessage: 'Delete branch' }),
onClick: () => {
const branch = `${item.key}:*`;
showModal(ConfirmModal, {
message: `Really delete branch ${branch} with all keys?`,
message: _t('dbKeysTreeNode.deleteBranchConfirm', { defaultMessage: 'Really delete branch {branch} with all keys?', values: { branch } }),
onConfirm: async () => {
await apiCall('database-connections/call-method', {
conid,
@@ -110,7 +111,7 @@
},
,
{
label: 'Generate script',
label: _t('dbKeysTreeNode.generateScript', { defaultMessage: 'Generate script' }),
onClick: async () => {
const data = await apiCall('database-connections/export-keys', {
conid,
@@ -126,7 +127,7 @@
}
newQuery({
title: 'Export #',
title: _t('dbKeysTreeNode.exportTitle', { defaultMessage: 'Export #' }),
initialData: data,
});
},
@@ -137,7 +138,7 @@
<AppObjectCore
icon={getIconForRedisType(item.type)}
title={item.text || '(no name)'}
title={item.text || _t('dbKeysTreeNode.noName', { defaultMessage: '(no name)' })}
expandIcon={item.type == 'dir' ? plusExpandIcon(isExpanded) : 'icon invisible-box'}
on:expand={() => {
if (item.type == 'dir') {
@@ -150,7 +151,7 @@
} else {
openNewTab({
tabComponent: 'DbKeyDetailTab',
title: item.text || '(no name)',
title: item.text || _t('dbKeysTreeNode.noName', { defaultMessage: '(no name)' }),
icon: 'img keydb',
props: {
isDefaultBrowser: true,

View File

@@ -115,7 +115,7 @@
command: 'new.connectionOnCloud',
},
{
text: 'New SQL script',
text: _t('privateCloudWidget.newSqlScript', { defaultMessage: 'New SQL script' }),
onClick: () => {
const data = '';
showModal(SaveFileModal, {
@@ -145,11 +145,11 @@
function createAddFolderMenu() {
return [
isProApp() && {
text: 'Create shared folder',
text: _t('privateCloudWidget.createSharedFolder', { defaultMessage: 'Create shared folder' }),
onClick: () => {
showModal(InputTextModal, {
label: 'New folder name',
header: 'New shared folder',
label: _t('privateCloudWidget.newFolderName', { defaultMessage: 'New folder name' }),
header: _t('privateCloudWidget.newSharedFolder', { defaultMessage: 'New shared folder' }),
onConfirm: async newFolder => {
apiCall('cloud/create-folder', {
name: newFolder,
@@ -159,11 +159,11 @@
},
},
{
text: 'Add existing folder (from link)',
text: _t('privateCloudWidget.addExistingFolder', { defaultMessage: 'Add existing folder (from link)' }),
onClick: () => {
showModal(InputTextModal, {
label: 'Your invite link (in form dbgate://folder/xxx)',
header: 'Add existing shared folder',
label: _t('privateCloudWidget.yourInviteLink', { defaultMessage: 'Your invite link (in form dbgate://folder/xxx)' }),
header: _t('privateCloudWidget.addExistingSharedFolder', { defaultMessage: 'Add existing shared folder' }),
onConfirm: async newFolder => {
apiCall('cloud/grant-folder', {
inviteLink: newFolder,
@@ -179,8 +179,8 @@
const handleRename = () => {
showModal(InputTextModal, {
value: contentGroupMap[folder]?.name,
label: 'New folder name',
header: 'Rename folder',
label: _t('privateCloudWidget.newFolderName', { defaultMessage: 'New folder name' }),
header: _t('privateCloudWidget.renameFolder', { defaultMessage: 'Rename folder' }),
onConfirm: async name => {
apiCall('cloud/rename-folder', {
folid: folder,
@@ -192,8 +192,8 @@
const handleDelete = () => {
showModal(ConfirmModal, {
message: `Really delete folder ${contentGroupMap[folder]?.name}? All folder content will be deleted!`,
header: 'Delete folder',
message: _t('privateCloudWidget.deleteFolderConfirm', { defaultMessage: 'Really delete folder {folder}? All folder content will be deleted!', values: { folder: contentGroupMap[folder]?.name } }),
header: _t('privateCloudWidget.deleteFolder', { defaultMessage: 'Delete folder' }),
onConfirm: () => {
apiCall('cloud/delete-folder', {
folid: folder,
@@ -204,13 +204,13 @@
return [
contentGroupMap[folder]?.role == 'admin' && [
{ text: 'Rename', onClick: handleRename },
{ text: 'Delete', onClick: handleDelete },
{ text: _t('common.rename', { defaultMessage: 'Rename' }), onClick: handleRename },
{ text: _t('common.delete', { defaultMessage: 'Delete' }), onClick: handleDelete },
],
isProApp() &&
contentGroupMap[folder]?.role == 'admin' &&
!contentGroupMap[folder]?.isPrivate && {
text: 'Administrate access',
text: _t('privateCloudWidget.administrateAccess', { defaultMessage: 'Administrate access' }),
onClick: () => {
showModal(ConfigureSharedFolderModal, {
folid: folder,
@@ -249,13 +249,13 @@
skip={!$cloudSigninTokenHolder}
>
<SearchBoxWrapper>
<SearchInput placeholder="Search cloud connections and files" bind:value={filter} />
<SearchInput placeholder={_t('privateCloudWidget.searchPlaceholder', { defaultMessage: 'Search cloud connections and files' })} bind:value={filter} />
<CloseSearchButton bind:filter />
<DropDownButton icon="icon plus-thick" menu={createAddItemMenu} title="Add new connection or file" />
<DropDownButton icon="icon add-folder" menu={createAddFolderMenu} title="Add new folder" />
<DropDownButton icon="icon plus-thick" menu={createAddItemMenu} title={_t('privateCloudWidget.addNewConnectionOrFile', { defaultMessage: 'Add new connection or file' })} />
<DropDownButton icon="icon add-folder" menu={createAddFolderMenu} title={_t('privateCloudWidget.addNewFolder', { defaultMessage: 'Add new folder' })} />
<InlineButton
on:click={handleRefreshContent}
title="Refresh files"
title={_t('privateCloudWidget.refreshFiles', { defaultMessage: 'Refresh files' })}
data-testid="CloudItemsWidget_buttonRefreshContent"
>
<FontIcon icon="icon refresh" />
@@ -289,11 +289,11 @@
/>
{#if !cloudContentFlat?.length}
<ErrorInfo message="You have no content on DbGate cloud" icon="img info" />
<ErrorInfo message={_t('privateCloudWidget.noContent', { defaultMessage: 'You have no content on DbGate cloud' })} icon="img info" />
<div class="error-info">
<div class="m-1"></div>
<FormStyledButton
value="Create connection on DbGate Cloud"
value={_t('privateCloudWidget.createConnection', { defaultMessage: 'Create connection on DbGate Cloud' })}
skipWidth
on:click={() => {
runCommand('new.connectionOnCloud');

View File

@@ -27,7 +27,7 @@
</script>
<WidgetColumnBar>
<WidgetColumnBarItem title="Public Knowledge Base" name="publicCloud" storageName="publicCloudItems">
<WidgetColumnBarItem title={_t('publicCloudWidget.publicKnowledgeBase', { defaultMessage: "Public Knowledge Base" })} name="publicCloud" storageName="publicCloudItems">
<WidgetsInnerContainer>
<SearchBoxWrapper>
<SearchInput placeholder={_t('publicCloudWidget.searchPublicFiles', { defaultMessage: "Search public files" })} bind:value={filter} />
@@ -49,7 +49,7 @@
/>
{#if !$publicFiles?.length}
<ErrorInfo message="No files found for your configuration" />
<ErrorInfo message={_t('publicCloudWidget.noFilesFound', { defaultMessage: "No files found for your configuration" })} />
<div class="error-info">
<div class="m-1">
{_t('publicCloudWidget.onlyRelevantFilesListed', { defaultMessage: "Only files relevant for your connections, platform and DbGate edition are listed. Please define connections at first." })}