Closed jonassmedegaard closed 3 years ago
Current backends are really cheap (they only talk to online APIs, so there's no size bloat) and also there aren't much translation services feasible to implement, and the backends list will not grow to much. So I don't see the need to create a plugin system nor I want to maintain one.
But I can understand that you could want to package Dialect with only open source services, maybe we can add a build option to choose that.
What do you think @fushinari?
While this is desirable, I don't really see the point in it at the moment. We only have two backends in total and only one of them is open source. If a new feasible backend (open source or not) appears, I might do the work required for this.
But if anyone's interested in a PR, I'll outline some of the required work for a proper implementation:
window.py
to translators/gtrans.py
and ensure that voice still works. Also ensure that future backends can make use of the same structure.~ Done.importlib
for importing all translators in translators/
and dynamically generate the dialect.translators.TRANSLATORS
dictionary (it is a list right now) with Translator.name
and Translator
(class) pairs. Make the backend
gsettings use strings, that will be the same as Translator.name
.~ Done.IndexError
or if using dictionary, KeyError
. This is in case the user uses Dialect from different sources.)~ Done.This won't make it a plugin system, but it will ensure that de-googling (removing translators/gtrans.py
) will not break the application and that removing other backends in the future will also not break the application.
Look at what you made us do... :laughing:
With #150 merged into main
, I think your request has been satisfied. Deleting src/translators/gtrans.py
and src/tts/gtts.py
should give a Google-free build. Could you test to confirm that everything works as expected? :smile:
Anyone testing right now might have to reset all gsettings from dconf-editor before going back to stable.
Thanks a lot!
Currently as of release 1.2.0, translation backends are selectable in the UI, but are loaded.
Would be nice if backends were treated as pluggable - i.e. all plugins existing in the directory is loaded (not hardcoding a list of plugins expected to exist).
That would make it possible to distribute this app in Debian and its derivatives, with each plugin provided in as individual binary packages - which in turn allowed the user to avoid certain plugins.