Closed steveoni closed 3 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
π Inspect: https://vercel.com/datopian1/portal/34hmj2og9
β
Preview: Failed
[Deployment for 7a13bcb failed]
@steveoni looks good.
@steveoni looks good.
- can you rebase so we can merge (merge conflict atm)
- can you add some info to the README about how to use this (similar to what you have in PR description)
ok. I will do that now.
The conflict is now resolved and the readme is updated @rufuspollock
@steveoni I have left some comments. Also, please remove package-lock.json
file as we are using yarn.lock
and yarn
by default. Having both lock files is risky as they can easily become out of sync.
@steveoni any updates on this PR? Please, check my review.
@steveoni any updates on this PR? Please, check my review.
I thought I'd made the changes last week but I've not. I'm sorry for that. I will do that today
@anuveyatsu
This pull request configures and setup i8n for Portal js. The configuration leads to the upgrading of nextjs from version 9.x to 10, due to the fact that it is very difficult to set up i18n for server-side Props.
The latest version of Nextjs gives the ability to switch from a different language using subpath, this makes providing language namespace easier.
Usecase
For subsequent users to add their language of choice, below are the steps to take
Update
next.config.js
, to add more languages to the i18n localesCreate a folder for the language in
locales
-->locales/en-Us
In the language folder, different namespace files (json) can be created for each translation. For the
index.js
use-case, I named itcommon.json
// locales/fr/common.json { "title" : "Portal js in French", }
http://localhost:3000
andhttp://localhost:3000/fr
. Note The subpath also activate chrome language Translator