mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 01:27:11 +00:00
fix(i18n): rebuild broken de/es/fr JSON + fix meta key lookup (Issue #86)
- de.json, es.json, fr.json had multiple missing commas and broken JSON structure causing 'Failed to load language' errors on startup - Rebuilt all 3 files using en.json as structural template, preserving existing translations (de: 2145, es: 2245, fr: 2242 keys preserved) - languages.routes.js: read both 'meta' and '_meta' keys (some files use 'meta', others '_meta') to correctly display language names
This commit is contained in:
+315
-331
File diff suppressed because it is too large
Load Diff
+339
-472
File diff suppressed because it is too large
Load Diff
+334
-467
File diff suppressed because it is too large
Load Diff
@@ -87,12 +87,12 @@ router.get('/api/panel/languages', requireAuth, requireAdmin, (req, res) => {
|
||||
continue;
|
||||
}
|
||||
|
||||
const meta = data._meta || {};
|
||||
const meta = data._meta || data.meta || {};
|
||||
const langKeys = flattenKeys(data);
|
||||
const langKeySet = new Set(langKeys.keys());
|
||||
|
||||
const missing = [...refKeySet].filter(k => !langKeySet.has(k));
|
||||
const extra = [...langKeySet].filter(k => !refKeySet.has(k) && !k.startsWith('_meta'));
|
||||
const extra = [...langKeySet].filter(k => !refKeySet.has(k) && !k.startsWith('_meta') && !k.startsWith('meta.'));
|
||||
const empty = [...langKeySet].filter(k => refKeySet.has(k) && langKeys.get(k) === '');
|
||||
|
||||
const coverage = code === 'en' ? 100
|
||||
|
||||
Reference in New Issue
Block a user