Files
wekan/tests/guaraniTranslationProgress.test.cjs
T
Lauri Ojansivu 270a4599f1 Translate feature and card settings in five more languages
Fill 135 messages in Aymara, Quechua, Guarani, Fulah and Greenlandic. Replace mixed-language Aymara and Quechua feature, administrator and linked-card labels, and correct the Guarani board label and creation message.

Settings coverage reaches 228 locale tags. All 448 related suites pass after the first three languages; eight selected suites pass after Fulah and Greenlandic. Specialist workflow wording in all five languages has lower confidence and welcomes speaker review.

Thanks to xet7.
2026-10-02 19:21:52 +03:00

33 lines
1.6 KiB
JavaScript

// The completed catalog predates newer features; keep its no-regression gate.
// Full translation work remains visible through fill-translations.mjs --list.
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { spawnSync } = require('node:child_process');
const root = path.resolve(__dirname, '..');
const fillScript = path.join(root, 'releases/translations/fill-translations.mjs');
const result = spawnSync(process.execPath, [fillScript, '--completed-catalog', '--list', 'gn'], {
cwd: root,
encoding: 'utf8',
});
assert.equal(result.status, 0, result.stderr);
const remaining = JSON.parse(result.stdout);
assert.equal(Object.keys(remaining).length, 0);
const english = JSON.parse(fs.readFileSync(path.join(root, 'imports/i18n/data/en.i18n.json'), 'utf8'));
const guarani = JSON.parse(fs.readFileSync(path.join(root, 'imports/i18n/data/gn.i18n.json'), 'utf8'));
const tokens = (value) => [...value.matchAll(/__[A-Za-z0-9_]+__|%[A-Za-z]|%{[A-Za-z0-9]+}|{{[A-Za-z0-9]+}}/g)].map(([token]) => token).sort();
const tags = (value) => [...value.matchAll(/<\/?[A-Za-z][^>]*>/g)].map(([tag]) => tag).sort();
for (const [key, value] of Object.entries(guarani)) {
if (value !== english[key]) assert.deepEqual(tokens(value), tokens(english[key]), key);
assert.deepEqual(tags(value), tags(english[key]), key);
}
assert.equal(guarani.accept, 'Moneĩ');
assert.match(guarani['act-createBoard'], /tembiapo renda/i);
assert.doesNotMatch(guarani['act-createBoard'], /peteĩcha/i);
assert.equal(guarani.board, 'Tembiapo renda');
assert.match(guarani['act-createCard'], /kuatia'i/i);