changes to translation system
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
tom.hempel
2026-07-09 14:59:56 +02:00
parent 4afab336ee
commit f04388e0ec
24 changed files with 1882 additions and 415 deletions

View File

@ -1,4 +1,13 @@
const STABLE_KEY_RE = /^[a-zA-Z][a-zA-Z0-9_]*$/;
const RESULTS_EXCLUDED_KEYS = new Set(['data_final_warning']);
const RESULTS_EXCLUDED_TYPES = new Set(['last_page']);
/** Questions hidden from results tables and CSV exports (e.g. last-page warnings). */
export function isResultsExcludedQuestion(q) {
if (!q) return false;
if (RESULTS_EXCLUDED_TYPES.has(q.type)) return true;
return RESULTS_EXCLUDED_KEYS.has(questionDisplayKey(q));
}
/** Local question id from full questionID (hash__q5 → q5). */
export function questionLocalKey(questionID, fallback = '') {
@ -62,6 +71,7 @@ export function glassSymptomAnswerValue(raw, symptomKey) {
export function buildResultColumns(questions) {
const cols = [];
for (const q of questions || []) {
if (isResultsExcludedQuestion(q)) continue;
const cfg = parseQuestionConfig(q);
const symptoms = cfg.symptoms;
if (q.type === 'glass_scale_question' && Array.isArray(symptoms) && symptoms.length > 0) {