mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
fix(i18n): translate mapped-site feedback by its shape where it is shown
Add the Mapped Installations feedback shapes (site counts in view or around the contact, and the Overpass retry lines) to statusText.js, and show statusMessage through translateStatusPiece in the Layers panel, the nearby-search toast and the awareness panel. The voice card's analyst notes already fall back to translateStatusLine, so they pick the shapes up too.
This commit is contained in:
1 parent
93ea088f45
commit
dddd1fa03f
6 files changed
+88
-14
No files matched your search
@@ -74,6 +74,14 @@ const transitCoverage = [
|
||||
'transit: No feed here yet · 12 regions available',
|
||||
];
|
||||
|
||||
// Mapped Installations' statusMessage (data/installationFeedback.js).
|
||||
const installationNotes = [
|
||||
'military-installations: No mapped sites in view',
|
||||
'military-installations: No mapped sites within 25 km of the contact',
|
||||
'military-installations: Overpass timed out — retrying in 30s',
|
||||
'military-installations: Zoom in to search mapped installations',
|
||||
];
|
||||
|
||||
for (const locale of ['es', 'ru']) {
|
||||
for (const [layerKey, caveat] of cases) {
|
||||
test(`${locale}: analyst note "${caveat}" is translated`, () => {
|
||||
@@ -85,6 +93,19 @@ for (const locale of ['es', 'ru']) {
|
||||
});
|
||||
}
|
||||
|
||||
test(`${locale}: Mapped Installations' empty note is translated on the analyst card`, () => {
|
||||
inLocale(locale, () => {
|
||||
for (const caveat of installationNotes) {
|
||||
const notes = notesFor('military-installations', caveat);
|
||||
assert.ok(notes.length > 0, 'the note is shown');
|
||||
assert.doesNotMatch(
|
||||
notes.join(' | '),
|
||||
/mapped sites|retrying|Overpass timed out|Zoom in/,
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test(`${locale}: Transit's empty note is translated on the analyst card`, () => {
|
||||
inLocale(locale, () => {
|
||||
for (const caveat of transitCoverage) {
|
||||
|
||||
Reference in new issue
Block a user