I've follow the kraken.js example to get i18n for my website. So now, 1 template file is rendered in each set-up language.
For example : index.dust can be rendered in French, English and Dutch. What I'm trying to achieve now is, if a user goes to :
<site>/accueil -> website in french
<site>/home -> website in english
And so on.
The kraken.js example relies on cookies. But if the user comes for the first time, the actual config will render a page in french (default locale) even if he came with an english url.
I thought about an array for each route:locale (/accueil, /home, /startseite, etc) to define the locality but this is far from a clean code PLUS I will have to manually edit the array for every page added.
Does anyone have a better idea ?
Thx.
Well, I used the array that I described above.
Have a middleware or param handler assign the locale from the parameter in the URL, rather than using a cookie.