Open gyunaev opened 3 years ago
Technically speaking, this is a special case of #359.
The built-in translator supports Google Translate, which is great option for some languages, but not that great for many others.
Instead of adding support for all the translators and dictionaries around there, would it be possible to allow the user to invoke a specified app upon "translate" action, and show the output of the app in the "translation results" window? This would allow contributors to write custom support for various translators, dictionaries and so on, including DeepL, GoldenDict, libretranslate.com and so on.
The invocation interface should probably as simple as the following:
- When Translate clicked, Foliate launches an app specified in settings;
- The selected text is written to the app's stdin, which is closed afterward;
- The app is supposed to write the translation/dictionary lookup/whatever in HTML format into stdout (including errors);
- Foliate reads apps output and shows the result in the Translation window.
Yes, it's true, for European Portuguese, for example, Google Translate is not a good option. In this case, DeepL works very well. Being able to use it would be great.
The built-in translator supports Google Translate, which is great option for some languages, but not that great for many others.
Instead of adding support for all the translators and dictionaries around there, would it be possible to allow the user to invoke a specified app upon "translate" action, and show the output of the app in the "translation results" window? This would allow contributors to write custom support for various translators, dictionaries and so on, including DeepL, GoldenDict, libretranslate.com and so on.
The invocation interface should probably as simple as the following: