Closed genikineg closed 4 years ago
Here it seems to work: https://github.com/i18next/i18next-http-middleware/tree/master/example/basic-pug
Probably you are not setting the locals. Like here: https://github.com/i18next/i18next-http-middleware/blob/master/lib/index.js#L85
Please provide a reproducable example.
Here it seems to work: https://github.com/i18next/i18next-http-middleware/tree/master/example/basic-pug
Probably you are not setting the locals. Like here: https://github.com/i18next/i18next-http-middleware/blob/master/lib/index.js#L85
Please provide a reproducable example.
app.get('/', function (req, res, next) {
return res.send(pug.renderFile(
dir+'/static/Main/Main.pug',
{
title: 'Main',
description: 'description',
keywords: 'keywordssdsd232',
req: req
}
))
});
doctype transitional
html.js.no-touch
head
meta(http-equiv='Content-Type', content='text/html; charset=utf-8')
title= t('home.title')
I need to use pug.renderFile for my cache system
pass t, like title... t: req.t,
btw. i18next-express-middleware is deprecated, use i18next-http-middleware instead
pass t, like title... t: req.t,
btw. i18next-express-middleware is deprecated, use i18next-http-middleware instead
Thanks!
TypeError: /static/Main/Main.pug:5 3| head 4| meta(http-equiv='Content-Type', content='text/html; charset=utf-8')
t is not a function