cinny
cinny copied to clipboard
Add translation support using i18next
Description
Adds support for new languages as per #164
Adds i18next, i18next-browser-languagedetector, i18next-http-backend, react-i18next as dependencies
Type of change
- [x] New feature (non-breaking change which adds functionality)
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
Preview: https://62fa1243e46824314616a3e3--pr-cinny.netlify.app ⚠️ Exercise caution. Use test accounts. ⚠️
It seems the netlify preview 404s when trying to retrieve the translation.json file. Is this a problem with the netlify set up or something that I need to fix?
Did you check whether the path given in the 404 error corresponds with the path you expected to be set within the code?
Its the same path that gets requested when running locally, but netlify 404s while running locally works fine. If somebody could test running on their machine that might help to narrow to down?
I think it might actually be an issue with the webpack, looking in to it now
You need to copy them to dist directory during build, see https://github.com/cinnyapp/cinny/blob/1979646b4b370060f897c8dc737f443b7f993a75/webpack.common.js#L71
At the moment I have it working using i18next-loader, would it be preferable to copy? https://github.com/cinnyapp/cinny/blob/ef31851554cc3f2195b64ee3e85c8d620c99a006/webpack.common.js#L52
No, you are doing it right with i18next-loader.
That is such a needed feature, cant wait for merge
hi! sorry, i am new to web dev, what program would i use to translate this format?
hi! sorry, i am new to web dev, what program would i use to translate this format?
At the moment we dont have a translation platform set up. It will be easier if you wait for that to be finalised, but if you want to work on it right now, just fork this repo and the language files are just .json so you can edit with any text editor
@aybura Could you please use the open-source Weblate platform for translating this? Using closed platforms like Transifex or Crowdin prevents some potential translators to contribute (including myself as I have a Weblate account, but not Transifex or Crowdin).
@notramo discussion involving translation platforms has been taking place in #164
Hi, @ajbura According to your last review comments, which were from 2 months ago, have you any plans to merge this PR?
@Airyzz could you perhaps rebase this PR to a more recent commit (doesn't have to be latest), or at least squash your commits? Thanks for your work on this