mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: automatically remove lang parameter if it matches the forum default
This commit is contained in:
@@ -101,6 +101,11 @@ define('messages', ['bootbox', 'translator', 'storage', 'alerts', 'hooks'], func
|
||||
params.delete('register');
|
||||
}
|
||||
|
||||
if (params.has('lang') && params.get('lang') === config.defaultLang) {
|
||||
console.info(`The "lang" parameter was passed in to set the language to "${params.get('lang')}", but that is already the forum default language.`);
|
||||
params.delete('lang');
|
||||
}
|
||||
|
||||
const qs = params.toString();
|
||||
ajaxify.updateHistory(ajaxify.currentPage + (qs ? `?${qs}` : '') + document.location.hash, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user