translated electron menu

This commit is contained in:
SPRINX0\prochazka
2025-11-18 12:29:48 +01:00
parent d80c368ccb
commit f047ec787a
13 changed files with 70 additions and 42 deletions

View File

@@ -8,7 +8,7 @@
import Link from '../elements/Link.svelte';
import { focusedConnectionOrDatabase } from '../stores';
import { tick } from 'svelte';
import { _val } from '../translations';
import { _tval } from '../translations';
export let list;
export let module;
@@ -41,12 +41,12 @@
$: listTranslated = (list || []).map(data => ({
...data,
group: data?.group && _val(data.group),
title: data?.title && _val(data.title),
description: data?.description && _val(data.description),
group: data?.group && _tval(data.group),
title: data?.title && _tval(data.title),
description: data?.description && _tval(data.description),
args: (data?.args || []).map(x => ({
...x,
label: x?.label && _val(x.label),
label: x?.label && _tval(x.label),
})),
}));

View File

@@ -1,6 +1,6 @@
<script lang="ts" context="module">
import { copyTextToClipboard } from '../utility/clipboard';
import { _t, _val } from '../translations';
import { _t, _tval, DefferedTranslationResult } from '../translations';
export const extractKey = ({ schemaName, pureName }) => (schemaName ? `${schemaName}.${pureName}` : pureName);
export const createMatcher =
@@ -76,7 +76,7 @@
}
interface DbObjMenuItem {
label?: string | (() => string);
label?: string | DefferedTranslationResult;
tab?: string;
forceNewTab?: boolean;
initialData?: any;
@@ -722,7 +722,7 @@
if (!item) return item;
return {...item,
label: _val(item.label)
label: _tval(item.label)
};
}
return {