fix(push): localize server notifications in pt-BR
This commit is contained in:
1 parent
f8024d344d
commit
032fe1a348
6 files changed
+80
-11
No files matched your search
@@ -0,0 +1,40 @@
|
||||
const COPY = {
|
||||
en: {
|
||||
restTitle: 'Rest over 💪',
|
||||
restBody: 'Time for your next set.',
|
||||
testBody: 'Test notification ✅ — this is what alerts look like.',
|
||||
dayFallbackTitle: 'Workout planned today',
|
||||
dayRoutineSuffix: 'today',
|
||||
dayBody: "It's on your plan — let's go 💪",
|
||||
},
|
||||
'pt-BR': {
|
||||
restTitle: 'Descanso terminado 💪',
|
||||
restBody: 'Hora da próxima série.',
|
||||
testBody: 'Notificação de teste ✅ — é assim que os alertas aparecem.',
|
||||
dayFallbackTitle: 'Treino planejado para hoje',
|
||||
dayRoutineSuffix: 'hoje',
|
||||
dayBody: 'Está no seu plano — vamos treinar 💪',
|
||||
},
|
||||
};
|
||||
|
||||
const copyFor = lang => COPY[lang] || COPY.en;
|
||||
|
||||
export function restTimerPush(lang) {
|
||||
const copy = copyFor(lang);
|
||||
return { title: copy.restTitle, body: copy.restBody, tag: 'rest-timer' };
|
||||
}
|
||||
|
||||
export function testPush(lang) {
|
||||
return { title: 'openGym', body: copyFor(lang).testBody, tag: 'test' };
|
||||
}
|
||||
|
||||
export function dayReminderPush(lang, routine) {
|
||||
const copy = copyFor(lang);
|
||||
return {
|
||||
title: routine
|
||||
? `${routine.emoji || '🏋️'} ${routine.name} ${copy.dayRoutineSuffix}`
|
||||
: copy.dayFallbackTitle,
|
||||
body: copy.dayBody,
|
||||
tag: 'day-reminder',
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user