Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glossary support #8

Open
domenic opened this issue May 10, 2024 · 1 comment
Open

Glossary support #8

domenic opened this issue May 10, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@domenic
Copy link
Collaborator

domenic commented May 10, 2024

Some translation APIs provide support for a glossary of specialized terms, e.g. here is Google Cloud Translation's documentation or DeepL's.

I think it would look something like this:

const translator = await translation.createTranslator({
  sourceLanguage: "ja",
  targetLanguage: "en",
  glossary: {
    "巨人": "Titan",
    "調査兵団": "Survey Corps",
    "超大型巨人": "Colossal Titan",
    "リヴァイ兵長": "Captain Levi",
    "ウォール・シーナ": "Wall Sina"
  }
});

The example given here is translating something about the popular manga/anime Attack on Titan, using the official translations that are widely used. Note that they can definitely differ from the default translations, e.g. Google Translate gives "giant", "Research Corps", and "Super-sized giants" for the first three.

@domenic domenic added the enhancement New feature or request label May 10, 2024
@globalpai
Copy link

One could leverage the Glossary for DNT (Do Not Translate), but it's worth considering having DNT as a separate list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants