Refactor to use _val for translation handling across components

This commit is contained in:
Stela Augustinova
2025-11-07 14:40:52 +01:00
parent bda5c4f5dd
commit e694aca70b
7 changed files with 21 additions and 17 deletions

View File

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