Translate the rest of the Context card's facts

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-16 14:59:17 -08:00
1 parent 4554713f98
commit 4b350cb9ae
22 files changed
+2460 -316

No files matched your search

+10 -6
View File
@@ -1,6 +1,6 @@
<script setup>
import { computed, ref, watch } from 'vue';
import { t } from '../../../i18n/index.js';
import { formatNumber, t } from '../../../i18n/index.js';
// A height as a filled graph (an aircraft's altitude, the camera's height):
// each reading since it opened, left to right. The scale fits the readings (never less than about
@@ -36,10 +36,14 @@ watch(
);
const feet = (m) => Math.round((m * 3.28084) / 100) * 100;
const number = (value) => value.toLocaleString('en-US');
const number = (value) => formatNumber(value, { maximumFractionDigits: 1 });
const metric = (m) =>
m >= 100_000 ? `${number(Math.round(m / 1000))} km` : m >= 1000 ? `${(m / 1000).toFixed(1)} km` : `${number(Math.round(m))} m`;
const shown = (m) => (props.unit === 'metric' ? metric(m) : `${number(feet(m))} ft`);
m >= 100_000
? t('{n} km', { n: number(Math.round(m / 1000)) })
: m >= 1000
? t('{n} km', { n: formatNumber(m / 1000, { minimumFractionDigits: 1, maximumFractionDigits: 1 }) })
: t('{n} m', { n: number(Math.round(m)) });
const shown = (m) => (props.unit === 'metric' ? metric(m) : t('{n} ft', { n: number(feet(m)) }));
const graph = computed(() => {
const list = readings.value;
@@ -68,7 +72,7 @@ const graph = computed(() => {
const line = points.map(([px, py], index) => `${index ? 'L' : 'M'}${px.toFixed(2)} ${py.toFixed(2)}`).join(' ');
const moved = last.m - first.m;
const change = props.unit === 'metric' ? (Math.abs(moved) >= Math.max(1, last.m * 0.005) ? moved : 0) : feet(last.m) - feet(first.m);
const changeText = props.unit === 'metric' ? metric(Math.abs(moved)) : `${number(Math.abs(change))} ft`;
const changeText = props.unit === 'metric' ? metric(Math.abs(moved)) : t('{n} ft', { n: number(Math.abs(change)) });
const minutes = Math.floor((last.at - first.at) / 60_000);
return {
line,
@@ -78,7 +82,7 @@ const graph = computed(() => {
top: shown(log ? 10 ** top : top),
bottom: shown(log ? 10 ** bottom : bottom),
trend: change > 0 ? 'up' : change < 0 ? 'down' : 'level',
change: change ? `${change > 0 ? '+' : '−'}${changeText}` : t('Level'),
change: change ? `${change > 0 ? '+' : '−'}${changeText}` : t('Level', { context: 'altitude' }),
since: minutes >= 1 ? t('Last {n} min', { n: minutes }) : props.unit === 'metric' ? t('Just now') : t('Since selected'),
};
});