cinny icon indicating copy to clipboard operation
cinny copied to clipboard

Add translation support using i18next

Open Airyzz opened this issue 2 years ago • 14 comments

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. ⚠️

Airyzz avatar Jul 14 '22 10:07 Airyzz

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?

Airyzz avatar Jul 16 '22 15:07 Airyzz

Did you check whether the path given in the 404 error corresponds with the path you expected to be set within the code?

menturion avatar Jul 16 '22 16:07 menturion

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?

Airyzz avatar Jul 16 '22 23:07 Airyzz

I think it might actually be an issue with the webpack, looking in to it now

Airyzz avatar Jul 17 '22 01:07 Airyzz

You need to copy them to dist directory during build, see https://github.com/cinnyapp/cinny/blob/1979646b4b370060f897c8dc737f443b7f993a75/webpack.common.js#L71

kfiven avatar Jul 17 '22 04:07 kfiven

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

Airyzz avatar Jul 17 '22 04:07 Airyzz

No, you are doing it right with i18next-loader.

kfiven avatar Jul 17 '22 04:07 kfiven

That is such a needed feature, cant wait for merge

Chatner-Dev avatar Aug 02 '22 14:08 Chatner-Dev

hi! sorry, i am new to web dev, what program would i use to translate this format?

2-www avatar Oct 03 '22 18:10 2-www

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

Airyzz avatar Oct 04 '22 07:10 Airyzz

@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 avatar Oct 06 '22 10:10 notramo

@notramo discussion involving translation platforms has been taking place in #164

Airyzz avatar Oct 07 '22 04:10 Airyzz

Hi, @ajbura According to your last review comments, which were from 2 months ago, have you any plans to merge this PR?

Maders avatar Oct 16 '22 11:10 Maders

@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

aceArt-GmbH avatar Dec 07 '23 14:12 aceArt-GmbH