Index: translate/storage/factory.py =================================================================== --- translate/storage/factory.py (revision 7740) +++ translate/storage/factory.py (working copy) @@ -184,3 +184,21 @@ store = storeclass() return store +def supported_files(): + """Returns data about all supported files + + @return: list of type that include (name, extension, mimetypes) + @rtype: list + """ + + supported = [] + processed = [] + for supported_class in classes.itervalues(): + name = getattr(supported_class, "name", None) + if name is None or name in processed: + continue + processed.append(name) + extension = getattr(supported_class, "extension", None) + mimetype = getattr(supported_class, "mimetype", None) + supported.extend([(name, extension, mimetype)]) + return supported Index: translate/storage/mo.py =================================================================== --- translate/storage/mo.py (revision 7740) +++ translate/storage/mo.py (working copy) @@ -101,6 +101,9 @@ class mofile(base.TranslationStore): """A class representing a .mo file.""" UnitClass = mounit + name = "Gettext MO file" + extension = ("*.mo", "*.gmo") + mimetype = ("application/x-gettext-catalog", ) def __init__(self, inputfile=None, unitclass=mounit): self.UnitClass = unitclass base.TranslationStore.__init__(self, unitclass=unitclass) Index: translate/storage/pocommon.py =================================================================== --- translate/storage/pocommon.py (revision 7740) +++ translate/storage/pocommon.py (working copy) @@ -63,6 +63,10 @@ class pofile(base.TranslationStore, poheader.poheader): + name = "Gettext PO file" + extension = ("*.po", "*.pot") + mimetype = ("application/x-gettext-catalog", ) + def makeheader(self, **kwargs): """create a header for the given filename. arguments are specially handled, kwargs added as key: value pot_creation_date can be None (current date) or a value (datetime or string)