Preferences/ConfigurationPages/InterfacePage.py

changeset 3010
befeff46ec0f
parent 2964
84b65fb9e780
child 3025
67064c71df21
child 3057
10516539f238
equal deleted inserted replaced
3009:bf5ae5d7477d 3010:befeff46ec0f
204 configuration page. 204 configuration page.
205 """ 205 """
206 self.languageComboBox.clear() 206 self.languageComboBox.clear()
207 207
208 fnlist = glob.glob("eric5_*.qm") + \ 208 fnlist = glob.glob("eric5_*.qm") + \
209 glob.glob(os.path.join(getConfig('ericTranslationsDir'), "eric5_*.qm")) + \ 209 glob.glob(os.path.join(
210 getConfig('ericTranslationsDir'), "eric5_*.qm")) + \
210 glob.glob(os.path.join(Utilities.getConfigDir(), "eric5_*.qm")) 211 glob.glob(os.path.join(Utilities.getConfigDir(), "eric5_*.qm"))
211 locales = {} 212 locales = {}
212 for fn in fnlist: 213 for fn in fnlist:
213 locale = os.path.basename(fn)[6:-3] 214 locale = os.path.basename(fn)[6:-3]
214 if locale not in locales: 215 if locale not in locales:
215 translator = QTranslator() 216 translator = QTranslator()
216 translator.load(fn) 217 translator.load(fn)
217 locales[locale] = \ 218 locales[locale] = translator.translate(
218 translator.translate("InterfacePage", "English", 219 "InterfacePage", "English",
219 "Translate this with your language") + \ 220 "Translate this with your language") + \
220 " ({0})".format(locale) 221 " ({0})".format(locale)
221 localeList = sorted(list(locales.keys())) 222 localeList = sorted(list(locales.keys()))
222 try: 223 try:
223 uiLanguage = Preferences.getUILanguage() 224 uiLanguage = Preferences.getUILanguage()
224 if uiLanguage == "None" or uiLanguage is None: 225 if uiLanguage == "None" or uiLanguage is None:
244 """ 245 """
245 file = E5FileDialog.getOpenFileName( 246 file = E5FileDialog.getOpenFileName(
246 self, 247 self,
247 self.trUtf8("Select style sheet file"), 248 self.trUtf8("Select style sheet file"),
248 self.styleSheetEdit.text(), 249 self.styleSheetEdit.text(),
249 self.trUtf8("Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;" 250 self.trUtf8(
250 "All files (*)")) 251 "Qt Style Sheets (*.qss);;Cascading Style Sheets (*.css);;"
252 "All files (*)"))
251 253
252 if file: 254 if file:
253 self.styleSheetEdit.setText(Utilities.toNativeSeparators(file)) 255 self.styleSheetEdit.setText(Utilities.toNativeSeparators(file))
254 256
255 @pyqtSlot() 257 @pyqtSlot()

eric ide

mercurial