Conversation
| continue | ||
| c_level = AppStream.ContentRatingValue.from_string(level) | ||
| rating.add_attribute(attr, c_level) | ||
| description = AppStream.ContentRating.attribute_get_description(attr, c_level) |
There was a problem hiding this comment.
I am not sure where this gets its locale from.
backend/app/utils.py
Outdated
| system = AppStream.ContentRatingSystem.from_locale(locale) | ||
| rating = AppStream.ContentRating() | ||
| rating.set_kind(content_rating["kind"]) | ||
| details = {"attrs": []} |
There was a problem hiding this comment.
Pylance complains here, I guess details = {} should work fine here
| return apps, apps_locale | ||
|
|
||
|
|
||
| def get_content_rating_details(content_rating: dict, locale: str) -> dict: |
There was a problem hiding this comment.
Did you work this into the update routine at some point already?
There was a problem hiding this comment.
No, because I wasn't sure how to. See my comment above:
libappstream also provides localized descriptions of all content ratings. I was not sure how to integrate this with flathub's approach to i18n. We could either try to hook into that. Or we could duplicate the code.
|
Looks promising, work should focus on the backend part for now |
e64f45b to
6e39838
Compare
|
|
|
Pushed something that has started to work, more problems are:
|
fcb8c3e to
2294889
Compare
See #114
I worked on this during GUADEC, and I am not sure if I will be able to continue working on this any further. Unfortunately I did not get it to a usable state, but I will try to note down all interesting details so someone else can pick this up and finish the remaining bits and pieces.
gnome-software worked on this a while ago and upstreamed its logic into libappstream (see ximion/appstream@18c8b18). There are some details to this that we should consider:
Accept-Languageheader, which is probably fine, but not a perfect match.violence-bloodshedreadily available. It is probably a good idea to look into what gnome-software does.