Bug 12195 - Add mimetype for vala source code
Summary: Add mimetype for vala source code
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
: 12246 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-28 03:10 UTC by Sebastian Dröge (slomo)
Modified: 2007-09-04 07:04 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
vala.diff (606 bytes, patch)
2007-08-28 03:11 UTC, Sebastian Dröge (slomo)
Details | Splinter Review
updated patch with test case (1.61 KB, patch)
2007-08-31 11:55 UTC, Jürg Billeter
Details | Splinter Review
Heuristic message catalog patch (55.09 KB, application/x-gzip)
2007-09-01 03:03 UTC, Mathias Hasselmann
Details
The script for creating the message catalog patch. (990 bytes, text/x-python)
2007-09-01 03:05 UTC, Mathias Hasselmann
Details
updated patch (2.08 KB, patch)
2007-09-04 06:30 UTC, Jürg Billeter
Details | Splinter Review

Description Sebastian Dröge (slomo) 2007-08-28 03:10:31 UTC
Hi,
please consider applying the attached patch to shared-mime-info for the addition of a mimetype for vala source code.

http://live.gnome.org/Vala

Bye
Comment 1 Sebastian Dröge (slomo) 2007-08-28 03:11:19 UTC
Created attachment 11305 [details] [review]
vala.diff
Comment 2 Jürg Billeter 2007-08-31 11:55:24 UTC
Created attachment 11361 [details] [review]
updated patch with test case

I've changed the magic to be more specific so that it won't conflict with C# source code. I've also added a test case and checked that it's working.
Comment 3 Sebastian Dröge (slomo) 2007-08-31 12:23:12 UTC
Hm, your patch has the small problem that the magic would only match if using GLib; is at the beginning... if "using Gtk;" or similar is at the beginning the C# magic would match.
Comment 4 Jürg Billeter 2007-08-31 13:00:46 UTC
The magic code for C# and Vala can only catch the case where the using directive is at the beginning. Most source code files start with a license, so that won't work there. globs make a lot more sense for source code. The magic in my patch makes sense so that simple Vala files don't get misdetected as C#, else we'd need to remove the magic of both, Vala and C#, and just use globs.
Comment 5 Mathias Hasselmann 2007-09-01 02:14:31 UTC
*** Bug 12246 has been marked as a duplicate of this bug. ***
Comment 6 Mathias Hasselmann 2007-09-01 02:14:49 UTC
Maybe also translations adopted from C# (with "adopted" as in s/C#/Vala/) should be marged?
Comment 7 Mathias Hasselmann 2007-09-01 03:03:13 UTC
Created attachment 11374 [details]
Heuristic message catalog patch

This patch heuristically adds translations for the string "Vala source code".
Guess this works for most languages. Well, and if one translation is wrong
native speakers will complain soon.
Comment 8 Mathias Hasselmann 2007-09-01 03:05:11 UTC
Created attachment 11375 [details]
The script for creating the message catalog patch.

Maybe this script is useful for other database updates.
Comment 9 Jürg Billeter 2007-09-04 06:30:30 UTC
Created attachment 11407 [details] [review]
updated patch

I've removed the magic of both, Vala and C#, and also added a name-only test-case for C#, as discussed on IRC.
Comment 10 Bastien Nocera 2007-09-04 07:04:42 UTC
2007-08-31  Bastien Nocera  <hadess@hadess.net>

        * freedesktop.org.xml.in: Remove dubious C# magic, and add Vala
        mime-type, patch from Jürg Billeter <j@bitron.ch> (Closes: #12195)
        * tests/*: add C# and Vala test cases


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.