Add German translation

Series of Tubes now speaks German. site/i18n/de.js translates all 3,063
labels in informal "du". Networking terms that German engineers say in
English stay English (Peering, Transit, Dark Fiber, Wave, Port, POP, IX,
Route Server, LAG, PNI and so on); plain "fiber" is "Glasfaser" and
"fiber pair" is "Faserpaar". RouteScript syntax stays English, as in the
other languages.

German is registered in the language list and the offline cache, so a
German browser starts in German. Every per-language test now covers it,
and the German style notes are in the add-strings skill and in the
dictionary header.
This commit is contained in:
Luca 2026-10-28 11:41:57 +00:00
parent 8e36b22351
commit 1a0a70e575
No known key found for this signature in database
13 changed files with 3099 additions and 10 deletions

View file

@ -46,7 +46,7 @@ test('a home that cannot work is refused, and the game falls back to Frankfurt',
});
test('the sixth tile works on a phone and in every language', () => {
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) {
const { ev, errors } = load(lang === 'en' ? {} : { lang });
ev('window.innerWidth=360;showTitle()');
assert.equal(ev("document.querySelector('label.start.own b').textContent"), ev("tr('title.anywhere_else')"), lang);

View file

@ -63,6 +63,8 @@ test('the game starts in English unless the player or the browser asks for anoth
assert.equal(load({ navigatorLanguage: 'pt-BR' }).ev('SOT_LANG'), 'pt', 'a Brazilian browser asks for Portuguese');
assert.equal(load({ navigatorLanguage: 'fr-FR' }).ev('SOT_LANG'), 'fr', 'a French browser asks for French');
assert.equal(load({ navigatorLanguage: 'es-ES' }).ev('SOT_LANG'), 'es', 'a Spanish browser asks for Spanish');
assert.equal(load({ navigatorLanguage: 'de-DE' }).ev('SOT_LANG'), 'de', 'a German browser asks for German');
assert.equal(load({ navigatorLanguage: 'de-CH' }).ev('SOT_LANG'), 'de', 'so does a Swiss German one');
const it = load({ lang: 'it' });
assert.equal(it.ev('LANG'), 'it');
assert.equal(it.ev('document.documentElement.lang'), 'it');
@ -134,7 +136,7 @@ test('a scenario started in English shows its Italian name after switching', ()
assert.ok(ev("document.getElementById('hAsn').textContent").includes(name));
});
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) {
test(`${lang}: every screen, failure and event renders without errors or unfilled placeholders`, () => {
const { ev, errors } = load(lang === 'en' ? {} : { lang });
seed(ev, 3);
@ -151,6 +153,14 @@ for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
assert.match(ev("document.getElementById('modalCard').textContent"), /Cómo jugar/);
assert.equal(ev("document.querySelector('#hud [data-act=bank] .lbl').textContent"), 'Caja · Banco');
}
if (lang === 'de') {
assert.match(ev("document.getElementById('modalCard').textContent"), /Spielanleitung/);
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');
assert.equal(ev("tr('common.dark_fiber')"), 'Dark Fiber');
assert.equal(ev("tr('common.terrestrial_fiber')"), 'Terrestrische Glasfaser');
}
const { thrown, leaks } = tour(ev);
assert.ok(ev('(S.stats.f||{}).anchor'), 'Baltic and Red Sea anchors count for the badge in every language');
assert.deepEqual(thrown, []);

View file

@ -6,7 +6,7 @@ const pick = (ev, id) => JSON.parse(ev(`(()=>{const s=document.getElementById('$
opts:[...s.options].map(o=>[o.value,o.textContent,o.lang]),label:(document.querySelector('label[for=${id}]')||{}).textContent});})()`));
test('language is one dropdown on the title screen and in Settings, in every language, with the current one selected', () => {
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) {
const { ev, errors } = load(lang === 'en' ? {} : { lang });
const langs = JSON.parse(ev('JSON.stringify(Object.entries(LANGS))'));
const title = pick(ev, 'langTitle');

View file

@ -390,7 +390,7 @@ test('DKNOG in Copenhagen is on the conference calendar', () => {
});
test('the Signal group is linked from the title screen, the menu and How to play, in every language', () => {
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) {
const { ev, errors } = load(lang === 'en' ? {} : { lang });
const links = (setup) => ev(`(()=>{${setup};return [...document.querySelectorAll('#modal a[href^="https://signal.group/#"]')].map(a=>a.target+'|'+a.rel+'|'+a.textContent.trim()).join('\\n');})()`);
const title = links('showTitle()');

View file

@ -43,7 +43,7 @@ test('Rackstar serves cacheable Crowdflare traffic locally and overflow uses tra
});
test('Rackstar boxes survive save migration and appear on phone peering panels in every language', () => {
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) {
const { dom, ev, errors } = load(lang === 'en' ? {} : { lang });
setup(ev);
ev('window.matchMedia=()=>({matches:true})');

View file

@ -5,7 +5,7 @@ const { load } = require('./harness');
const ISSUES = 'https://github.com/fjaeckel/seriesoftubes/issues/new/choose';
test('bugs and ideas point to GitHub from the menu and How to play, and the chat no longer asks for bug reports', () => {
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
for (const lang of ['en', 'it', 'pt', 'fr', 'es', 'de']) {
const { ev, errors } = load(lang === 'en' ? {} : { lang });
ev('ACT.start({})');
for (const [where, setup] of [['menu', 'ACT.menu()'], ['help', 'showHelp()']]) {