fix: standard object metadata override (#13215)

# Issue

- fix #13156, related #13105

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Nabhag Motivaras
2025-07-16 12:20:14 +05:30
committed by GitHub
parent 87e494d85f
commit ffcbfa6215
15 changed files with 645 additions and 86 deletions
@@ -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;
};
};