fix sonar findings and translation structure
Sonarqube Scanner / Prepare environment (push) Successful in 19s
Sonarqube Scanner / Build and test (push) Successful in 43s
Sonarqube Scanner / SonarQube analysis (push) Failing after 2m28s
Sonarqube Scanner / Deploy to Server (push) Successful in 16s

This commit is contained in:
Florian Zumpe
2026-10-01 16:31:46 +02:00
parent 2b42507f13
commit 5c4d20bd1d
30 changed files with 1753 additions and 894 deletions
+11
View File
@@ -47,3 +47,14 @@ test('public help and spoken labels omit implementation terms and preserve meani
assert.match(text, /Fortschritt.*gelöscht/s);
assert.match(text, /Meine Entwürfe/);
});
test('English errors keep translated validation hints and hide technical replies', async () => {
const context = { navigator: { language: 'en-GB' } };
await loadI18n(context);
vm.runInNewContext(await fs.readFile(path.join(root, 'public/js/user-messages.js'), 'utf8'), context);
const { I18n, UserMessages } = context.Wegwichtel;
assert.equal(UserMessages.error(new Error(I18n.t('editor.error.route-name'))), 'Give your trail a name.');
assert.equal(UserMessages.error({ status: 413 }), 'This file is too large. Choose a smaller file.');
assert.match(UserMessages.error({ message: 'Die GPX-Datei ist kein gültiges XML.' }), /readable path/);
assert.equal(UserMessages.error(new Error('Failed to fetch')), 'That did not work. Please try again.');
});