twinnydotdev / twinny

The most no-nonsense, locally or API-hosted AI code completion plugin for Visual Studio Code - like GitHub Copilot but completely free and 100% private.
https://twinny.dev
MIT License
2.93k stars 154 forks source link

Support Comments Translation #200

Closed ivaquero closed 5 months ago

ivaquero commented 6 months ago

Is your feature request related to a problem? Please describe. Comments Translation is helpful for non-English developers to translate their comments into English.

Describe the solution you'd like Add a default option of translation in Right Click Context Menu.

Describe alternatives you've considered There are several AI translation extensions based on OpenAI, but I think it can be done by Ollama.

Additional context No.

rjmacarthy commented 6 months ago

Hey, I don't understand the requirement. We cannot have "Translate into X" for every language in the world, so how do you envisage it will work?

Many thanks,

ivaquero commented 6 months ago

I expect it provides with translation of major language (French, Spanish, Chinese, Russian, etc) to English.

I means the extension can add one or two new prompt templates to call LLM like OpenAI or Ollama's Gemma to do this job. For example translate {A} to English, and we can specify {A} in settings.

rjmacarthy commented 6 months ago

Thanks for the reply, do you think it would be best to just add some custom templates?

ivaquero commented 6 months ago

The reason I would like to have a predefined template is that I am not expertise write a template, more specifically, I think {language} means a programming language rather than a natural language, and I tried to write a custom template but it seemed the comments doesn't fit {code}.

rjmacarthy commented 5 months ago

This can be achieved with template system, and not viable unfortunately for right click menu.