mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Translate the Context panel
Marks the Context panel's remaining strings and translates them into every locale. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
902689da8a
commit
4554713f98
20 files changed
+2113
-99
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { t } from '../../../i18n/index.js';
|
||||
import { onLocaleChange, t } from '../../../i18n/index.js';
|
||||
import { compassName, hazardsNear, regionalBrief, weatherLook } from '../../spotConditions.js';
|
||||
import { distanceKm } from '../../../data/entityContext.js';
|
||||
import { CONTEXT_RADIUS_STEPS, contextRadiusKm, setContextRadiusKm } from '../../contextRadius.js';
|
||||
@@ -73,13 +73,16 @@ watch(
|
||||
{ immediate: true },
|
||||
);
|
||||
// A new radius only re-filters the hazard feeds, which are already cached.
|
||||
watch(radiusKm, async (km) => {
|
||||
async function rereadHazards(km) {
|
||||
const at = readAt || { lat: props.lat, lon: props.lon };
|
||||
const mine = ++readingHazards;
|
||||
const next = await hazardsNear(at.lat, at.lon, km).catch(() => []);
|
||||
if (readingHazards !== mine) return;
|
||||
hazards.value = next;
|
||||
});
|
||||
}
|
||||
watch(radiusKm, (km) => void rereadHazards(km));
|
||||
// Hazard rows are worded as they are read, so a new language reads them again.
|
||||
const stopLocale = onLocaleChange(() => void rereadHazards(radiusKm.value));
|
||||
|
||||
// Warnings from the loaded layers move with their records; read them often.
|
||||
const tick = ref(0);
|
||||
@@ -90,6 +93,7 @@ onMounted(() => {
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(timer);
|
||||
clearTimeout(settle);
|
||||
stopLocale();
|
||||
});
|
||||
// The Context search narrows every list below to what holds its text.
|
||||
const searching = computed(() => Boolean(contextNeedle.value));
|
||||
|
||||
Reference in new issue
Block a user