Index: trunk/translate/storage/factory.py =================================================================== --- trunk.orig/translate/storage/factory.py +++ trunk/translate/storage/factory.py @@ -184,3 +184,21 @@ def getobject(storefile, ignore=None): 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: trunk/translate/storage/mo.py =================================================================== --- trunk.orig/translate/storage/mo.py +++ trunk/translate/storage/mo.py @@ -101,6 +101,9 @@ class mounit(base.TranslationUnit): 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: trunk/translate/storage/pocommon.py =================================================================== --- trunk.orig/translate/storage/pocommon.py +++ trunk/translate/storage/pocommon.py @@ -63,6 +63,10 @@ class pounit(base.TranslationUnit): 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)