Fixed an issue adding existing binary translation files to a new project.

Wed, 26 Dec 2012 11:58:43 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 26 Dec 2012 11:58:43 +0100
changeset 2284
7812fbbc7d25
parent 2282
c4bf7c7a1198
child 2285
a6fc5bda1de9

Fixed an issue adding existing binary translation files to a new project.
(grafted from 9d75b64621e05fc6318cafc66f7b359059135ebf)

Project/Project.py file | annotate | diff | comparison | revisions
diff -r c4bf7c7a1198 -r 7812fbbc7d25 Project/Project.py
--- a/Project/Project.py	Sat Dec 22 15:16:59 2012 +0100
+++ b/Project/Project.py	Wed Dec 26 11:58:43 2012 +0100
@@ -2168,16 +2168,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