Files
oscars-pool/public/js/app_version.js
T
Mathieu Moran 4308d6babf Implement en/fr localization across admin and user UIs
Introduce client-side localization helper and en/fr locale bundles.

Route admin control, picks, movies, stats, winners and settings UIs through i18n keys instead of hardcoded text.

Remove French text from the English UI and standardize shared messages (saving, network errors, confirmations).

Update .gitignore to ignore editor metadata and localization helper artifacts.
2026-02-01 20:20:02 -05:00

28 lines
1005 B
JavaScript

// Fetch version information from the API
async function fetchVersionInfo() {
const res = await fetch('/api/version');
if (res.ok) {
const data = await res.json();
if (window.i18n && typeof window.i18n.init === 'function') {
try {
await window.i18n.init();
} catch (_) {}
}
const hasI18n = window.i18n && typeof window.i18n.t === 'function';
let message = data.message || '';
if (data && data.configured === false) {
if (hasI18n) {
message = window.i18n.t('footer.versionNotConfigured');
}
}
// Update footer with the fetched version info
const footerText = `${data.date} - ${data.version} - ${message}`;
document.getElementById('footer-text').textContent = footerText;
} else {
document.getElementById('footer-text').textContent = '';
}
}
// Call the function to fetch and display the version info
// Doesn't work on prod, will fix later
fetchVersionInfo();