mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(i18n): fix Russian layouts and the gaps the screenshot review found
A review of the Russian UI screenshots found ~90 places where longer words
broke the layout or text was still English. Fixed so they hold for any
language, then shortened where a control is short by design.
- Layout: label columns that size to their text (weather and wind settings,
Recent Imagery slots and opacity, style sliders, display panel), layer
list names and icons, buttons that wrap instead of overflowing (CCTV,
scenes, Bhote Koshi), voice header that always shows the cost, styled
EN | ES | RU chips, voice error tray above the dock.
- t() context: t('CLEAR', { context: 'action' }) is «СБРОСИТЬ» while the sky
stays «ЯСНО»; also used for radio categories, voice states and directions.
- Units and dates follow the locale through src/ui/unitLabels.js
(formatQuantity: localized number, translated unit, non-breaking space):
wind, pressure, cyclones, directions, CCTV, SDR gain, scene timing, flight
tooltip, Recent Imagery dates and resolution.
- Newly translated: directions turn-by-turn steps (built from the maneuver;
English matches the server word for word), HUD mode and summary, voice
card states, radio categories on the globe, CCTV status, layer source
lines, scene dialogs (Cancel, file pickers), Bhote Koshi statuses, titles,
comparison dates and caveat, Recent Imagery notices. Stored data and text
for AI tools stay English.
- es and ru: 1,885 messages each.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3129e531e6
commit
2b6ccad732
71 files changed
+2435
-370
No files matched your search
@@ -17,7 +17,7 @@ test('the NEAR bound is metro scale, not continental', () => {
|
||||
|
||||
test('a landmark under the camera reads NEAR', () => {
|
||||
assert.equal(
|
||||
composeLocalityTag({ ...ALCATRAZ, distKm: 2.4 }, 37.8267, -122.4230),
|
||||
composeLocalityTag({ ...ALCATRAZ, distKm: 2.4 }, 37.8267, -122.423),
|
||||
'NEAR ALCATRAZ ISLAND (SAN FRANCISCO) 2KM',
|
||||
);
|
||||
assert.equal(
|
||||
@@ -40,20 +40,42 @@ test('the field failures now fall through to the SECTOR readout', () => {
|
||||
});
|
||||
|
||||
test('the boundary is pinned on both sides, inclusive at the bound', () => {
|
||||
const at = composeLocalityTag({ ...LINCOLN, distKm: NEAR_POI_MAX_KM }, 40, -78);
|
||||
assert.match(at, /^NEAR LINCOLN MEMORIAL/, 'exactly at the bound still reads NEAR');
|
||||
const at = composeLocalityTag(
|
||||
{ ...LINCOLN, distKm: NEAR_POI_MAX_KM },
|
||||
40,
|
||||
-78,
|
||||
);
|
||||
assert.match(
|
||||
at,
|
||||
/^NEAR LINCOLN MEMORIAL/,
|
||||
'exactly at the bound still reads NEAR',
|
||||
);
|
||||
|
||||
const just_under = composeLocalityTag({ ...LINCOLN, distKm: NEAR_POI_MAX_KM - 0.1 }, 40, -78);
|
||||
const just_under = composeLocalityTag(
|
||||
{ ...LINCOLN, distKm: NEAR_POI_MAX_KM - 0.1 },
|
||||
40,
|
||||
-78,
|
||||
);
|
||||
assert.match(just_under, /^NEAR LINCOLN MEMORIAL/);
|
||||
|
||||
const just_over = composeLocalityTag({ ...LINCOLN, distKm: NEAR_POI_MAX_KM + 0.1 }, 40, -78);
|
||||
const just_over = composeLocalityTag(
|
||||
{ ...LINCOLN, distKm: NEAR_POI_MAX_KM + 0.1 },
|
||||
40,
|
||||
-78,
|
||||
);
|
||||
assert.match(just_over, /^SECTOR /, 'one step past the bound falls through');
|
||||
});
|
||||
|
||||
test('southern and western hemispheres carry the right suffixes', () => {
|
||||
// Rio and Honolulu — the two the fallback already handled correctly in the field.
|
||||
assert.equal(composeLocalityTag(null, -22.9068, -43.1729), 'SECTOR 22.91S 43.17W');
|
||||
assert.equal(composeLocalityTag(null, 21.3069, -157.8583), 'SECTOR 21.31N 157.86W');
|
||||
assert.equal(
|
||||
composeLocalityTag(null, -22.9068, -43.1729),
|
||||
'SECTOR 22.91S 43.17W',
|
||||
);
|
||||
assert.equal(
|
||||
composeLocalityTag(null, 21.3069, -157.8583),
|
||||
'SECTOR 21.31N 157.86W',
|
||||
);
|
||||
});
|
||||
|
||||
// The tests above all pass against a hud.js that still computes the tag inline —
|
||||
@@ -72,7 +94,9 @@ test('hud.js actually composes its summary through this helper', () => {
|
||||
'hud.js must import composeLocalityTag from ./hudLocality.js',
|
||||
);
|
||||
assert.equal(
|
||||
has(/const localityTag = composeLocalityTag\(nearest, m\.latDeg, m\.lonDeg\);/),
|
||||
has(
|
||||
/const localityTag = composeLocalityTag\(\s*nearest,\s*m\.latDeg,\s*m\.lonDeg,\s*LOCALIZED_LOCALITY,?\s*\);/,
|
||||
),
|
||||
true,
|
||||
'_composeSummary must build its locality tag through composeLocalityTag()',
|
||||
);
|
||||
@@ -91,6 +115,24 @@ test('hud.js actually composes its summary through this helper', () => {
|
||||
test('a missing or malformed nearest POI never crashes the summary', () => {
|
||||
assert.match(composeLocalityTag(null, 0, 0), /^SECTOR /);
|
||||
assert.match(composeLocalityTag(undefined, 0, 0), /^SECTOR /);
|
||||
assert.match(composeLocalityTag({ ...LINCOLN, distKm: NaN }, 10, 10), /^SECTOR /);
|
||||
assert.match(
|
||||
composeLocalityTag({ ...LINCOLN, distKm: NaN }, 10, 10),
|
||||
/^SECTOR /,
|
||||
);
|
||||
assert.match(composeLocalityTag({ ...LINCOLN }, 10, 10), /^SECTOR /);
|
||||
});
|
||||
|
||||
test('a formatter builds the line from the same parts', () => {
|
||||
const format = {
|
||||
near: ({ poi, city, distKm }) => `near:${poi}|${city}|${distKm}`,
|
||||
sector: ({ latDeg, lonDeg }) => `sector:${latDeg}|${lonDeg}`,
|
||||
};
|
||||
assert.equal(
|
||||
composeLocalityTag({ ...ALCATRAZ, distKm: 2.4 }, 37.8, -122.4, format),
|
||||
'near:ALCATRAZ ISLAND|SAN FRANCISCO|2.4',
|
||||
);
|
||||
assert.equal(
|
||||
composeLocalityTag(null, 21.3, -157.8, format),
|
||||
'sector:21.3|-157.8',
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user