Comments (6)
The:
# group is not in our group definition, but it's into the repository
# we just use it
case is not correct. (Note that the group definition covers only the toplevel categories, by design. It should not be needed at all, it is only a workaround for manatools/dnfdaemon#9. This is already bad enough, hardcoding all of comps is not a good idea IMHO.)
Making this work right is what my id_to_name_map
was for (note that this is built at runtime and not the same as the hardcoded name_to_id_map
in compsicons.py
that you renamed to _group_info
), which you removed the usages of. In comps, the ID is not the same as the pretty name, which is why my comps code was deliberately different from the RPM groups code.
from dnfdragora.
Sorry i didn't understand that name_to_id_map was evaluated at run-time...
Is that containing localized strings?
Since I'm not a Fedora user/developer can you explain how it works at run-time so that i'll try to use it following the groupicons API - or at least finding a common interface?
thank you
from dnfdragora.
commit d10cfc7 should have fixed that, however titles are not localized, we have to take that in account sooner or later. Maybe a static and not always up to date dictionary that can be translated is better than a not translated one at run time... improving the script we have nowadays should not be that pain... wdyt?
from dnfdragora.
(I was writing up this long post when you committed the latest changes.)
The name_to_id_map
was a constant, the id_to_name_map
was not. (They have similar names, but they are not opposites of each other, they map different things. My naming could probably have been better, and my comments more extensive.)
name_to_id_map
: workaround for manatools/dnfdaemon#9. Maps the untranslated name that dnfdaemon puts into the ID field (gl[0]
) for (toplevel) categories to the actual ID needed to look up the icon. No mapping is done for (non-toplevel) groups, where the ID is already correct. The idea was that if and when dnfdaemon gets fixed, no changes should be needed (but the map could eventually be emptied or the mapping code removed, though the code should also work with a fixed dnfdaemon while the map is still there). It just maps dnfdaemon ID → comps ID. Outside of the icon lookup code, the dnfdaemon ID (gl[0]
) is used as is. Looking at your changes, I believe that your code still does that part correctly. The icons also come up right for me.id_to_name_map
: built at runtime in https://github.com/anaselli/dnfdragora/pull/7/files#diff-6a15535e26dbe9e53bdd869800e5517aR442. Maps the dnfdaemon ID (gl[0]
) to the dnfdaemon UI name (gl[1]
). The thing is, in comps, the internal ID is not what we want to display to the user, a name is specified there. (The name should even come already translated, but this is not working at the moment, see manatools/dnfdaemon#10.) DNF actually has 3 "names":id
,name
(comps name as is, untranslated), andui_name
(translated comps name). dnfdaemon'sgl[1]
is theui_name
. It is just not translated yet because the locale is not set anywhere.
from dnfdragora.
Since I'm not a Fedora user/developer can you explain how it works at run-time so that i'll try to use it following the groupicons API - or at least finding a common interface?
Well, the reason I split the code in the first place is that I was not able to figure out how to make the 2 versions of the code work with the same interface, because there was the assumption that the ID is also the title if we don't have a title in our hardcoded group_info
. But you found a way now anyway.
commit d10cfc7 should have fixed that
Yes, this looks good to me (building your group_info
at runtime), though I have not tried it yet.
however titles are not localized, we have to take that in account sooner or later.
This is manatools/dnfdaemon#10.
Maybe a static and not always up to date dictionary that can be translated is better than a not translated one at run time... improving the script we have nowadays should not be that pain... wdyt?
I don't think reinventing the comps translations is going to help. You could try to load the existing comps .mo files from the system. But I think it would make more sense to just get dnfdaemon to return the translated identifiers to begin with.
from dnfdragora.
agreed :)
from dnfdragora.
Related Issues (20)
- dnfdragora fails to query state of dnf-makecache.timer HOT 14
- Clicking to the right of a checkbox sets a remove flag even if the package isn't installed. HOT 1
- Dnfdragora require changes for latest libyui stack
- dnf Dragora constantly crashes, does not even work in wayland. HOT 2
- dnf dragora 2.1.2 won't maximize on gnome wayland on fedora 36 HOT 14
- dnfdragora 2.1.2 starts the app window with 0 width HOT 9
- Dnfdragora backend's (dnfdeamon) ignores DNF's variables HOT 3
- Fedora: dnfdragora doesn't respect /etc/dnf/vars HOT 3
- Feature Request: Clicking on Update Notification should open main GUI HOT 4
- dfndagora hang when search criterion is empty HOT 1
- feature request: add option to save column width ...
- Prepare for DNF 5 HOT 14
- dnfdragora opening as a line. HOT 8
- The app is squashed when is opened HOT 8
- 'Update information' crash dnfdragora HOT 4
- Create an rpm package from dnfdragora sources ? HOT 1
- Broken Matrix room link in README HOT 1
- Updates are available, but the updates list is empty HOT 4
- Statistics in dnfdragora
- dnfdragora-updater Won't start F40 Plasma 6 rc-1 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnfdragora.