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-2746: localize XDG desktop file #2298

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

phw
Copy link
Member

@phw phw commented Sep 5, 2023

Summary

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

Problem

The XDG desktop file (used for offering the menu entry on compliant desktop environments, e.g. on Linux and BSD) is currently not localized, but can be.

Solution

  • Move the org.musicbrainz.Picard.desktop file to a org.musicbrainz.Picard.desktop.in template file.
  • Extract the strings from there into po/appstream using msgfmt as part of regen_appdata_pot_file setup command.
  • Added the command build_desktop_file command for setup.py to compile the translated org.musicbrainz.Picard.desktop file from the org.musicbrainz.Picard.desktop.in template.

I decided here to use the same gettext resource for the desktop file as for the AppStream metadata. My reasoning is as follows:

  • Both provide metadata about the application
  • Both are from related freedesktop specifications
  • In both cases the translations are only ever used during build. The .po files never get separately compiled into .mo files and no translations files get installed onto the target system (as all translations become part of the generated file)
  • As the desktop file has only 3 short strings to translate it feels like too much overhead to maintain a separate translation resource. Both in the picard source code as well as in Weblate.

phw added 2 commits September 5, 2023 23:30
Share the translation resource for AppStream and desktop file. Both
provide metadata and the translations are only used during build
and never actually installed separately.
@phw phw assigned zas Sep 5, 2023
po/README.md Show resolved Hide resolved
@phw phw requested a review from zas September 5, 2023 22:14
@phw phw unassigned zas Sep 5, 2023
Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phw phw merged commit 6f46ebc into metabrainz:master Sep 6, 2023
@phw phw deleted the PICARD-2746-localize-desktop-file branch September 6, 2023 06:29
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