Closed Wuzzy2 closed 5 months ago
Are you sure this fixed it? The empty string is falsy in Python so the "if" statement in above commit might always think the condition is True
.
In Python, a if condition else b
is the same as condition ? a : b
in C++/JS
Also, I did test this
Sorry, I had a brainfart. Since the empty string is falsly, it must work, actually. It's OK.
Summary
If you hover a tag to get the tooltip or look at the description in the tag list in the package edit menu, for some tags, the description is the string for Gettext metadata.
It looks like this:
"Essen/Trinken: Project-Id-Version: PROJECT VERSION ..." and the string just goes on and on and on with lots of garbage.
Steps to reproduce
Alternative:
The result should be the same
Solution?
I'm pretty sure I know what is happening here without looking at the code.
I assume the offending tags have an empty description and ContentDB probably put them through a gettext call.
In Gettext, translating the empty string returns the metadata of the translation file, hence the garbage string with "Project-Id-Version", etc.
So the solution is that in the case of an empty string, do NOT pass it into gettext. Just return the empty string.