Christopher-Hayes / vscode-chatgpt-reborn

Refactor, improve, and debug your code in VSCode with GPT-3 and GPT-4.
https://marketplace.visualstudio.com/items?itemName=chris-hayes.chatgpt-reborn
ISC License
204 stars 38 forks source link

Localize the extension to more languages. #77

Open Christopher-Hayes opened 2 weeks ago

Christopher-Hayes commented 2 weeks ago

Describe the feature

Based on discussion in #75 I looked at what other languages we should translate to.

Most online discussion revolves around what languages the Top #XXX websites use. Which is heavily biased towards search engines in English.

So, what I did was, I looked up the Top 20 countries by internet users. I then had ChatGPT help me turn that into a table by languages, and this is what we get:

Translated Language Code Code Country Name Number of Internet Users
✅ Yes zh-cn CN China 989,016,070
No hi IN India 687,635,341
✅ Yes en US United States 284,530,948
✅ Yes pt BR Brazil 160,010,565
No id ID Indonesia 196,717,000
✅ Yes ja JP Japan 118,626,672
No ru RU Russia 116,353,942
✅ Yes en NG Nigeria 154,301,195
✅ Yes de DE Germany 84,385,961
✅ Yes es MX Mexico 89,000,000
No vi VN Vietnam 68,117,000
✅ Yes tr TR Turkey 69,107,183
No ar EG Egypt 54,400,000
✅ Yes fr FR France 60,421,689
❌ No ur PK Pakistan 61,863,000
❌ No bn BD Bangladesh 61,657,000
✅ Yes en UK United Kingdom 65,588,472
✅ Yes ko KR South Korea 49,180,501
❌ No th TH Thailand 46,930,000
✅ Yes it IT Italy 47,927,481
✅ Yes es ES Spain 43,435,708
❌ No tl PH Philippines 73,000,000
❌ No ar SA Saudi Arabia 35,697,000
✅ Yes pl PL Poland 32,613,563
✅ Yes en CA Canada 33,463,654
❌ No ms MY Malaysia 25,903,000
✅ Yes en AU Australia 22,523,304
✅ Yes nl NL Netherlands 16,780,878
❌ No ar AE United Arab Emirates 9,342,700
✅ Yes pt PT Portugal 8,060,000

Based on this data, the first 5 languages we should add should be:

Christopher-Hayes commented 2 weeks ago

Based on discussion here: https://elk.zone/fosstodon.org/@jgg@qoto.org/112663822251677391

It seems like a good idea to give the user the choice to opt-out of chatgpt translations.

So, I'm thinking I'll add a config option for language choice. And notify new users when chatgpt-translated content is being used.

PeterDaveHello commented 2 weeks ago

I can help with chatgpt-translated locales first 😆

Christopher-Hayes commented 2 weeks ago

:grin: Perfect, thanks Peter. I learned with gh issue develop 77 I could create a branch and connect it to this issue. You'll see it on the right-side.

image

If you haven't already started, you can use that branch. I added you as a collaborator, so you don't have to always work in a fork.

PeterDaveHello commented 1 week ago

Hey Chris,

Thanks for adding me as a collaborator. Since sharing a single branch might cause issues like merge conflicts and dependency problems, would it be better if we use our own branches in the same repo to avoid these potential issues?

It looks like you have some refactoring planned in the new branch, and I'm concerned about conflicts or breaks. It may be best to finish and merge those changes first. After that, I can quickly add the translations for the other languages. What do you think?

Thanks!

Christopher-Hayes commented 1 week ago

@PeterDaveHello actually not much was refactored on that branch. In develop, a couple translation JSONs mistakenly got replaced by the English one, so I just restored those translation files.

The other script changes is related to slowly updating this project to use VS Code APIs, in this case VS Code's fs instead of Node.JS's fs. This will allow this extension to one day work on VS Code in the browser.

PeterDaveHello commented 2 days ago

@Christopher-Hayes Thanks for the heads up. I was thinking, to keep things neat and tidy, how about we finalize your changes first? After that, I can roll out my updates in a new PR. This is just a thought to keep our work streamlined and trouble-free. Thanks!