fix: change language in edit, history and source pages (#2194)
* change language in edit, history and source pages * fix: remove unnecessary i18n locale switch for download page Co-authored-by: Nicolas Giard <github@ngpixel.com>
This commit is contained in:
parent
5aa959eea4
commit
15bca54bdf
@ -107,6 +107,8 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
|
|||||||
return res.redirect(`/e/${pageArgs.locale}/${pageArgs.path}`)
|
return res.redirect(`/e/${pageArgs.locale}/${pageArgs.path}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.i18n.changeLanguage(pageArgs.locale)
|
||||||
|
|
||||||
// -> Set Editor Lang
|
// -> Set Editor Lang
|
||||||
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
|
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
|
||||||
_.set(res, 'locals.siteConfig.rtl', req.i18n.dir() === 'rtl')
|
_.set(res, 'locals.siteConfig.rtl', req.i18n.dir() === 'rtl')
|
||||||
@ -238,6 +240,8 @@ router.get(['/h', '/h/*'], async (req, res, next) => {
|
|||||||
return res.redirect(`/h/${pageArgs.locale}/${pageArgs.path}`)
|
return res.redirect(`/h/${pageArgs.locale}/${pageArgs.path}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.i18n.changeLanguage(pageArgs.locale)
|
||||||
|
|
||||||
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
|
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
|
||||||
_.set(res, 'locals.siteConfig.rtl', req.i18n.dir() === 'rtl')
|
_.set(res, 'locals.siteConfig.rtl', req.i18n.dir() === 'rtl')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user