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

feat: improve mime type definition #132

Merged
merged 1 commit into from
Dec 30, 2020
Merged

feat: improve mime type definition #132

merged 1 commit into from
Dec 30, 2020

Conversation

Janfel
Copy link
Contributor

@Janfel Janfel commented Dec 30, 2020

Proposed changes

  • Remove the xml:lang attribute from the <comment> element, as it causes systems to not display any comment in locales other than “en”, which is worse that displaying a generic english comment in such locales.
  • Make application/x-amgp a subclass of application/xml so it is automatically associated with XML editors and the application-xml icon.

This removes the counterproductive xml:lang attribute from <comment> and makes application/x-amgp a subclass of application/xml.
@gombosg
Copy link
Collaborator

gombosg commented Dec 30, 2020

Hi, thanks for the PR, I tested it and works great.

@pktiuk what about making profile open default to AntiMicroX? There is an antimicrox --profile option, I think it would be nice so that users could just double-click on profiles to open.

@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-amgp">
<comment xml:lang="en">AntiMicroX Profile</comment>
<comment>AntiMicroX profile</comment>
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to later add translations for other languages? Will it work?

For example:

<comment>AntiMicroX profile</comment>
<comment xml:lang="pl">profile programu AntiMicroX</comment>

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is: https://specifications.freedesktop.org/shared-mime-info-spec/latest/ar01s02.html#idm44983870071680

comment elements give a human-readable textual description of the MIME type, usually composed of an acronym of the file name extension and a short description, like "ODS spreadsheet". There may be many of these elements with different xml:lang attributes to provide the text in multiple languages.

With some translation magic like for the appdata file, it's doable, but I don't see this "comment" coming up anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment element is used by desktop environments and other graphical programs. The Dolphin file manager for example will display Testfile.txt (plain text document, 0B) when hovering over a text file, instead of Testfile.txt (text/plain, 0B).

Copy link
Member

Choose a reason for hiding this comment

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

I have checked this way of adding translations. It works in my case. (Ubuntu 20.04 Gnome, Nautilus)

@pktiuk
Copy link
Member

pktiuk commented Dec 30, 2020

@pktiuk what about making profile open default to AntiMicroX? There is an antimicrox --profile option, I think it would be nice so that users could just double-click on profiles to open.

This is great idea ❤️

@gombosg gombosg changed the title Improvement: Improve mime type definition. feat: improve mime type definition Dec 30, 2020
@pktiuk pktiuk merged commit d689309 into AntiMicroX:master Dec 30, 2020
@Janfel Janfel deleted the patch-1 branch December 30, 2020 12:32
@gombosg
Copy link
Collaborator

gombosg commented Dec 30, 2020

Thanks @Janfel for your contribution.

@pktiuk
Copy link
Member

pktiuk commented Dec 30, 2020

@Janfel
Thank you for your contribution.

Gallxz pushed a commit to Gallxz/antimicrox that referenced this pull request Oct 12, 2023
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.

3 participants