[qooxdoo-commit] SF.net SVN: qooxdoo:[15523] trunk/qooxdoo/tool/pylib/generator
Brought to you by:
ecker,
martinwittemann
From: <th...@us...> - 2008-08-12 15:55:46
|
Revision: 15523 http://qooxdoo.svn.sourceforge.net/qooxdoo/?rev=15523&view=rev Author: thron7 Date: 2008-08-12 15:55:43 +0000 (Tue, 12 Aug 2008) Log Message: ----------- [BUG #1098] fixed issue with empty 'translation' folder Modified Paths: -------------- trunk/qooxdoo/tool/pylib/generator/Generator.py trunk/qooxdoo/tool/pylib/generator/action/Locale.py Modified: trunk/qooxdoo/tool/pylib/generator/Generator.py =================================================================== --- trunk/qooxdoo/tool/pylib/generator/Generator.py 2008-08-12 15:14:08 UTC (rev 15522) +++ trunk/qooxdoo/tool/pylib/generator/Generator.py 2008-08-12 15:55:43 UTC (rev 15523) @@ -100,6 +100,7 @@ _classes = {} _docs = {} _translations = {} + _libs = {} if not isinstance(library, types.ListType): return (_namespaces, _classes, _docs, _translations) @@ -139,6 +140,7 @@ _classes.update(classes) _docs.update(path.getDocs()) _translations[namespace] = path.getTranslations() + _libs[namespace] = entry memcache[key] = path @@ -146,7 +148,7 @@ self._console.debug("Loaded %s libraries" % len(_namespaces)) self._console.debug("") - return (_namespaces, _classes, _docs, _translations) + return (_namespaces, _classes, _docs, _translations, _libs) @@ -366,7 +368,8 @@ self._classes, self._docs, #self._translations) = self.scanLibrary(config.extract("library")) - self._translations) = self.scanLibrary(config.get("library")) + self._translations, + self._libs) = self.scanLibrary(config.get("library")) # Create tool chain instances self._treeLoader = TreeLoader(self._classes, self._cache, self._console) @@ -543,7 +546,9 @@ self._console.info("Updating translations...") self._console.indent() for namespace in namespaces: - self._locale.updateTranslations(namespace, locales) + lib = self._libs[namespace] + self._locale.updateTranslations(namespace, os.path.join(lib['path'],lib['translation']), + locales) self._console.outdent() Modified: trunk/qooxdoo/tool/pylib/generator/action/Locale.py =================================================================== --- trunk/qooxdoo/tool/pylib/generator/action/Locale.py 2008-08-12 15:14:08 UTC (rev 15522) +++ trunk/qooxdoo/tool/pylib/generator/action/Locale.py 2008-08-12 15:55:43 UTC (rev 15523) @@ -68,19 +68,19 @@ - def updateTranslations(self, namespace, localesList=None): + def updateTranslations(self, namespace, translationDir, localesList=None): self._console.info("Updating namespace: %s" % namespace) self._console.indent() self._console.debug("Looking up relevant class files...") - content = [] + classList = [] classes = self._classes for classId in classes: if classes[classId]["namespace"] == namespace: - content.append(classId) + classList.append(classId) self._console.debug("Compiling filter...") - pot = self.getPotFile(content) + pot = self.getPotFile(classList) pot.sort() allfiles = self._translation[namespace] @@ -90,8 +90,7 @@ filenames = localesList for name in filenames: if name not in allfiles: - path = allfiles[allfiles.keys()[0]]['path'] - path = os.path.join(os.path.dirname(path), name + ".po") + path = os.path.join(translationDir, name + ".po") f = open(path, 'w') # create stanza file pof = self.createPoFile() f.write(str(pof)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |