1
0
mirror of synced 2025-12-21 02:46:50 -05:00

Update "preferredlang" to "user_language" (#33045)

This commit is contained in:
Kevin Heis
2022-11-30 09:51:51 -08:00
committed by GitHub
parent 5736e6c7e7
commit 6b1ac124d8
6 changed files with 12 additions and 12 deletions

View File

@@ -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