Merge branch 'dev' into chore/logging

This commit is contained in:
Tibo De Peuter 2025-03-06 12:11:29 +01:00
commit 11e3dc6a3f
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
48 changed files with 2252 additions and 1541 deletions

View file

@ -1,7 +1,7 @@
import fs from 'fs';
import path from 'path';
import yaml from 'js-yaml';
import {FALLBACK_LANG} from "../../config.js";
import { FALLBACK_LANG } from '../../config.js';
import { getLogger, Logger } from '../logging/initalize.js';
const logger: Logger = getLogger();
@ -16,7 +16,11 @@ export function loadTranslations<T>(language: string): T {
`Cannot load translation for ${language}, fallen back to dutch`,
error
);
const fallbackPath = path.join(process.cwd(), '_i18n', `${FALLBACK_LANG}.yml`);
const fallbackPath = path.join(
process.cwd(),
'_i18n',
`${FALLBACK_LANG}.yml`
);
return yaml.load(fs.readFileSync(fallbackPath, 'utf8')) as T;
}
}