mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
i18n: plural forms and contexts the catalogs could only work around
The last translation review left four kinds of problem it could only
reword around in the catalogs. They are fixed in the code now, and the
catalogs go back to natural wording.
- Counts shown with plain t() are tn() plurals: the wildlife count, the
Data Library "Showing {shown} of {total}", the News time window (which
offers 1 h) and the GhostMaps event age (which offers 1 day). The
English keys stay; the catalogs get real forms, as in "Última 1 h" and
"Últimas 24 h", or "1 Tag" and "7 Tage".
- The bridge radar range and ring spacing are tn() plurals too. The
spacing is fractional at the short ranges, and Intl.PluralRules gives
0.75 and 1.5 their own form: ru "0,75 МОР. МИЛИ", "12 МОР. МИЛЬ".
- Street level no longer passes "the view centre" or "this spot" as
{place}: each case has a message of its own, so a preposition no
longer meets a phrase in the wrong case. The progress line had the
same leak and showed the English phrase.
- Latest, FOCUS, CONFIRMED and "{label} · COURSE {heading}°" are split
with a context where one key served two places: the News heading, the
orbital site status, the Wildlife chip and a ship's course.
"CURRENTLY OVER" ended in a preposition that a country name in the
nominative cannot follow in uk, de, it and pt. It reads "under the
satellite" there now, as ru already did.
I18N.md gains the two rules behind these fixes.
This commit is contained in:
1 parent
42540ad85e
commit
209b135ff1
37 files changed
+1124
-196
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import * as Cesium from 'cesium';
|
||||
import { setLocale } from '../../i18n/index.js';
|
||||
import { createGhostMapsLayer } from './index.js';
|
||||
import { GHOSTMAPS_PRODUCTS, GHOSTMAPS_LATEST_DROP } from './catalog.js';
|
||||
|
||||
@@ -248,6 +249,35 @@ test('age controls default to seven days and widening restores filtered and expi
|
||||
assert.equal(ageChip(layer, null).active, true);
|
||||
});
|
||||
|
||||
test('the event age agrees with its number of days', async (t) => {
|
||||
t.after(() => setLocale('en'));
|
||||
const { layer, viewer } = fixture(t, { reports: [{ name: 'Undated' }] });
|
||||
await layer.update(viewer);
|
||||
const info = () =>
|
||||
layer.getRowControls().info.split(' · ').slice(0, 2).join(' · ');
|
||||
assert.equal(
|
||||
ageChip(layer, 1).title,
|
||||
'Maximum event age: 1d; undated markers are kept',
|
||||
);
|
||||
setLocale('de');
|
||||
assert.equal(
|
||||
ageChip(layer, 1).title,
|
||||
'Maximales Ereignisalter: 1 Tag; undatierte Markierungen bleiben erhalten',
|
||||
);
|
||||
assert.equal(
|
||||
ageChip(layer, 7).title,
|
||||
'Maximales Ereignisalter: 7 Tage; undatierte Markierungen bleiben erhalten',
|
||||
);
|
||||
assert.equal(info(), 'Ereignisalter: 7 Tage · undatierte bleiben');
|
||||
await ageChip(layer, 1).onClick();
|
||||
assert.equal(info(), 'Ereignisalter: 1 Tag · undatierte bleiben');
|
||||
setLocale('es');
|
||||
assert.equal(
|
||||
info(),
|
||||
'Antigüedad: 1 día · se conservan los marcadores sin fecha',
|
||||
);
|
||||
});
|
||||
|
||||
test('age preferences persist independently of product choices and reject invalid storage', async (t) => {
|
||||
const values = new Map([['gev.ghostmaps.products', '["cip"]']]);
|
||||
const storage = {
|
||||
|
||||
Reference in new issue
Block a user