feat: toevoeging fallback language constante

This commit is contained in:
Gabriellvl 2025-03-01 18:31:38 +01:00
parent 008e2e1c2c
commit 6bb8c364b9
6 changed files with 12 additions and 8 deletions

View file

@ -3,6 +3,7 @@ import path from 'path';
import yaml from 'js-yaml';
import { Request, Response } from 'express';
import { themes } from '../data/themes.js';
import {FALLBACK_LANG} from "../config";
interface Translations {
curricula_page: {
@ -26,7 +27,7 @@ function loadTranslations(language: string): Translations {
}
export function getThemes(req: Request, res: Response) {
const language = (req.query.language as string)?.toLowerCase() || 'nl';
const language = (req.query.language as string)?.toLowerCase() || FALLBACK_LANG;
const translations = loadTranslations(language);
const themeList = themes.map((theme) => {