59 "FORMS": [], |
59 "FORMS": [], |
60 } |
60 } |
61 for pattern, filetype in list(self.project.pdata["FILETYPES"].items()): |
61 for pattern, filetype in list(self.project.pdata["FILETYPES"].items()): |
62 if filetype in patterns: |
62 if filetype in patterns: |
63 patterns[filetype].append(pattern) |
63 patterns[filetype].append(pattern) |
64 self.filters = self.trUtf8("Source Files ({0});;")\ |
64 self.filters = self.tr("Source Files ({0});;")\ |
65 .format(" ".join(patterns["SOURCES"])) |
65 .format(" ".join(patterns["SOURCES"])) |
66 self.filters += self.trUtf8("Forms Files ({0});;")\ |
66 self.filters += self.tr("Forms Files ({0});;")\ |
67 .format(" ".join(patterns["FORMS"])) |
67 .format(" ".join(patterns["FORMS"])) |
68 self.filters += self.trUtf8("All Files (*)") |
68 self.filters += self.tr("All Files (*)") |
69 |
69 |
70 def initDialog(self): |
70 def initDialog(self): |
71 """ |
71 """ |
72 Public method to initialize the dialogs data. |
72 Public method to initialize the dialogs data. |
73 """ |
73 """ |
98 if not os.path.isabs(tp): |
98 if not os.path.isabs(tp): |
99 tp = Utilities.fromNativeSeparators( |
99 tp = Utilities.fromNativeSeparators( |
100 os.path.join(self.project.ppath, tp)) |
100 os.path.join(self.project.ppath, tp)) |
101 tsfile = E5FileDialog.getOpenFileName( |
101 tsfile = E5FileDialog.getOpenFileName( |
102 self, |
102 self, |
103 self.trUtf8("Select translation file"), |
103 self.tr("Select translation file"), |
104 tp, |
104 tp, |
105 "") |
105 "") |
106 |
106 |
107 if tsfile: |
107 if tsfile: |
108 self.transPatternEdit.setText(self.project.getRelativePath( |
108 self.transPatternEdit.setText(self.project.getRelativePath( |
127 if not os.path.isabs(tbp): |
127 if not os.path.isabs(tbp): |
128 tbp = Utilities.fromNativeSeparators( |
128 tbp = Utilities.fromNativeSeparators( |
129 os.path.join(self.project.ppath, tbp)) |
129 os.path.join(self.project.ppath, tbp)) |
130 directory = E5FileDialog.getExistingDirectory( |
130 directory = E5FileDialog.getExistingDirectory( |
131 self, |
131 self, |
132 self.trUtf8("Select directory for binary translations"), |
132 self.tr("Select directory for binary translations"), |
133 tbp) |
133 tbp) |
134 |
134 |
135 if directory: |
135 if directory: |
136 self.transBinPathEdit.setText(self.project.getRelativePath( |
136 self.transBinPathEdit.setText(self.project.getRelativePath( |
137 Utilities.toNativeSeparators(directory))) |
137 Utilities.toNativeSeparators(directory))) |
170 """ |
170 """ |
171 Private slot to select a file to exempt from translation. |
171 Private slot to select a file to exempt from translation. |
172 """ |
172 """ |
173 texcept = E5FileDialog.getOpenFileName( |
173 texcept = E5FileDialog.getOpenFileName( |
174 self, |
174 self, |
175 self.trUtf8("Exempt file from translation"), |
175 self.tr("Exempt file from translation"), |
176 self.project.ppath, |
176 self.project.ppath, |
177 self.filters) |
177 self.filters) |
178 if texcept: |
178 if texcept: |
179 self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept)) |
179 self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept)) |
180 |
180 |
183 """ |
183 """ |
184 Private slot to select a file to exempt from translation. |
184 Private slot to select a file to exempt from translation. |
185 """ |
185 """ |
186 texcept = E5FileDialog.getExistingDirectory( |
186 texcept = E5FileDialog.getExistingDirectory( |
187 self, |
187 self, |
188 self.trUtf8("Exempt directory from translation"), |
188 self.tr("Exempt directory from translation"), |
189 self.project.ppath, |
189 self.project.ppath, |
190 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
190 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) |
191 if texcept: |
191 if texcept: |
192 self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept)) |
192 self.exceptionEdit.setText(Utilities.toNativeSeparators(texcept)) |
193 |
193 |