Bug 492665 - "Plasma Addons" moved to "Extra's" but old entry not removed
Summary: "Plasma Addons" moved to "Extra's" but old entry not removed
Status: CONFIRMED
Alias: None
Product: Discover
Classification: Applications
Component: discover (other bugs)
Version First Reported In: 6.0.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-05 05:39 UTC by PK
Modified: 2024-09-16 14:03 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Entry "Plasma Widgets" (addons) now empty (arrow) (266.19 KB, image/jpeg)
2024-09-05 05:39 UTC, PK
Details

Note You need to log in before you can comment on or make changes to this bug.
Description PK 2024-09-05 05:39:30 UTC
Created attachment 173334 [details]
Entry "Plasma Widgets" (addons) now empty (arrow)

The entry "Plasma Addons" (that we translated as "Plasma Widgets") is moved to "Extra's" but the old entry is not removed and still there in the interface. Empty now.
Comment 1 Nate Graham 2024-09-05 18:53:54 UTC
Can reproduce on master with `LANGUAGE=nl_NL plasma-discover`.

Maybe the old strings need to be purged from the .po files?
Comment 2 Luigi Toscano 2024-09-05 18:55:37 UTC
(In reply to Nate Graham from comment #1)
> Maybe the old strings need to be purged from the .po files?

Which old strings, and which is the affected file? If the old strings are not valid anymore, they are not used.
Comment 3 Nate Graham 2024-09-05 19:29:44 UTC
$ grep -ri "Plasma widgets" po/*nl*
po/nl/libdiscover.po:msgstr "Plasma Widgets"
po/nl/libdiscover.po:msgid "Plasma Widgets"

I have a vague recollection that we build the UI based on the strings, but I'll let Harald comment on that.
Comment 4 Albert Astals Cid 2024-09-05 20:24:19 UTC
> Maybe the old strings need to be purged from the .po files?

Which old strings?

libdiscover/backends/PackageKitBackend/packagekit-backend-categories.xml

has Plasma Widgets listed there.
Comment 5 Harald Sitter 2024-09-05 23:06:56 UTC
Oh what fun. So what is going on is that Plasma Addons is translated as two different strings this then results in the categories not getting merged and since they are not getting merged one of them is just dangling around. If the translations were the same this bug would disappear. I guess this is a variant of the non-unique translation bug I fixed a while ago, except in this case the strings are too unique 😭'

Unsure what to do about it though. A unit test probably makes no sense globally because depending on context the same string could require translation as different strings. Removing the Menu entries from the packagekit categories would mean we don't get the widgets enumerated when there is no kns backend or the system is offline. Detecting that there are categories that should be merged (as per english) but aren't (as per locale) would probably require quite a refactor since we'd need to carry around both C and $locale strings for categories.

#: libdiscover/backends/KNSBackend/KNSBackend.cpp:277
#, kde-format
msgid "Plasma Addons"
msgstr "Plasma Extra's"

#: libdiscover/backends/PackageKitBackend/packagekit-backend-categories.xml:556
#, kde-format
msgctxt "Category"
msgid "Plasma Addons"
msgstr "Plasma Widgets"
Comment 6 PK 2024-09-06 05:05:18 UTC
I started Discover with LANGUAGE=en_US and noticed that the base folder is called "Plasma Addons" and that in this folder there is the subfolder "Plasma Widgets". And that seems pretty good in my eyes.

Doesn't the solution of the problem lie with us then? We would be happy to contribute.
Comment 7 Albert Astals Cid 2024-09-06 08:22:32 UTC
> Unsure what to do about it though.

If code needs both translations to be exactly the same, code should be using just one string and not two, i.e. add the "Category" context to the KNSBackend.cpp:277 string