Files
gods-eye-view/src/ui/PanelRailView.vue
T
Sameh KhamisandManjunath Paparaju 5383b470ee Translate the Visual panel and keep its name apart from the satellite class
The panel's new headings, the scope opacity slider and the reset are
translated in every language, and the presets' names and descriptions use
the dock's translations. The cards' on/off pills take their words from the
locale instead of fixed English. VISUAL, the panel's name on the rail and in
its header, gets its own translation context: several languages had it as
"visible", from the satellite class of the same English word.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-14 15:31:33 -08:00

51 lines
1.3 KiB
Vue

<script setup>
import { computed } from 'vue';
import { t } from '../i18n/index.js';
import UiRail from './kit/UiRail.vue';
import {
PANEL_RAIL_FALLBACK_ICON,
PANEL_RAIL_ITEMS,
} from './panelRailCatalog.js';
import { usePanelStore } from './stores/panels.js';
const props = defineProps({
/** `left` or `right`. */
side: { type: String, required: true },
/** Open or close a panel; receives the panel id. */
onSelect: { type: Function, required: true },
});
const panels = usePanelStore();
const items = computed(() =>
panels.sides[props.side]
.filter((panel) => panel.available)
.map((panel) => {
const item = PANEL_RAIL_ITEMS[panel.id];
return {
id: panel.id,
icon: item?.icon ?? PANEL_RAIL_FALLBACK_ICON,
// Static markup is translated at boot, so a host's title already is.
label: item
? t(item.label, item.context && { context: item.context })
: panel.title,
};
}),
);
const active = computed(() => panels.openPanelId(props.side));
const label = computed(() =>
props.side === 'left' ? t('Left panels') : t('Right panels'),
);
</script>
<template>
<UiRail
:items="items"
:active="active"
:side="side"
:label="label"
:panel-open="active !== null"
collapsible
@select="onSelect"
/>
</template>