DeepL: added Glossary and HTML functionality#100
Open
thornch wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
All code review comments and requested changes from #93 have been resolved and implemented as part of this pull request. |
| private const string UrlPaid = "https://api.deepl.com/v2/translate"; | ||
| private const string UrlFree = "https://api-free.deepl.com/v2/translate"; | ||
| private readonly DeepLTranslationOptions options = options.Value; | ||
| private readonly ConcurrentDictionary<string, string?> glossaryCache = new (); |
Contributor
There was a problem hiding this comment.
What exactly is this cache and how much entries can we expect here? I have not digged into this glossary stuff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DeepL: Added support for the parameters tag_handling and glossary_id via application.config:
DeepL glossary handling:
When a glossary is replaced or recreated, its glossary ID may change. To keep glossary functionality stable in such cases, keep the glossary name unchanged and configure glossaryByName instead of glossaryById.
If a glossary name is configured, the glossary lookup is performed using the glossary name together with the source and target language pair.
The resolved glossary ID is cached in memory. If the glossary becomes invalid (for example because it was deleted or recreated), the cache is invalidated when a translation request fails and the glossary ID is resolved again on the next request.
Note: DeepL requires source_lang to be specified explicitly when a glossary is used for translation.