Merge branch 'dev' into chore/logging
This commit is contained in:
commit
11e3dc6a3f
48 changed files with 2252 additions and 1541 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue