Closed dlford closed 2 years ago
If you would like, could you also assign this issue?
@shu1007 all yours, thank you!
@shu1007 Not sure if this helps, or I'm too late, but this seems like a good implementation - https://github.com/i18next/next-i18next
It's still in process, but I'll show you the implementation. #62
I also found out about next-i18next but I wanted to do some cleanup against the translation files. So I am trying to implement the idea of defining a translation data object in TypeScript and using it.
Is it acceptable to implement this policy?
i18n uses the following features of Next.js https://nextjs.org/docs/advanced-features/i18n-routing#sub-path-routing
Then add the following several files to implement i18n
@shu1007 This looks like a great start, I think the two problems I see that need solving are:
If you can solve those two things, I don't mind how you implement it, I only suggested i18next because I thought it might save you some time, but it is up to you either way.
Thanks!
Edit: Looks like you already have fallbacks solved maybe? The demos look great!
Maybe we can use generics instead?
Sorry for the delay in contacting you. I've decided to change my policy and use next i18-next https://github.com/shu1007/developertools.tech/tree/make-i18n-next
Most of the implementation is done, but it will take a little longer.
@shu1007 No worries, thank you!
@shu1007 This is looking great! Thanks so much for your hard work!
I'm not sure if it helps, but we can also add locale
to the Jest mock of next/router
here - https://github.com/shu1007/developertools.tech/blob/make-i18n/jest.setup.js#L13
@dlford
I'm not sure if it helps, but we can also add locale to the Jest mock of next/router here -
Thanks. However currently on test, i18n outputs mock or English only, so I don't think it is necessary.
Sorry for the delay. I finally submitted a pull request.
No worries!
Contact Details
No response
Explain the proposed feature
This project will benefit from displaying in many languages, but first we need a system to handle translations.
Explain the possible use cases for the feature
Not everyone speaks or reads the english language, and even those who do may prefer another for ease of use.
Any other details you would like to provide?
A PR for this issue should:
It is not required to add any other languages in the PR for this issue, I will open a new issue for that, but if you know another language please feel free to add it.