orange3-imageanalytics
orange3-imageanalytics copied to clipboard
Multilingual setup
Orange 3.38 might support switching between languages. This is a draft of how add-ons would support that.
We would upload original sources to PyPi and run translation during installation. Add-on is "translated" if (see here)
- setup is run as
install
(notdevelop
), - Orange version is at least 3.38,
-
trubar
is installed. I propose we'd make it a requirement although Orange doesn't depend on it -- only translation of add-ons does. (Note: the current release of Trubar supports only translation to a single language, not switching. This PR suppose a new version which is still in development.)
If add-on supports multiple languages but Orange doesn't, or vice-versa, everything should work.
pip install -e .
or python setup.py develop
should keep source intact. Hence developers wouldn't (have to) notice that add-ons become multilingual when installed. Orange itself would also only be translated when preparing the release, not earlier.
Note: this only works if add-on is installed via python setup.py install
or pip install --no-build-isolation .
. Without --no-build-isolation
, pip creates some kind of temporary virtual environment that has nothing but built-in Python modules.
@markotoplak, thanks for bringing setup.py to my attention. What do you think about this?
To do:
- [ ] How does this interact with CI?
- [ ] Can we move
InstallMultilingualCommand
to another place (where?!?!) where it can be shared between add-ons?