fix: standard object metadata override (#13215)
# Issue - fix #13156, related #13105 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import { APP_LOCALES, SOURCE_LOCALE } from 'twenty-shared/translations';
|
||||
@Injectable()
|
||||
export class I18nMiddleware implements NestMiddleware {
|
||||
use(req: Request, res: Response, next: NextFunction) {
|
||||
const locale = req.headers['x-locale'] as keyof typeof APP_LOCALES;
|
||||
const locale = req.locale;
|
||||
|
||||
if (locale && Object.values(APP_LOCALES).includes(locale)) {
|
||||
i18n.activate(locale);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { APP_LOCALES } from 'twenty-shared/translations';
|
||||
export type I18nContext = {
|
||||
req: {
|
||||
headers: {
|
||||
'x-locale': (typeof APP_LOCALES)[keyof typeof APP_LOCALES] | undefined;
|
||||
};
|
||||
locale: keyof typeof APP_LOCALES;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user