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;
