mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Japanese has no letter case, so the HUD summary keeps units as the
catalog writes them (13 km), matching the cockpit and the ja HUD CSS.
The ja '{value} KM', '{value} KM/H' and '{value} KM/S' strings are now
lower-case like zh-CN.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
23 lines
856 B
JavaScript
23 lines
856 B
JavaScript
import test from 'node:test';
|
||
import assert from 'node:assert/strict';
|
||
import { setLocale } from './index.js';
|
||
import { hudQuantity, LOCALIZED_LOCALITY } from '../hudLocalityFormat.js';
|
||
import { formatCockpitDistance } from '../ui/cockpitPresentation.js';
|
||
|
||
// revmain-opus-ja-i1-1: ja has no case, so HUD units keep the catalog case
|
||
// (km), as the cockpit already does and docs/translations/ja.md requires.
|
||
test('Japanese HUD units keep their case, like the cockpit', () => {
|
||
try {
|
||
setLocale('ja');
|
||
assert.equal(formatCockpitDistance(14000), '14 km');
|
||
assert.equal(hudQuantity(13, 'km'), '13 km');
|
||
assert.equal(hudQuantity(1.5, 'km', 1), '1.5 km');
|
||
assert.equal(
|
||
LOCALIZED_LOCALITY.near({ poi: 'Shibuya', city: 'Tokyo', distKm: 13 }),
|
||
'SHIBUYA(東京)付近 13 km',
|
||
);
|
||
} finally {
|
||
setLocale('en');
|
||
}
|
||
});
|