- Nouvelle page /privacy bilingue (FR/EN) avec sélection par Accept-Language
ou ?lang=, sections complètes (données collectées, IA/BYOK, RGPD, sécurité,
contact). Style sombre aligné sur la landing (x.ai premium).
- Liens footer landing.footer.legal.* mis à jour vers /privacy dans les 15 locales.
- Extension Web Clipper rendue cross-browser :
* background.js détecte chrome.sidePanel vs browser.sidebarAction
* sidepanel.js ajoute un shim chrome<->browser pour Firefox
* manifest.json inclut sidebar_action + browser_specific_settings.gecko
+ optional_host_permissions (Chrome les ignore)
- Script scripts/build-firefox.mjs pour produire un .xpi signé pour AMO,
symétrique de build-chrome-store.mjs. Exclusion mutuelle des artefacts
Chrome/Firefox pour éviter la cross-contamination.
- Branding corrigé : 176 occurrences de 'Momento' -> 'Memento' dans le
bundle de traductions embarqué.
- Version bumpée 0.3.1 -> 0.4.0.
48 lines
1.8 KiB
JavaScript
48 lines
1.8 KiB
JavaScript
/** Helpers i18n — langue UI Chrome (chrome.i18n.getUILanguage). */
|
|
function t(key, ...subs) {
|
|
const msg = chrome.i18n.getMessage(key, subs)
|
|
return msg || key
|
|
}
|
|
|
|
function uiLocaleTag() {
|
|
return (chrome.i18n.getUILanguage() || 'en').replace('_', '-').split('-')[0]
|
|
}
|
|
|
|
function isUiRtl() {
|
|
return ['ar', 'fa', 'he', 'ur'].includes(uiLocaleTag())
|
|
}
|
|
|
|
function applyDocumentLocale() {
|
|
const lang = uiLocaleTag()
|
|
document.documentElement.lang = lang
|
|
document.documentElement.dir = isUiRtl() ? 'rtl' : 'ltr'
|
|
document.body?.classList.toggle('ui-rtl', isUiRtl())
|
|
}
|
|
|
|
function applyShellI18n() {
|
|
document.title = t('extName')
|
|
const brandSub = document.querySelector('.brand-sub')
|
|
if (brandSub) brandSub.textContent = t('webClipper')
|
|
if (typeof els !== 'undefined' && els.connLabel) {
|
|
els.connLabel.textContent = t('connected')
|
|
}
|
|
if (typeof els !== 'undefined' && els.settingsBtn) {
|
|
els.settingsBtn.title = t('instanceSettings')
|
|
els.settingsBtn.setAttribute('aria-label', t('instanceSettings'))
|
|
}
|
|
const urlLabel = document.getElementById('instanceUrlLabel') || document.querySelector('#settingsPanel .field > span')
|
|
if (urlLabel) urlLabel.textContent = t('instanceUrlLabel')
|
|
const presetProd = document.querySelector('[data-url="https://memento-note.com"]')
|
|
if (presetProd) presetProd.textContent = t('presetProduction')
|
|
if (typeof els !== 'undefined' && els.applyInstanceBtn) {
|
|
els.applyInstanceBtn.textContent = t('applyReconnect')
|
|
}
|
|
if (typeof els !== 'undefined' && els.openLoginBtn) {
|
|
els.openLoginBtn.textContent = `${t('openMomento')} ↗`
|
|
}
|
|
const hint = document.querySelector('.settings-hint')
|
|
if (hint) hint.textContent = t('settingsHint')
|
|
const footer = document.querySelector('.footer-meta')
|
|
if (footer) footer.textContent = t('footerVersion')
|
|
}
|