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

Added Ubuntu gettext domain support #28

Closed
wants to merge 2 commits into from

Conversation

Lt-Henry
Copy link

This patch may solve issue 854. There is room for improvment, sure, ie: gettext domain may be defined but not present, so some sort of heuristic may decide best avaialable translation (desktop vs gettext)

@ManuelSchneid3r
Copy link
Member

I have no clue what this is about. Is this available on all platforms or will we get problems if I merge this? Fedora, Opensuse, BSD, arch?

@ManuelSchneid3r
Copy link
Member

@Lt-Henry ?

@Lt-Henry
Copy link
Author

I've not tested.... but it just looks for a Ubuntu key inside .desktop file. Nothing should happen if the key does not exists. I mean, default translation is selected. It is safe for non Ubuntu distros.

@ManuelSchneid3r
Copy link
Member

What happens on systems like BSD?

@Lt-Henry
Copy link
Author

Lt-Henry commented Dec 3, 2020

The patch just looks for "X-Ubuntu-Gettext-Domain" key inside desktop, and gets a name and generic name using gettext, instead of names provided by current .desktop file. That key shouldn't be in any Linux or BSD distro but Ubuntu based ones.

@ManuelSchneid3r
Copy link
Member

Sure but this PR includes libintl.h. Which is GNU. A quick search scares me off:
https://www.google.com/search?q=libintl.h+on+bsd&rlz=1C5CHFA_enDE755DE755&oq=libintl.h+on+bsd&aqs=chrome..69i57.2394j1j7&sourceid=chrome&ie=UTF-8

@Lt-Henry
Copy link
Author

Lt-Henry commented Dec 4, 2020

TBH, I dont know what happens on FreeBSD. Should be some sort of gettext support but I have no idea. I didnt have BSD in mind when I wrote the patch.

  • The easy solution, is scope this patch in a macro detecting whenever it is being compiled on Linux/BSD. This is ugly :\
  • Maybe Qt has some portable wrap around gettext.

I'll take a look at that.

@ManuelSchneid3r
Copy link
Member

Afaik the desktop files have their own localization. No need for external l18n. Then

@ManuelSchneid3r
Copy link
Member

I'll close this one for now. See https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s05.html. Let me know what you think.

@ManuelSchneid3r
Copy link
Member

I reconsidered this one, if it makes problems on freebsd we could simply branch is using defines.

@ManuelSchneid3r
Copy link
Member

recent version is now using gettext I changed a lot of other things as well in a general overhaul. thank you for pointing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants