i18n-ally icon indicating copy to clipboard operation
i18n-ally copied to clipboard

Add translation context for OpenAI

Open phcollignon opened this issue 10 months ago • 0 comments

OpenAI give more accurate translations if we describe the translation context into the prompt.

This pull request adds a text area settings for the OpenAI translation engine where you can describe the context of your application. It is then passed to the OpenAI API prompt for a more accurate translation.

I tested it with OpenAI GPT4 API key and it works quite good : in example "I have some shares for you" gives two different translations in french depending of the context :

  • file sharing application context : "J'ai quelques partages pour toi"
  • financial application : "J'ai quelques actions pour toi"

Regards

phcollignon avatar Apr 23 '24 13:04 phcollignon