Skip to content

[AI Translation] Support the glossary feature on providers other than DeepL #129

@clem-zezuka

Description

@clem-zezuka

Hello,

This is a request for improvement.

When using a model such as ChatGPT, currently it's impossible to add a glossary for translation, or else it must be added directly in the prompt, which makes things less obvious for non-developers.

Would it be possible to add an option that would allow the plugin to be linked to a glossary model for instance?

The idea would be to have a model with this kind of schema:

Word (Single line string):

  • Required? Yes
  • Enable localization on this field? Yes

That very naive but code wise, it could look like that:

if (glossary.length > 0) {
    prompt = `${prompt}\n\nGLOSSARY\nUse the following glossary of terms for translation: ${glossary.reduce((accumulator, { word }) => `${accumulator}\n- ${fromLocale}: ${word[fromLocale]}, ${toLocale}: ${word[toLocale]}`, '')}.`
}

Assuming that the glossary variable is the content from the model (I don't know how to retrieve it plugin wise).

Otherwise, the plugin is already super nice, congratulation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions