import { Request , Response , NextFunction } from 'express' ; import { Language } from '../typeorm/entities/users/types' ; export const getLanguage = ( req , res , next ) => { const acceptLanguageHeader = req . get ( 'Accept-Language' ) as Language | null ; if ( ! acceptLanguageHeader ) { req . language = 'en-US' ; return next ( ) ; } req . language = acceptLanguageHeader ; return next ( ) ; } ;