Project/Project.py

branch
5_2_x
changeset 2283
9d75b64621e0
parent 1962
83c766a02142
child 2303
0ed4ed026c16
--- a/Project/Project.py	Fri Dec 21 08:24:31 2012 +0100
+++ b/Project/Project.py	Wed Dec 26 11:58:43 2012 +0100
@@ -2092,16 +2092,16 @@
                     if fnmatch.fnmatch(ts, pattern):
                         self.pdata["TRANSLATIONS"].append(ts)
                         self.projectLanguageAdded.emit(ts)
-            if self.pdata["TRANSLATIONSBINPATH"]:
-                tpd = os.path.join(self.ppath,
-                                   self.pdata["TRANSLATIONSBINPATH"][0])
-                pattern = os.path.splitext(
-                    os.path.basename(self.pdata["TRANSLATIONPATTERN"][0]))
-                pattern = self.__binaryTranslationFile(pattern)
-                qmlist = Utilities.direntries(tpd, True, pattern)
-                for qm in qmlist:
-                    self.pdata["TRANSLATIONS"].append(qm)
-                    self.projectLanguageAdded.emit(qm)
+                if self.pdata["TRANSLATIONSBINPATH"]:
+                    tpd = os.path.join(self.ppath,
+                                       self.pdata["TRANSLATIONSBINPATH"][0])
+                    pattern = os.path.basename(self.pdata["TRANSLATIONPATTERN"][0])\
+                        .replace("%language%", "*")
+                    pattern = self.__binaryTranslationFile(pattern)
+                    qmlist = Utilities.direntries(tpd, True, pattern)
+                    for qm in qmlist:
+                        self.pdata["TRANSLATIONS"].append(qm)
+                        self.projectLanguageAdded.emit(qm)
             if len(self.pdata["MAINSCRIPT"]) == 0 or \
                len(self.pdata["MAINSCRIPT"][0]) == 0:
                 if self.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]:

eric ide

mercurial