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

PICARD-2958: Handle gettext being called with empty string #2540

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

phw
Copy link
Member

@phw phw commented Aug 27, 2024

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

Calling gettext("") by default returns the header of the PO file for the current locale. This is unexpected. Return an empty string instead.

While PICARD-2958 effectively only happens on the 2.x branch due to recent refactorings of itemviews, the behavior of gettext itself is unexpected and can easily cause similar issues.

Solution

Update the gettext wrapper to return an empty string if the input was an empty string.

Calling gettext("") by default returns the header of the PO file for the
current locale. This is unexpected. Return an empty string instead.
@phw phw requested a review from zas August 27, 2024 16:49
@phw phw merged commit 3c52fc2 into metabrainz:master Aug 27, 2024
44 checks passed
@phw phw deleted the fix-gettext-empty-string branch August 27, 2024 17:57
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

Successfully merging this pull request may close these issues.

2 participants