Update "preferredlang" to "user_language" (#33045)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import languages, { languageKeys } from '../lib/languages.js'
|
||||
import parser from 'accept-language-parser'
|
||||
|
||||
import { PREFERRED_LOCALE_COOKIE_NAME } from '../lib/constants.js'
|
||||
import { USER_LANGUAGE_COOKIE_NAME } from '../lib/constants.js'
|
||||
|
||||
const chineseRegions = ['CN', 'HK']
|
||||
|
||||
@@ -34,7 +34,7 @@ function getUserLanguage(browserLanguages) {
|
||||
}
|
||||
|
||||
function getUserLanguageFromCookie(req) {
|
||||
const value = req.cookies[PREFERRED_LOCALE_COOKIE_NAME]
|
||||
const value = req.cookies[USER_LANGUAGE_COOKIE_NAME]
|
||||
// 92BD1212-61B8-4E7A: Remove ` && !languages[value].wip` for the public ship of ko, fr, de, ru
|
||||
if (value && languages[value] && !languages[value].wip) {
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user