dialect-app / dialect

A translation app for GNOME.
https://dialectapp.org/
GNU General Public License v3.0
597 stars 69 forks source link

please make translation backeneds optional #143

Closed jonassmedegaard closed 3 years ago

jonassmedegaard commented 3 years ago

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.

rafaelmardojai commented 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?

mufeedali commented 3 years ago

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:

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.

mufeedali commented 3 years ago

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.

jonassmedegaard commented 3 years ago

Thanks a lot!