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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion other/io.github.antimicrox.antimicrox.xml
Original file line number Diff line number Diff line change
@@ -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)

<sub-class-of type="application/xml"/>
<glob pattern="*.amgp"/>
</mime-type>
</mime-info>