Translations keyed by labels instead of English text
tr('pnis.delivery_2_to_6_weeks') instead of tr('Delivery: 2 to 6 weeks'): the
English lives once, in src/i18n/en.js (inlined into the page at build, so no
extra request), and it/pt/fr map the same labels. Changing English wording no
longer renames a key in every dictionary.
- 2,899 labels, made from where each text is used and its first words; short
shared words are common.*
- plurals are one label with {one, other}: trn('label', n)
- static markup: data-i18n="label", data-i18n-aria-label, data-i18n-title
- saves from 1.33 and older stored English text in a few places; tr() still
resolves it
- i18n-check: undefined/unused labels, markup drift, plural shape; i18n-add.js
works on labels and --rename updates src/ too
- the old-branch port tool gives old English-keyed code and dictionaries the
same labels
This commit is contained in:
parent
d0ba85ef8f
commit
e817beed1a
94 changed files with 13681 additions and 10633 deletions
|
|
@ -91,8 +91,8 @@
|
|||
</head>
|
||||
<body>
|
||||
<header class="sr-only">
|
||||
<h1 data-i18n>Series of Tubes: build the internet, one tube at a time</h1>
|
||||
<p data-i18n>A free cartoon browser game about how the internet works. Start as a tiny network in one city, launch home broadband, buy IP transit from Tier 1 and Tier 2 carriers, peer at internet exchanges, set up private interconnects and embedded CDN caches, and lay terrestrial fiber, subsea waves and your own dark fiber with DWDM and ZR optics. Sign enterprise, hosting, high-frequency trading, AI GPU and hyperscaler customers, and keep them happy while backhoes, sharks, fat fingers, route leaks, DDoS attacks and geopolitics break things.</p>
|
||||
<h1 data-i18n="page.series_of_tubes_build_the_internet">Series of Tubes: build the internet, one tube at a time</h1>
|
||||
<p data-i18n="page.a_free_cartoon_browser_game_about">A free cartoon browser game about how the internet works. Start as a tiny network in one city, launch home broadband, buy IP transit from Tier 1 and Tier 2 carriers, peer at internet exchanges, set up private interconnects and embedded CDN caches, and lay terrestrial fiber, subsea waves and your own dark fiber with DWDM and ZR optics. Sign enterprise, hosting, high-frequency trading, AI GPU and hyperscaler customers, and keep them happy while backhoes, sharks, fat fingers, route leaks, DDoS attacks and geopolitics break things.</p>
|
||||
</header>
|
||||
<noscript>
|
||||
<div style="max-width:640px;margin:40px auto;padding:0 16px;font:16px/1.5 system-ui,sans-serif;color:#1E2640;background:#fff">
|
||||
|
|
@ -101,32 +101,32 @@
|
|||
<p><a href="https://github.com/fjaeckel/seriesoftubes">Source code on GitHub</a></p>
|
||||
</div>
|
||||
</noscript>
|
||||
<canvas id="map" aria-label="World map of your network"></canvas>
|
||||
<canvas id="map" aria-label="World map of your network" data-i18n-aria-label="page.world_map_of_your_network"></canvas>
|
||||
|
||||
<header id="hud">
|
||||
<button class="chip brand menubtn" data-act="menu" aria-label="Network menu: save, load or start over">
|
||||
<button class="chip brand menubtn" data-act="menu" aria-label="Network menu: save, load or start over" data-i18n-aria-label="page.network_menu_save_load_or_start">
|
||||
<svg class="tube" viewBox="0 0 32 32" aria-hidden="true"><path d="M4 22c0-7 5-12 12-12h6" fill="none" stroke="#1E2640" stroke-width="7" stroke-linecap="round"/><path d="M4 22c0-7 5-12 12-12h6" fill="none" stroke="#FFD23F" stroke-width="3.5" stroke-linecap="round"/><circle cx="25" cy="10" r="5" fill="#fff" stroke="#1E2640" stroke-width="2.5"/></svg>
|
||||
<div><div class="val" id="hName">Series of Tubes</div><div class="lbl" id="hAsn">AS —</div></div><span class="caret" aria-hidden="true">▾</span>
|
||||
</button>
|
||||
<button class="chip cashbtn" data-act="bank" aria-label="Cash and bank"><span class="lbl" data-i18n>Cash · Bank</span><span class="val num" id="hCash">$0</span><span class="sub num" id="hRate">—</span><span class="badge" id="hBank" hidden></span></button>
|
||||
<div class="chip hide-sm hide-md2"><div class="lbl" data-i18n>Traffic served</div><div class="val num" id="hTraffic">0</div><div class="minibar"><i id="hTrafBar" style="width:0"></i></div></div>
|
||||
<div class="chip"><div class="lbl" data-i18n>Reach</div><div class="val num" id="hReach">0%</div></div>
|
||||
<div class="chip hide-sm hide-md"><div class="lbl" data-i18n>Rank</div><div class="val" id="hTier">Tier 3</div></div>
|
||||
<button class="chip scn hide-sm" id="hScn" data-act="leftTab" data-args='{"t":"goals"}' hidden><span class="lbl" data-i18n>Scenario</span><span class="val num" id="hScnVal">—</span></button>
|
||||
<button class="chip cust hide-sm" id="hCust" data-act="custOpen" hidden><span class="lbl" data-i18n>Customers</span><span class="val num" id="hCustVal">—</span></button>
|
||||
<button class="chip noc" id="hNoc" data-act="leftTab" data-args='{"t":"noc"}'><span class="lbl">NOC</span><span class="val num" id="hNocVal" data-i18n>All quiet</span><span class="badge" id="hNocNew" hidden></span></button>
|
||||
<button class="chip cashbtn" data-act="bank" aria-label="Cash and bank" data-i18n-aria-label="page.cash_and_bank"><span class="lbl" data-i18n="common.cash_bank">Cash · Bank</span><span class="val num" id="hCash">$0</span><span class="sub num" id="hRate">—</span><span class="badge" id="hBank" hidden></span></button>
|
||||
<div class="chip hide-sm hide-md2"><div class="lbl" data-i18n="common.traffic_served">Traffic served</div><div class="val num" id="hTraffic">0</div><div class="minibar"><i id="hTrafBar" style="width:0"></i></div></div>
|
||||
<div class="chip"><div class="lbl" data-i18n="common.reach">Reach</div><div class="val num" id="hReach">0%</div></div>
|
||||
<div class="chip hide-sm hide-md"><div class="lbl" data-i18n="common.rank">Rank</div><div class="val" id="hTier">Tier 3</div></div>
|
||||
<button class="chip scn hide-sm" id="hScn" data-act="leftTab" data-args='{"t":"goals"}' hidden><span class="lbl" data-i18n="common.scenario">Scenario</span><span class="val num" id="hScnVal">—</span></button>
|
||||
<button class="chip cust hide-sm" id="hCust" data-act="custOpen" hidden><span class="lbl" data-i18n="common.customers">Customers</span><span class="val num" id="hCustVal">—</span></button>
|
||||
<button class="chip noc" id="hNoc" data-act="leftTab" data-args='{"t":"noc"}'><span class="lbl">NOC</span><span class="val num" id="hNocVal" data-i18n="common.all_quiet">All quiet</span><span class="badge" id="hNocNew" hidden></span></button>
|
||||
<div class="spacer"></div>
|
||||
<div class="chip"><div class="lbl" data-i18n>Date</div><div class="val num" id="hDate">Y1 · Jan 1</div></div>
|
||||
<div class="chip speed" role="group" aria-label="Game speed">
|
||||
<button data-act="speed" data-args='{"v":0}' id="sp0" aria-label="Pause">❚❚</button>
|
||||
<button data-act="speed" data-args='{"v":0.5}' id="sp0.5" aria-label="Half speed">½×</button>
|
||||
<div class="chip"><div class="lbl" data-i18n="common.date">Date</div><div class="val num" id="hDate">Y1 · Jan 1</div></div>
|
||||
<div class="chip speed" role="group" aria-label="Game speed" data-i18n-aria-label="common.game_speed">
|
||||
<button data-act="speed" data-args='{"v":0}' id="sp0" aria-label="Pause" data-i18n-aria-label="common.pause">❚❚</button>
|
||||
<button data-act="speed" data-args='{"v":0.5}' id="sp0.5" aria-label="Half speed" data-i18n-aria-label="common.half_speed">½×</button>
|
||||
<button data-act="speed" data-args='{"v":1}' id="sp1">1×</button>
|
||||
<button data-act="speed" data-args='{"v":2}' id="sp2">2×</button>
|
||||
<button data-act="speed" data-args='{"v":4}' id="sp4">4×</button>
|
||||
<button data-act="speed" data-args='{"v":8}' id="sp8">8×</button>
|
||||
<button data-act="dash" aria-label="NOC dashboard" title="NOC dashboard"><svg width="16" height="14" viewBox="0 0 16 14" aria-hidden="true"><path d="M1 13h14M2 10l4-5 3 3 5-6" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
||||
<button data-act="help" aria-label="How to play">?</button>
|
||||
<button data-act="mute" id="muteBtn" aria-label="Toggle sound">♪</button>
|
||||
<button data-act="dash" aria-label="NOC dashboard" data-i18n-aria-label="common.noc_dashboard" title="NOC dashboard" data-i18n-title="common.noc_dashboard"><svg width="16" height="14" viewBox="0 0 16 14" aria-hidden="true"><path d="M1 13h14M2 10l4-5 3 3 5-6" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
||||
<button data-act="help" aria-label="How to play" data-i18n-aria-label="common.how_to_play">?</button>
|
||||
<button data-act="mute" id="muteBtn" aria-label="Toggle sound" data-i18n-aria-label="common.toggle_sound">♪</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
|
@ -135,8 +135,8 @@
|
|||
<nav class="tabs" id="leftTabs"></nav>
|
||||
<div class="scroll" id="leftBody"></div>
|
||||
</aside>
|
||||
<button id="leftToggle" class="b pink" data-act="toggleLeft" data-i18n>Goals & NOC</button>
|
||||
<nav id="tabbar" aria-label="Game"></nav>
|
||||
<button id="leftToggle" class="b pink" data-act="toggleLeft" data-i18n="common.goals_noc">Goals & NOC</button>
|
||||
<nav id="tabbar" aria-label="Game" data-i18n-aria-label="common.game"></nav>
|
||||
|
||||
<aside id="panel" class="card" hidden>
|
||||
<div class="grab" data-grab="panel" aria-hidden="true"></div>
|
||||
|
|
@ -146,10 +146,10 @@
|
|||
<div id="hint" hidden></div>
|
||||
<div id="coach" hidden role="status"></div>
|
||||
<div id="toasts" aria-live="polite"></div>
|
||||
<div id="mega" hidden role="alert"><div class="mtrack"><span data-i18n>🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET</span><span data-i18n>Every WordPress-ish site on Earth is now a crypto miner</span><span data-i18n><?php echo "sorry"; ?></span><span data-i18n>Eyeball traffic down 30%</span><span data-i18n>Hosting customers patching at 3 a.m.</span><span data-i18n>Security team asks: “are we on PHP?” Everyone: “define we”</span><span data-i18n>🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET</span><span data-i18n>Every WordPress-ish site on Earth is now a crypto miner</span><span data-i18n><?php echo "sorry"; ?></span><span data-i18n>Eyeball traffic down 30%</span><span data-i18n>Hosting customers patching at 3 a.m.</span><span data-i18n>Security team asks: “are we on PHP?” Everyone: “define we”</span></div></div>
|
||||
<div id="mega" hidden role="alert"><div class="mtrack"><span data-i18n="page.breaking_cve_2026_31337_in_php">🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET</span><span data-i18n="page.every_wordpress_ish_site_on_earth">Every WordPress-ish site on Earth is now a crypto miner</span><span data-i18n="page.x"><?php echo "sorry"; ?></span><span data-i18n="page.eyeball_traffic_down_30">Eyeball traffic down 30%</span><span data-i18n="page.hosting_customers_patching_at_3_a">Hosting customers patching at 3 a.m.</span><span data-i18n="page.security_team_asks_are_we_on">Security team asks: “are we on PHP?” Everyone: “define we”</span><span data-i18n="page.breaking_cve_2026_31337_in_php">🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET</span><span data-i18n="page.every_wordpress_ish_site_on_earth">Every WordPress-ish site on Earth is now a crypto miner</span><span data-i18n="page.x"><?php echo "sorry"; ?></span><span data-i18n="page.eyeball_traffic_down_30">Eyeball traffic down 30%</span><span data-i18n="page.hosting_customers_patching_at_3_a">Hosting customers patching at 3 a.m.</span><span data-i18n="page.security_team_asks_are_we_on">Security team asks: “are we on PHP?” Everyone: “define we”</span></div></div>
|
||||
<div id="update" class="toast goal" hidden role="status"></div>
|
||||
<div id="bankBox" hidden><div class="card" id="bankCard" role="dialog" aria-label="Bank"></div></div>
|
||||
<div id="dash" hidden><div class="card" id="dashCard" role="dialog" aria-label="NOC dashboard"></div></div>
|
||||
<div id="bankBox" hidden><div class="card" id="bankCard" role="dialog" aria-label="Bank" data-i18n-aria-label="common.bank"></div></div>
|
||||
<div id="dash" hidden><div class="card" id="dashCard" role="dialog" aria-label="NOC dashboard" data-i18n-aria-label="common.noc_dashboard"></div></div>
|
||||
<div id="modal" hidden><div class="card" id="modalCard" role="dialog" aria-modal="true"></div></div>
|
||||
|
||||
<script>
|
||||
|
|
@ -160,6 +160,7 @@
|
|||
</script>
|
||||
<script>
|
||||
'use strict';
|
||||
<!-- @include i18n -->
|
||||
<!-- @include game -->
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue