Translation - added translation tags for widgets

This commit is contained in:
Stela Augustinova
2025-11-24 16:29:29 +01:00
parent 19f2aa2997
commit da224303fe
12 changed files with 54 additions and 44 deletions

View File

@@ -101,6 +101,7 @@
import WidgetTitle from './WidgetTitle.svelte';
import JsonExpandedCellView from '../celldata/JsonExpandedCellView.svelte';
import XmlCellView from '../celldata/XmlCellView.svelte';
import { _t } from '../translations';
let selectedFormatType = 'autodetect';
@@ -116,7 +117,7 @@
</script>
<div class="wrapper">
<WidgetTitle>Cell data view</WidgetTitle>
<WidgetTitle>{_t('cellDataWidget.title', { defaultMessage: "Cell data view" })}</WidgetTitle>
<div class="main">
<div class="toolbar">
Format:<span>&nbsp;</span>
@@ -126,18 +127,18 @@
on:change={e => (selectedFormatType = e.detail)}
data-testid="CellDataWidget_selectFormat"
options={[
{ value: 'autodetect', label: `Autodetect - ${autodetectFormat.title}` },
{ value: 'autodetect', label: _t('cellDataWidget.autodetect', { defaultMessage: "Autodetect - {autoDetectTitle}", values : { autoDetectTitle: autodetectFormat.title } }) },
...formats.map(fmt => ({ label: fmt.title, value: fmt.type })),
]}
/>
</div>
<div class="data">
{#if usedFormat.single && selection?.length != 1}
<ErrorInfo message="Must be selected one cell" alignTop />
<ErrorInfo message={_t('cellDataWidget.mustSelectOneCell', { defaultMessage: "Must be selected one cell" })} alignTop />
{:else if usedFormat == null}
<ErrorInfo message="Format not selected" alignTop />
<ErrorInfo message={_t('cellDataWidget.formatNotSelected', { defaultMessage: "Format not selected" })} alignTop />
{:else if !selection || selection.length == 0}
<ErrorInfo message="No data selected" alignTop />
<ErrorInfo message={_t('cellDataWidget.noDataSelected', { defaultMessage: "No data selected" })} alignTop />
{:else}
<svelte:component this={usedFormat?.component} {selection} />
{/if}