mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Every data-i18n, data-i18n-title, data-i18n-aria-label and data-i18n-placeholder marker in the Vue templates becomes a t() call with the key the boot pass used to look up, contexts included. The three labels the shell rewrote at boot (Visual Presets, Location and the standby description) render through t() too, and that rewrite is gone. With the locale in vue-i18n, view text now follows a locale change, and markup under v-if or v-for no longer comes back in English when it re-renders. Rendered text and attributes are unchanged in every locale. The boot pass still translates static page markup such as the loading screen and a host's own markup, and npm run i18n rejects data-i18n* in a Vue template.
36 lines
2.2 KiB
Vue
36 lines
2.2 KiB
Vue
<script setup>
|
|
import { storeToRefs } from 'pinia';
|
|
import { computed } from 'vue';
|
|
import { t } from '../../../i18n/index.js';
|
|
import { useGlobeActionsStore } from '../../stores/globeActions.js';
|
|
import GlobeCompass from './GlobeCompass.vue';
|
|
|
|
// The top-center camera and share actions. The shell answers the buttons
|
|
// through the store and publishes a clear under way, which keeps the button
|
|
// focusable and marks it busy, and the camera's tilt and heading. The heading
|
|
// changes on every frame a rotating camera draws, so only the compass reads
|
|
// it; the bar renders again only when the tilt changes.
|
|
const globe = useGlobeActionsStore();
|
|
const { clearBusy, resetBusy, camera } = storeToRefs(globe);
|
|
const { act } = globe;
|
|
const tilted = computed(() => Boolean(camera.value?.tilted));
|
|
</script>
|
|
|
|
<template>
|
|
<nav id="top-center-actions" :aria-label="t('Globe actions')">
|
|
<button id="clear-selected-layers" type="button" :aria-label="clearBusy ? t('Clearing selected data layers') : t('Clear selected data layers')" :aria-disabled="clearBusy == null ? undefined : String(clearBusy)" :aria-busy="clearBusy == null ? undefined : String(clearBusy)" :title="t('Turn off all selected data layers')" @click="act('clear')">
|
|
<span class="material-symbols-outlined" aria-hidden="true">layers_clear</span>
|
|
</button>
|
|
<button id="share-btn" type="button" :aria-label="t('Copy share link')" :title="t('Copy share link')" @click="act('share')">
|
|
<span class="share-icon" aria-hidden="true">🔗</span>
|
|
</button>
|
|
<button id="tilt-map-view" type="button" :aria-label="tilted ? t('Return map to straight-down view') : t('Tilt map to oblique view')" :aria-pressed="String(tilted)" :title="t('Toggle straight-down and tilted map views')" @click="act('tilt')">
|
|
<span class="material-symbols-outlined" aria-hidden="true">view_in_ar</span>
|
|
</button>
|
|
<GlobeCompass @click="act('northUp')" />
|
|
<button id="reset-globe-view" type="button" :aria-label="resetBusy ? t('Resetting to full globe view') : t('Reset to full globe view')" :title="t('Reset camera and return to full globe view')" @click="act('reset')">
|
|
<span class="material-symbols-outlined" aria-hidden="true">public</span>
|
|
</button>
|
|
</nav>
|
|
</template>
|