i18n: complete the other languages for the Slovak work

- Translate the new terminal and Monitor texts into es, de, fr, it, pt and sv
- Replace the machine fills of those new keys with reviewed translations
- Keep the complete terminal catalog check in CI
- Keep Machine learning in English in Spanish
- Fix the German Exit label
- Make the fallback tests use a locale without the keys
This commit is contained in:
MacRimi
2026-10-22 00:09:54 +02:00
parent c0046cb24f
commit 203496f14f
16 changed files with 3047 additions and 1409 deletions
+3 -1
View File
@@ -25,6 +25,8 @@ const translate = locale => (key, params = {}) => {
assert.equal(typeof template, 'string', 'Missing translation ' + key)
return template.replace(/\{(\w+)\}/g, (all, key) => params[key] ?? all)
}
// A locale without these keys must show the English backend text.
catalogs.missing = {}
const en = translate('en'), sk = translate('sk')
// Enumerate only pure validator ASTs; importing lxc_apps would access host state.
const contract = JSON.parse(execFileSync('python3', ['-c', String.raw`
@@ -64,7 +66,7 @@ assert.equal(contract.templates.length, 69, 'Update the contract inventory when
for (const message of [...contract.templates, ...contract.actual]) {
assert.equal(localize(message, en), message, 'EN must preserve the exact backend message')
assert.notEqual(localize(message, sk), message, 'Untranslated backend validation: ' + message)
assert.equal(localize(message, translate('de')), message, 'Missing locale falls back to EN')
assert.equal(localize(message, translate('missing')), message, 'Missing locale falls back to EN')
}
// Every supported message, including detector errors, preserves interpolated data.
const enErrors = catalogs.en.vmLxc.appEditor.errors, skErrors = catalogs.sk.vmLxc.appEditor.errors