mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
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:
1 parent
493e76401e
commit
5383b470ee
19 files changed
+184
-28
No files matched your search
@@ -25,7 +25,9 @@ const items = computed(() =>
|
||||
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) : panel.title,
|
||||
label: item
|
||||
? t(item.label, item.context && { context: item.context })
|
||||
: panel.title,
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -9,7 +9,7 @@ export const PANEL_RAIL_FALLBACK_ICON = 'more_horiz';
|
||||
/**
|
||||
* How each side panel appears on its rail. Labels are the panels' own titles.
|
||||
* `shownBy` names a class the panel needs to be shown at all (`f` toggles
|
||||
* Data Layers' `active`).
|
||||
* Data Layers' `active`). `context` is the label's translation context.
|
||||
*/
|
||||
export const PANEL_RAIL_ITEMS = Object.freeze({
|
||||
'data-panel': {
|
||||
@@ -19,7 +19,9 @@ export const PANEL_RAIL_ITEMS = Object.freeze({
|
||||
},
|
||||
'utilities-panel': { icon: 'handyman', label: msg('UTILITIES') },
|
||||
'scene-panel': { icon: 'movie', label: msg('AUTHORING') },
|
||||
'pp-toggles': { icon: 'palette', label: msg('VISUAL') },
|
||||
// `context` keeps the panel's name apart from the satellite class of the
|
||||
// same English word.
|
||||
'pp-toggles': { icon: 'palette', label: msg('VISUAL'), context: 'panel' },
|
||||
'cctv-panel': { icon: 'videocam', label: msg('CCTV') },
|
||||
'weather-panel': { icon: 'partly_cloudy_day', label: msg('WEATHER') },
|
||||
'news-panel': { icon: 'public', label: msg('NEWS') },
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
checkbox, which already says it). */
|
||||
#pp-toggles .pp-toggle-group > button.pp-toggle-btn::after,
|
||||
#pp-toggles .pp-panel-body > button.pp-toggle-btn::after {
|
||||
content: 'OFF';
|
||||
content: var(--pp-pill-off, 'OFF');
|
||||
margin-inline-start: auto;
|
||||
padding: 2px 8px;
|
||||
color: rgba(199, 214, 222, 0.5);
|
||||
@@ -216,7 +216,7 @@
|
||||
#pp-toggles .pp-toggle-group > button.pp-toggle-btn.active::after,
|
||||
#pp-toggles .pp-toggle-group > button.pp-toggle-btn[aria-pressed='true']::after,
|
||||
#pp-toggles .pp-panel-body > button.pp-toggle-btn.active::after {
|
||||
content: 'ON';
|
||||
content: var(--pp-pill-on, 'ON');
|
||||
color: #7af0ff;
|
||||
border-color: rgba(54, 220, 255, 0.5);
|
||||
background: rgba(54, 220, 255, 0.1);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user