All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
- Sidebar: dynamic brand-accent colors, brainstorm section restyled - AI chat general: popup panel with expand/collapse, hides when contextual AI open - AI chat contextual: tabs reordered (Actions first), X close button, height fix - Settings: all tabs restyled, 6 new color presets (sage, terracotta, iron, etc.) - Global color cleanup: emerald/orange hardcoded → brand-accent dynamic - Brainstorm page: orange → brand-accent throughout - PageEntry animation component added to key pages - Floating AI button: bg-brand-accent instead of hardcoded black - i18n: all 15 locales updated with new AI/billing keys - Billing: freemium quota tracking, BYOK, stripe subscription scaffolding - Admin: integrated into new design - AGENTS.md + CLAUDE.md project rules added
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
/**
|
|
* Ajoute récursivement les clés présentes dans locales/en.json mais absentes
|
|
* des autres fichiers (valeur = texte anglais, à retraduire si besoin).
|
|
* Usage: node scripts/merge-missing-locale-keys.mjs
|
|
*/
|
|
import fs from 'fs'
|
|
import path from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
const localesDir = path.join(__dirname, '..', 'locales')
|
|
const enPath = path.join(localesDir, 'en.json')
|
|
|
|
function mergeMissing(target, source) {
|
|
for (const [k, v] of Object.entries(source)) {
|
|
if (v !== null && typeof v === 'object' && !Array.isArray(v)) {
|
|
if (!target[k] || typeof target[k] !== 'object' || Array.isArray(target[k])) {
|
|
target[k] = {}
|
|
}
|
|
mergeMissing(target[k], v)
|
|
} else {
|
|
if (!(k in target)) target[k] = v
|
|
}
|
|
}
|
|
}
|
|
|
|
const en = JSON.parse(fs.readFileSync(enPath, 'utf8'))
|
|
for (const name of fs.readdirSync(localesDir)) {
|
|
if (!name.endsWith('.json') || name === 'en.json') continue
|
|
const p = path.join(localesDir, name)
|
|
const loc = JSON.parse(fs.readFileSync(p, 'utf8'))
|
|
mergeMissing(loc, en)
|
|
fs.writeFileSync(p, JSON.stringify(loc, null, 2) + '\n')
|
|
}
|
|
console.log('merge-missing-locale-keys: OK')
|