feat: i18n support for backend

This commit is contained in:
cihatata authored and cihat committed 2025-02-11 07:43:36 +03:00
1 parent 0eceac1587
commit 10713428b9
34 files changed
+1106 -838

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
const languageMiddleware = (req, res, next) => {
const acceptLanguage = req.headers['accept-language'] || 'en';
req.language = acceptLanguage.split(',')[0].slice(0, 2).toLowerCase();
next();
};
export default languageMiddleware;