GNOME Bugzilla – Bug 452315
i18n.TranslationDb implementation that handles comps.xml
Last modified: 2011-02-07 06:09:07 UTC
The comps.xml file is used to populate Categories/Groups in package management frontends. Examples are yum and 'pirut' (GUI). Below is a class that implements TranslationDb for use with Dogtail. It has dependancy on yum. -------------------------------------------------------------------------------- from yum.comps import Comps class CompsXMLTranslationDb(TranslationDb): def __init__(self, compsFile, language): _comps = Comps() _comps.add(compsFile) self._strings = {} # load all strings into a dictionary structure for g in _comps._groups.values(): if g.translated_name.has_key(language): self._strings[g.name] = g.translated_name[language] for c in _comps._categories.values(): if c.translated_name.has_key(language): self._strings[c.name] = c.translated_name[language] del _comps def getTranslationsOf(self, srcName): result = [] if self._strings.has_key(srcName): result.append(self._strings[srcName]) return result --------------------------------------------------------------------------------
dogtail development has been stalled and it has been unmaintained for a few years now. Maintainers don't have future development plan so i am closing bugs as WONTFIX. Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.