Closed JannieT closed 1 year ago
Hey, do you have the DetectUserLocale
middleware registered?
https://docs.adonisjs.com/guides/i18n#detecting-user-locale https://docs.adonisjs.com/reference/i18n/view-helpers#i18n
Phew! Thanks. That was it. I did not register the middleware, because I thought in my use case it can't detect the locale from the request header. But clearly it does more than meets the eye. Appreciate you sir! Your craft and graft is so inspiring.
Package version
1.6.0
Node.js and npm version
node v18.16.0 npm 9.5.1
Sample Code (to reproduce the issue)
Start a new Adonis project with the i18n package:
Add translation files:
Localize the template views/welcome.edge:
Make these changes to
start/routes.ts
:BONUS (a sample repo to reproduce the issue)
Sample Repo