From be63e3df67bafcc90a4fc06817c31983b62c0318 Mon Sep 17 00:00:00 2001 From: Frederic Jung Date: Thu, 29 Oct 2026 18:01:27 +0100 Subject: [PATCH] Title: a hidden label for the language picker; the How the Internet Works card is checked in How to play --- src/game/95-modals/40-title.js | 2 +- tests/i18n.test.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/95-modals/40-title.js b/src/game/95-modals/40-title.js index e1b7c1f..49bd5ea 100644 --- a/src/game/95-modals/40-title.js +++ b/src/game/95-modals/40-title.js @@ -12,7 +12,7 @@ const homeWhat=()=>START5.includes(UI.startCity)?esc(START_D()[UI.startCity]):`$ function showTitle(){ const list=slotIdx(true),top=slotTop(list),many=list.length>1||(list.length===1&&list[0]!==top); if(UI.nm==null)UI.nm=randomNetworkName(); - openModal(`
${langPick('langTitle')}
+ openModal(`
${langPick('langTitle')}

Series
of Tubes

${tr('title.build_an_internet_lay_fiber_between')}

${isPhone()?installRow():''} ${top?`
${btn(tr('title.continue_name_date',{name:esc(top.name||tr('common.unnamed_network')),date:dateStr(top.day)}),'cont',{id:top.id},'pink big')}
`:''} diff --git a/tests/i18n.test.js b/tests/i18n.test.js index 8c5480c..08b4f74 100644 --- a/tests/i18n.test.js +++ b/tests/i18n.test.js @@ -155,8 +155,9 @@ for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) { } if (lang === 'de') { assert.match(ev("document.getElementById('modalCard').textContent"), /Spielanleitung/); - // the link card to the real "How the Internet Works" site used to be hard-coded English - assert.match(ev("document.getElementById('modalCard').textContent"), /Wie funktioniert das Internet\?/); + // the link card to the real "How the Internet Works" site used to be hard-coded English; it lives in How to play + assert.match(ev("(()=>{showHelp&&showHelp();return document.getElementById('modalCard').textContent})()"), /Wie funktioniert das Internet\?/); + ev("showTitle()"); assert.equal(ev("document.querySelector('#hud [data-act=bank] .lbl').textContent"), 'Kasse ยท Bank'); // networking jargon stays English in German (Peering, Dark Fiber); plain "fiber" is Glasfaser assert.equal(ev("tr('common.peering')"), 'Peering');