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]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-14 15:31:33 -08:00
1 parent 493e76401e
commit 5383b470ee
19 files changed
+184 -28

No files matched your search

+9 -3
View File
@@ -23,6 +23,12 @@ const { view, models3d, parameters, cockpitPortal } = storeToRefs(display);
// A control's change goes to its owner (DisplayBindings).
const act = (name, ...args) => display.act(name, ...args);
const pct = (value) => `${value}%`;
// The words of the on/off pill each card header draws (visual-panel.css), as
// CSS strings.
const pillWords = computed(() => ({
'--pp-pill-on': JSON.stringify(t('ON')),
'--pp-pill-off': JSON.stringify(t('OFF')),
}));
const hud = computed(() => view.value?.hud ?? null);
const sonar = computed(() => view.value?.sonar ?? null);
const sonarOn = computed(() => sonar.value?.enabled ?? true);
@@ -54,12 +60,12 @@ const allocationOptions = computed(() => [
<!-- Post-processing toggles (top-right) -->
<div id="pp-toggles" v-panel-state="'pp-toggles'" class="panel-collapsible collapsed ui-scroll" data-panel-id="pp-toggles">
<div class="compact pp-header-row">
<span class="pp-header-label">{{ t('VISUAL') }}</span>
<span class="pp-header-label">{{ t('VISUAL', { context: 'panel' }) }}</span>
<span class="panel-divider" aria-hidden="true"></span>
<UiPanelEdge />
<PanelCollapseButton class="pp-collapse-btn" target="pp-toggles" :name="t('VISUAL')" sideways start-collapsed />
<PanelCollapseButton class="pp-collapse-btn" target="pp-toggles" :name="t('VISUAL', { context: 'panel' })" sideways start-collapsed />
</div>
<div class="pp-panel-body ui-scroll" data-rail-scroller>
<div class="pp-panel-body ui-scroll" data-rail-scroller :style="pillWords">
<VisualPresets />
<!-- Cockpit shows these four groups in its Display popover: each teleports to the slot the Cockpit display portal publishes. While disabled a Teleport stays in place; its 'body' target only keeps server rendering from dropping it. -->
<p class="pp-section-heading">{{ t('Overlay') }}</p>
+44 -7
View File
@@ -1,6 +1,6 @@
<script setup>
import { storeToRefs } from 'pinia';
import { t } from '../../../i18n/index.js';
import { msg, t } from '../../../i18n/index.js';
import UiButton from '../../kit/UiButton.vue';
import { useDisplayStore } from '../../stores/display.js';
@@ -11,12 +11,48 @@ const display = useDisplayStore();
const { style, mapSource, mapSourceControls } = storeToRefs(display);
const STYLES = [
{ name: 'normal', icon: '◯', label: 'Normal', key: '1' },
{ name: 'retro', icon: '▦', label: 'CRT', key: '2' },
{ name: 'surveillance', icon: '🌙', label: 'NVG', key: '3' },
{ name: 'thermal', icon: '🌡️', label: 'FLIR', key: '4' },
{ name: 'anime', icon: '✦', label: 'Anime', key: '5' },
{ name: 'noir', icon: '◐', label: 'Noir', key: '6' },
{
name: 'normal',
icon: '◯',
label: msg('Normal'),
key: '1',
title: msg('Show the globe without a visual filter.'),
},
{
name: 'retro',
icon: '▦',
label: msg('CRT'),
key: '2',
title: msg('Emulate a green phosphor CRT with scanlines and screen curvature.'),
},
{
name: 'surveillance',
icon: '🌙',
label: msg('NVG'),
key: '3',
title: msg('Simulate night-vision goggles with green intensification and a tube vignette.'),
},
{
name: 'thermal',
icon: '🌡️',
label: msg('FLIR'),
key: '4',
title: msg('Simulate FLIR-style thermal contrast. Turn up Ironbow for color.'),
},
{
name: 'anime',
icon: '✦',
label: msg('Anime'),
key: '5',
title: msg('Apply bright cel-shaded color and illustrated outlines.'),
},
{
name: 'noir',
icon: '◐',
label: msg('Noir'),
key: '6',
title: msg('Apply high-contrast monochrome film-noir grading.'),
},
];
function selectMapSource(chip) {
@@ -36,6 +72,7 @@ function selectMapSource(chip) {
:pressed="(style?.name ?? 'normal') === preset.name"
pressed-class="active"
:data-style="preset.name"
:title="t(preset.title)"
@click="display.act('setStyle', preset.name)"
>
<span class="visual-presets__icon" aria-hidden="true">{{ preset.icon }}</span>