Tweak navbar blur and admin i18n

This commit is contained in:
Mathieu Moran
2026-02-01 20:56:25 -05:00
parent e0886f2c8a
commit e8745ed88d
5 changed files with 30 additions and 6 deletions
+8 -2
View File
@@ -155,7 +155,8 @@ window.addEventListener('DOMContentLoaded', async function () {
}
const DEFAULT_COMPLETION_MODAL = Object.freeze({
title: (window.i18n && typeof window.i18n.t === 'function') ? window.i18n.t('checklist.congratulations') : 'Congratulations! very nice 🎉🎉🎉',
// Default title: use the localized 100% modal title if available.
title: t('admin.modal100.defaultTitle', 'Congratulations! very nice 🎉🎉🎉'),
bodyText: '',
videoSrc: 'video/reward.mp4',
bodyHtml: ''
@@ -194,7 +195,12 @@ window.addEventListener('DOMContentLoaded', async function () {
const videoEl = document.getElementById('rewardVideo');
const videoSourceEl = document.getElementById('rewardVideoSource');
const title = String(content?.title || '').trim() || DEFAULT_COMPLETION_MODAL.title;
const rawTitle = String(content?.title || '').trim();
// If the stored value is the i18n key itself, translate it; otherwise
// use the stored title, falling back to the localized default.
const title = (!rawTitle || rawTitle === 'admin.modal100.defaultTitle')
? t('admin.modal100.defaultTitle', 'Congratulations! very nice 🎉🎉🎉')
: rawTitle;
const bodyText = String(content?.bodyText || '');
const bodyHtml = sanitizeHtml(String(content?.bodyHtml || ''));
const videoSrc = String(content?.videoSrc || '').trim();
+2 -1
View File
@@ -1637,7 +1637,8 @@ window.onload = async function () {
if (!dbBackupListBody) return;
const list = Array.isArray(backups) ? backups : [];
if (!list.length) {
dbBackupListBody.innerHTML = '<tr><td colspan="4" class="text-muted">Aucune sauvegarde.</td></tr>';
const emptyText = t('admin.backup.noBackups', 'No backups found.');
dbBackupListBody.innerHTML = `<tr><td colspan="4" class="text-muted">${emptyText}</td></tr>`;
return;
}