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

LXQtTranslateDesktop.cmake doesn't support yet the freedesktop reverse DNS files naming convention #87

Open
redtide opened this issue Jul 10, 2023 · 4 comments

Comments

@redtide
Copy link

redtide commented Jul 10, 2023

From the version 1.2 of the freedesktop' desktop entry specification, a File naming section was added, to define a convention by using a reversed DNS form. This is also used by AppStream and implemented on some software. Until now I personally tested it only with AppImage, but still using it for my applications.

Unfortunately LXQtTranslateDesktop.cmake doesn't support this, but just gave for grant that the first part of the filename is the name of the translation to process.

Expected Behavior

The module should find a way to extract the correct part of the filename to build the final YAML filename to pass to LXQtTranslateDesktopYaml.pl to be processed and so inserted in the resulting desktop file.

Current Behavior

Said above, it extract the first "token" of the name, e.g.:
lx-image.desktop => lx-image

Possible Solution

Possibly by just prepend the country code to .desktop.yaml
(appname_it.desktop.yaml and tld.domain.appname_it.desktop.yaml).
See here, though not much elegant changes.

Steps to Reproduce (for bugs)
# lx-image.desktop:
get_filename_component(_inFile   ${_inFile} ABSOLUTE) # /path/to/lx-image.desktop.in
get_filename_component(_fileName ${_inFile} NAME_WE)  # lx-image
get_filename_component(_fileExt  ${_inFile} EXT)      # .desktop after the next line

on line 74 the result is passed to the perl script with a ${_fileName}[_.]*${_fileExt}.yaml,
e.g.: lx-image_it.desktop.yaml

The same process using org.mydomain.myappname.desktop.in results in a org_it.mydomain.myappname.desktop.yaml instead of org.mydomain.myappname_it.desktop.yaml

Context

See above.

System Information

Irrelevant.

@stefonarch
Copy link
Member

stefonarch commented Jul 12, 2023

If we would decide to follow the specs for (at least) the application desktop files (Qps, LXImage-qt, QTerminal, LXQt-archiver, Screengrab and PCmanFM-qt) resolving this issue is mandatory.

Example: org.lxqt_project.Qterminal.desktop, org.lxqt_project.ScreenGrab.desktop and so on. Not really sure about the underscore and uppercase as I see in /usr/share/applications/ org.qt-project.qtcreator.desktop for example, and kde uses lowercase everyhwere, but the spec is clear about that.

One advantage would be that LXQt applications are grouped together.

@stefonarch
Copy link
Member

stefonarch commented Jul 12, 2023

I made a test (without underscore) for Qps lxqt/qps#440 and it looks that it picks up fine the translations here :

$ cat /usr/share/applications/org.lxqt-project.qps.desktop 
[Desktop Entry]
Exec=qps
TryExec=qps
Type=Application
Icon=qps
Categories=System;
Terminal=false
StartupNotify=false

Name=qps
GenericName=Qt process manager
Comment=Qt application to display and manage running processes
Name[ar]=مدير عمليات Qt
GenericName[ar]=مدير عمليات Qt

...

Edit: I had a patch installed for build-tools - it doesn't build the translations indeed so this issue is valid if we want to move to the standard.

@redtide
Copy link
Author

redtide commented Jul 12, 2023

Example: org.lxqt_project.Qterminal.desktop, org.lxqt_project.ScreenGrab.desktop and so on. Not really sure about the underscore and uppercase

It's almost described in this spec page, but it's not clear if snake_case instead CamelCase is tolerated:

The domain name should be followed by the name of the application, which is conventionally written with words run together and initial capital letters (CamelCase).

I use snake_case instead CamelCase, at least I saw other well known applications using it, but still not sure if it's some KDE/Gnome exception.

About dashes and underscores:

Well-known names containing the dash are allowed but not recommended, because the dash is not allowed in some related uses of reversed DNS names, such as D-Bus object paths and interface names, and Flatpak app IDs. If the author's domain name contains a dash, replacing it with an underscore is recommended: this cannot cause ambiguity, because underscores are not allowed in DNS domain names.

@stefonarch
Copy link
Member

General discussion about the format to use: lxqt/lxqt#2448

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

No branches or pull requests

2 participants