Files
gods-eye-view/src/layers/cctv/presentation.test.mjs
T
German KhokhlovandClaude Opus 5.5 4048535921 i18n(pt): apply review round 3
Three-model review (astra, sol, fable), round 3: 17 of 18 findings
applied (some in own wording, one in part); "Missões espac." rejected.

- pt: layer cards «{label}: camada ativada/desativada», pointer and
  Directions toasts name «A ferramenta "{owner}"», counters after a
  colon where the count can be 1, traffic «sem dados de fluxo» and
  «Fluxo: {percent}% cob», «limite de requisições atingido», FECHAR,
  ANT., PREDEF. VISUAIS, quoted "Nível da rua", infinitive tooltips,
  and more (see docs/translations/pt.md).
- CCTV summary line localizes its CAL, SRC and CONTEXT values through
  existing catalog keys (all locales); codes stay underneath.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 22:40:38 +04:00

39 lines
1.2 KiB
JavaScript

// The CCTV summary line names the CAL badge, the source kind and the view
// band in the page language; unknown codes stay as uppercase codes.
import assert from 'node:assert/strict';
import test from 'node:test';
import { setLocale } from '../../i18n/index.js';
import {
summaryCalLabel,
summarySourceLabel,
summaryViewBandLabel,
} from './presentation.js';
function inLocale(locale, run) {
setLocale(locale);
try {
return run();
} finally {
setLocale('en');
}
}
test('English keeps the summary codes', () => {
assert.equal(summaryCalLabel('raw-prior'), 'RAW PRIOR');
assert.equal(summarySourceLabel('image'), 'IMAGE');
assert.equal(summarySourceLabel('hls'), 'HLS');
assert.equal(summaryViewBandLabel('street'), 'STREET');
assert.equal(summaryViewBandLabel('none'), 'NONE');
});
test('Portuguese summary values are translated', () => {
inLocale('pt', () => {
assert.equal(summaryCalLabel('raw-prior'), 'ESTIMATIVA BRUTA');
assert.equal(summaryCalLabel('calibrated'), 'CALIBRADA');
assert.equal(summarySourceLabel('IMAGE'), 'IMAGEM');
assert.equal(summarySourceLabel('mjpeg'), 'MJPEG');
assert.equal(summaryViewBandLabel('street'), 'RUA');
assert.equal(summaryViewBandLabel('city'), 'CIDADE');
});
});