Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,12 @@ class Input extends Logger {
* @param {*} locale
*/
language(locale = false) {
// Same product switch as ua_language(): when the deployment forces the
// default language, nothing request-derived (params, headers, browser
// locale) may override it.
if (global.myDrumee?.forceDefaultLanguage) {
return this.defaultLanguage();
}
if (this.get("Xlang") != null) {
return this.get("Xlang");
}
Expand Down Expand Up @@ -760,6 +766,12 @@ class Input extends Logger {
*
*/
page_language() {
// Same product switch as ua_language(): a deployment that forces the
// default language serves every page in it — the pagelang header and
// the browser's accept-language must not leak through.
if (global.myDrumee?.forceDefaultLanguage) {
return this.defaultLanguage();
}
let l = this.get("pagelang") || this.get("page-language");
if (l != null) {
return l;
Expand Down