fix(push): localize server notifications in pt-BR

This commit is contained in:
mzspicoli committed 2026-08-24 18:02:35 +02:00
1 parent f8024d344d
commit 032fe1a348
6 files changed
+80 -11

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { dayReminderPush, restTimerPush, testPush } from './push-messages.js';
test('localizes every server-generated notification in pt-BR', () => {
assert.deepEqual(restTimerPush('pt-BR'), {
title: 'Descanso terminado 💪',
body: 'Hora da próxima série.',
tag: 'rest-timer',
});
assert.deepEqual(testPush('pt-BR'), {
title: 'openGym',
body: 'Notificação de teste ✅ — é assim que os alertas aparecem.',
tag: 'test',
});
assert.deepEqual(dayReminderPush('pt-BR', { name: 'Treino A', emoji: '💪' }), {
title: '💪 Treino A hoje',
body: 'Está no seu plano — vamos treinar 💪',
tag: 'day-reminder',
});
});
test('keeps the existing English copy as the fallback', () => {
assert.deepEqual(restTimerPush('fr'), restTimerPush('en'));
assert.equal(dayReminderPush('unknown', null).title, 'Workout planned today');
assert.equal(testPush(undefined).body, 'Test notification ✅ — this is what alerts look like.');
});