All error messages in german and in englisch
This commit is contained in:
@@ -3,11 +3,34 @@ import logger from 'morgan'
|
||||
import express from 'express'
|
||||
import cookieParser from 'cookie-parser'
|
||||
import cors from 'cors'
|
||||
import i18next from 'i18next'
|
||||
import i18nextMiddleware from 'i18next-http-middleware'
|
||||
import Backend from 'i18next-node-fs-backend'
|
||||
|
||||
const app = express()
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
import indexRouter from './routes/index.js'
|
||||
import { apiRouter } from './routes/api.js'
|
||||
import {fileURLToPath} from "url";
|
||||
import path from "path";
|
||||
|
||||
const app = express()
|
||||
|
||||
i18next
|
||||
.use(Backend)
|
||||
.use(i18nextMiddleware.LanguageDetector)
|
||||
.init({
|
||||
backend: {
|
||||
loadPath: __dirname + '/locales/{{lng}}/{{ns}}.json'
|
||||
},
|
||||
fallbackLng: 'de',
|
||||
debug: false,
|
||||
preload: ['de', 'en']
|
||||
});
|
||||
|
||||
app.use(i18nextMiddleware.handle(i18next));
|
||||
|
||||
app.use(cors())
|
||||
app.use(logger('dev'))
|
||||
|
||||
Reference in New Issue
Block a user