Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System service always returns untranslated group names. #10

Open
kkofler opened this issue Nov 16, 2016 · 1 comment
Open

System service always returns untranslated group names. #10

kkofler opened this issue Nov 16, 2016 · 1 comment

Comments

@kkofler
Copy link

kkofler commented Nov 16, 2016

The user-visible name (DNF's ui_name) we get from the dnfdaemon system service (in the [1] list entry of any comps group or category) is always returned in English rather than translated. This is strange because DNF itself translates these names, and the DNF API documentation says that these names are translated. But dnfdaemon is not setting the locale appropriately, probably because it is a system service, and I cannot find an API to set it manually.

Should the applications ask the session daemon rather than the system daemon for the groups? Should they set the locale somewhere? (Where?) Yumex-DNF (unmodified Fedora package) and dnfdragora (even after my fix to use the [1] (ui_name) entry in the UI instead of the [0] (id or name) entry) both show me the groups in English whereas the DNF command line shows me German names.

kkofler added a commit to kkofler/dnfdragora that referenced this issue Nov 16, 2016
New file dnfdragora/compsicons.py, similar to groupicons.py, but for
comps.

New tool tools/gen-comps-category-list.sh: Generates a map from category
name to ID for dnfdragora/compsicons.py, as a workaround for
manatools/dnfdaemon#9.

dnfdragora/ui.py (mainGui._getAllGroupIDList): Remember the UI names for
                                               each ID in an
                                               id_to_name_map.
                 (mainGui._fillGroupTree): Handle comps separately, use
                                           compsicons.py to get the
                                           icons (manatools#2) and use the
                                           id_to_name_map to get the UI
                                           name (manatools#3).

Fixes manatools#2.
Fixes manatools#3.

The only remaining issue is that the UI names are not translated, which
I filed as manatools/dnfdaemon#10 because Yumex-DNF is also affected (and
thus it is clearly dnfdaemon's fault).
Conan-Kudo pushed a commit to manatools/dnfdragora that referenced this issue Nov 16, 2016
New file dnfdragora/compsicons.py, similar to groupicons.py, but for
comps.

New tool tools/gen-comps-category-list.sh: Generates a map from category
name to ID for dnfdragora/compsicons.py, as a workaround for
manatools/dnfdaemon#9.

dnfdragora/ui.py (mainGui._getAllGroupIDList): Remember the UI names for
                                               each ID in an
                                               id_to_name_map.
                 (mainGui._fillGroupTree): Handle comps separately, use
                                           compsicons.py to get the
                                           icons (#2) and use the
                                           id_to_name_map to get the UI
                                           name (#3).

Fixes #2.
Fixes #3.

The only remaining issue is that the UI names are not translated, which
I filed as manatools/dnfdaemon#10 because Yumex-DNF is also affected (and
thus it is clearly dnfdaemon's fault).
@timlau timlau self-assigned this Nov 23, 2016
@timlau
Copy link
Collaborator

timlau commented Nov 23, 2016

The dnf-daemon runs as a system daemon (LANG=c) so there should properly be some way to set the locale you want to use when getting the ui_name.
there is 2 things there need to be in place for this to work

  1. dnf-daemon api for setting the locale to use
  2. we need a way to force dnf to use the locale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants