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

Example for listen glossaries doesn't work #58

Open
KurtBildeSDU opened this issue Dec 10, 2024 · 1 comment
Open

Example for listen glossaries doesn't work #58

KurtBildeSDU opened this issue Dec 10, 2024 · 1 comment

Comments

@KurtBildeSDU
Copy link

This example - https://github.com/DeepLcom/deepl-dotnet?tab=readme-ov-file#listing-entries-in-a-stored-glossary doesn't work:

var entries = translator.GetGlossaryEntriesAsync(myGlossary);

foreach (KeyValuePair<string, string> entry in entries.ToDictionary()) {
  Console.WriteLine($"{entry.Key}: {entry.Value}");
}
// prints:
//   artist: Maler
//   prize: Gewinn

.ToDictionary() is not a valid definition, so the example isn't working as expected

@JanEbbing
Copy link
Member

JanEbbing commented Dec 11, 2024

Thanks for this report, there is a small error in the example code (the async method is not being awaited).
The following works for me on 1.11.0.

var entries = await translator.GetGlossaryEntriesAsync(myGlossary);

foreach (KeyValuePair<string, string> entry in entries.ToDictionary()) {
  Console.WriteLine($"{entry.Key}: {entry.Value}");
}
// prints:
//   artist: Maler
//   prize: Gewinn

I will fix the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants