Locale getLocale ( HandshakeRequest request ) { if ( null != request ) { Map < String , List < String > > headers = request . getHeaders ( ) ; if ( null != headers ) { List < String > accepts = headers . get ( HttpHeaders . ACCEPT_LANGUAGE ) ; logger . debug ( "Get accept-language from client headers : {}" , accepts ) ; if ( null != accepts ) { for ( String accept : accepts ) { try { return localeExtractor . extractFromAccept ( accept ) ; } catch ( LocaleNotFoundException ex ) { } } } } } return Locale . US ; }
Return locale of client