Closed janezd closed 1 month ago
Attention: Patch coverage is 56.36364%
with 24 lines
in your changes are missing coverage. Please review.
Project coverage is 76.61%. Comparing base (
8a3ecf1
) to head (352808d
).
Files | Patch % | Lines |
---|---|---|
orangecanvas/utils/localization/__init__.py | 64.86% | 13 Missing :warning: |
orangecanvas/application/settings.py | 23.07% | 10 Missing :warning: |
orangecanvas/main.py | 80.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This adds a language selector to the settings dialog. It will allow us to prepare multilingual distributions of Orange, which we urgently need for various education-related projects.
The change is only visible if distribution includes message files that are prepared by (so far unpublished new version of) Trubar.
Caveats:
Language must be detected at the very beginning because some modules (even modules like
Orange.data.table
may already include translated strings). This is why language is read fromQSettings(QSettings.IniFormat, QSettings.UserScope, organization, application)
and not justQSettings()
becauseQApplication
is not set up at that point yet. Organization and application are specified in Trubar's configuration files, to allow Trubar to insert the following at the beginning of each module (after imports from future):After changing the language, Orange must be re-run with
--force-discovery
. This belongs to this PR, but is not implemented yet.@ales-erjavec, do you have any comments?
To do:
I'm attaching examples of core files and some add-ons. Strings are simply looked up in a table, e.g.
becomes
while f-strings, like
are compiled and evaluated,
m
,c
ande
are attributes ofTranslator
class from this PR.orange3.zip orange-canvas-core.zip orange-widget-base.zip orange3-imageanalytics.zip orange3-geo.zip orange3-network.zip
Preparation of these files is not a part of this PR.