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:
Seyed Sajad Kahani 2020-07-29 23:54:31 +00:00 committed by GitHub
parent 5aa959eea4
commit 15bca54bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,6 +107,8 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
return res.redirect(`/e/${pageArgs.locale}/${pageArgs.path}`)
}
req.i18n.changeLanguage(pageArgs.locale)
// -> Set Editor Lang
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
_.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}`)
}
req.i18n.changeLanguage(pageArgs.locale)
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
_.set(res, 'locals.siteConfig.rtl', req.i18n.dir() === 'rtl')