Merge pull request #33404 from overleaf/copilot/fix-accepts-language-deprecation

Fix deprecated req.acceptsLanguage → req.acceptsLanguages in Translations.mjs

GitOrigin-RevId: db9f09d999158ba5f9f084bc1a8334954a55cd79
This commit is contained in:
Andrew Rumble
2026-06-16 08:06:29 +00:00
committed by Copybot
parent b7946791f4
commit d22cea01ce
2 changed files with 2 additions and 2 deletions
@@ -125,7 +125,7 @@ function setLangBasedOnDomainMiddleware(req, res, next) {
// the Accept-Language header), then set flag which will show a banner
// offering to switch to the appropriate library
const detectedLanguageCode =
req.acceptsLanguage(availableLanguageCodes) || fallbackLanguageCode
req.acceptsLanguages(availableLanguageCodes) || fallbackLanguageCode
if (req.language !== detectedLanguageCode) {
res.locals.suggestedLanguageSubdomainConfig =
subdomainConfigs.get(detectedLanguageCode)
@@ -38,7 +38,7 @@ describe('Translations', function () {
headers: {
'accept-language': '',
},
acceptsLanguage: express.request.acceptsLanguages,
acceptsLanguages: express.request.acceptsLanguages,
}
res = {
locals: {},