Registration and activation

This commit is contained in:
Torsten Schulz
2024-07-20 20:43:18 +02:00
parent 3880a265eb
commit bbf4a2deb3
51 changed files with 3016 additions and 69 deletions

22
backend/utils/i18n.js Normal file
View File

@@ -0,0 +1,22 @@
import i18n from 'i18n';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
i18n.configure({
locales: ['en', 'de'],
directory: path.join(__dirname, '../locales'),
defaultLocale: 'de',
register: global,
autoReload: true,
syncFiles: true,
cookie: 'lang',
api: {
'__': 'translate',
'__n': 'translateN'
}
});
export default i18n;