Add Portuguese (Brazil) translation

Adds site/i18n/pt.js with all 2429 strings, registers Português in the
language list (picked automatically for pt-* browsers), caches it in the
service worker, and runs the full screen tour in Portuguese in the tests.
This commit is contained in:
clayberF 2026-10-25 19:58:05 -03:00
parent 388b12d901
commit eb7f4a8f8c
7 changed files with 2441 additions and 4 deletions

View file

@ -58,6 +58,7 @@ function tour(ev) {
test('the game starts in English unless the player or the browser asks for another language', () => {
assert.equal(load().ev('LANG'), 'en');
assert.equal(load({ navigatorLanguage: 'it-IT' }).ev('SOT_LANG'), 'it', 'an Italian browser asks for Italian');
assert.equal(load({ navigatorLanguage: 'pt-BR' }).ev('SOT_LANG'), 'pt', 'a Brazilian browser asks for Portuguese');
const it = load({ lang: 'it' });
assert.equal(it.ev('LANG'), 'it');
assert.equal(it.ev('document.documentElement.lang'), 'it');
@ -106,7 +107,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']) {
for (const lang of ['en', 'it', 'pt']) {
test(`${lang}: every screen, failure and event renders without errors or unfilled placeholders`, () => {
const { ev, errors } = load(lang === 'en' ? {} : { lang });
seed(ev, 3);