An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Hi @Gennady Gurin ,
Thank you for sharing the code.
I performed additional debugging and was able to narrow down where execution stops. The application successfully reaches the translation call:
Task<TranslationResult> translationTask = translator.TranslateLiteAsync(
originalPlainText,
fromLang,
toLang);
When inspecting the returned object in the debugger, the method returns a Task with the following state:
Status = WaitingForActivation
Method = <TranslateLiteAsync>d__24
This indicates that the call itself is not blocking synchronously and that a translation task has been created successfully.
Execution then waits at:
TranslationResult result = await translationTask.WaitAsync(cts.Token);
and does not reach the subsequent statement:
Console.WriteLine("Translation completed successfully!");
Based on these observations, the file-reading and RTF-processing portions of the application appear to be functioning correctly. The code successfully reaches the translation stage, but the translation operation does not complete during execution.
To further isolate the behavior, I would recommend testing the translator separately using a simple hardcoded string. If the same behavior can be reproduced, it would suggest that the issue is independent of the RTF files and is occurring within the translation layer or its interaction with the translation service.
As GoogleTranslateFreeApi is a third-party package, our investigation is limited to the behavior visible from the application side. While we can confirm that the translation task is created successfully, we are unable to verify the library's internal implementation or diagnose its communication with the underlying translation service.
If the behavior persists in a minimal test, you may want to consider evaluating a more actively maintained translation solution, such as an official translation API or another library that is currently supported and updated. This can help determine whether the behavior is specific to the current package and may also provide improved reliability and compatibility over time.
If the behavior can be reproduced consistently, testing an alternative maintained translation library or service may help determine whether the issue is specific to the current package.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation
Thank you.