Registration and activation
This commit is contained in:
22
backend/utils/i18n.js
Normal file
22
backend/utils/i18n.js
Normal 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;
|
||||
Reference in New Issue
Block a user