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.
This commit is contained in:
@@ -3,8 +3,20 @@
|
||||
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} - ${data.message}`;
|
||||
const footerText = `${data.date} - ${data.version} - ${message}`;
|
||||
document.getElementById('footer-text').textContent = footerText;
|
||||
} else {
|
||||
document.getElementById('footer-text').textContent = '';
|
||||
|
||||
Reference in New Issue
Block a user