--- a/QScintilla/Lexers/__init__.py Sun May 04 18:14:49 2014 +0200 +++ b/QScintilla/Lexers/__init__.py Mon May 05 19:27:30 2014 +0200 @@ -152,6 +152,11 @@ 'dummy.m.octave', "lexerOctave.png"], }) + if QSCINTILLA_VERSION() >= 0x020802: + supportedLanguages["Gettext"] = \ + [QApplication.translate('Lexers', "Gettext"), 'dummy.po', + "lexerGettext.png"] + for name in LexerRegistry: if not name.startswith("Pygments|"): supportedLanguages[name] = \ @@ -291,6 +296,9 @@ elif language == "QSS": from .LexerQSS import LexerQSS return LexerQSS(parent) + elif language == "Gettext": + from .LexerPO import LexerPO + return LexerPO(parent) elif language in LexerRegistry: return LexerRegistry[language][2](parent) @@ -457,6 +465,13 @@ 'Octave Files (*.m *.m.octave)'), ]) + if QSCINTILLA_VERSION() >= 0x020802: + openFileFiltersList.append( + QApplication.translate( + 'Lexers', + 'Gettext Files (*.po)'), + ) + for name in LexerRegistry: openFileFiltersList.extend(LexerRegistry[name][3]) @@ -648,6 +663,13 @@ 'Octave Files (*.m.octave)'), ]) + if QSCINTILLA_VERSION() >= 0x020802: + saveFileFiltersList.append( + QApplication.translate( + 'Lexers', + 'Gettext Files (*.po)'), + ) + for name in LexerRegistry: saveFileFiltersList.extend(LexerRegistry[name][4]) @@ -802,6 +824,9 @@ '*.m.octave': "Octave", }) + if QSCINTILLA_VERSION() >= 0x020802: + assocs['*.po'] = "Gettext" + for name in LexerRegistry: for pattern in LexerRegistry[name][5]: assocs[pattern] = name