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

Provide the key description to OpenAI and add additional context when translating for i18next

Open Gr3q opened this issue 1 year ago • 3 comments

As title.

  • Provide key name for attempting to translate plurals correctly
  • Key description is now provided for all Translators to use (if they are capable to use it). Added it to the user prompt for OpenAI
  • Added additional context for OpenAI when translating for i18next

Additional notes:

  • gpt-4 is much better than gpt-3.5-turbo. Better with longer prompts as well...it really should be the default.
  • gpt-4-turbo-preview is not in the OpenAI Api model list, it should be added - I can do that in this PR if you'd like to.
  • OpenAI users should be able to extend the system prompt - I could implement this too in this PR if you'd like to.
  • OpenAI user should be able to make the "extend system prompt" to "override system prompt" with a checkbox - this might not be that desirable

Gr3q avatar Feb 16 '24 16:02 Gr3q

I added a translation context per project in this fork : https://github.com/phcollignon/i18n-ally/tree/main.
The context can be added in the vscode plugin settings (one per workspace).
For example, you define there that your application is about "financial operations" and OpenAI is going to translate according to that context. (Pull request 1130

phcollignon avatar Apr 23 '24 18:04 phcollignon

This PR uses the description of each key to provide context instead. But it could be both.

Gr3q avatar Apr 23 '24 18:04 Gr3q

Yes indeed, it's another option.

phcollignon avatar Apr 24 '24 08:04 phcollignon