149 "Matlab": [QApplication.translate('Lexers', "Matlab"), |
149 "Matlab": [QApplication.translate('Lexers', "Matlab"), |
150 'dummy.m.matlab', "lexerMatlab.png"], |
150 'dummy.m.matlab', "lexerMatlab.png"], |
151 "Octave": [QApplication.translate('Lexers', "Octave"), |
151 "Octave": [QApplication.translate('Lexers', "Octave"), |
152 'dummy.m.octave', "lexerOctave.png"], |
152 'dummy.m.octave', "lexerOctave.png"], |
153 }) |
153 }) |
|
154 |
|
155 if QSCINTILLA_VERSION() >= 0x020802: |
|
156 supportedLanguages["Gettext"] = \ |
|
157 [QApplication.translate('Lexers', "Gettext"), 'dummy.po', |
|
158 "lexerGettext.png"] |
154 |
159 |
155 for name in LexerRegistry: |
160 for name in LexerRegistry: |
156 if not name.startswith("Pygments|"): |
161 if not name.startswith("Pygments|"): |
157 supportedLanguages[name] = \ |
162 supportedLanguages[name] = \ |
158 LexerRegistry[name][:2] + [LexerRegistry[name][6]] |
163 LexerRegistry[name][:2] + [LexerRegistry[name][6]] |
289 from .LexerOctave import LexerOctave |
294 from .LexerOctave import LexerOctave |
290 return LexerOctave(parent) |
295 return LexerOctave(parent) |
291 elif language == "QSS": |
296 elif language == "QSS": |
292 from .LexerQSS import LexerQSS |
297 from .LexerQSS import LexerQSS |
293 return LexerQSS(parent) |
298 return LexerQSS(parent) |
|
299 elif language == "Gettext": |
|
300 from .LexerPO import LexerPO |
|
301 return LexerPO(parent) |
294 |
302 |
295 elif language in LexerRegistry: |
303 elif language in LexerRegistry: |
296 return LexerRegistry[language][2](parent) |
304 return LexerRegistry[language][2](parent) |
297 |
305 |
298 else: |
306 else: |
455 QApplication.translate( |
463 QApplication.translate( |
456 'Lexers', |
464 'Lexers', |
457 'Octave Files (*.m *.m.octave)'), |
465 'Octave Files (*.m *.m.octave)'), |
458 ]) |
466 ]) |
459 |
467 |
|
468 if QSCINTILLA_VERSION() >= 0x020802: |
|
469 openFileFiltersList.append( |
|
470 QApplication.translate( |
|
471 'Lexers', |
|
472 'Gettext Files (*.po)'), |
|
473 ) |
|
474 |
460 for name in LexerRegistry: |
475 for name in LexerRegistry: |
461 openFileFiltersList.extend(LexerRegistry[name][3]) |
476 openFileFiltersList.extend(LexerRegistry[name][3]) |
462 |
477 |
463 if withAdditional: |
478 if withAdditional: |
464 openFileFiltersList.extend( |
479 openFileFiltersList.extend( |
645 'Matlab Files (*.m)'), |
660 'Matlab Files (*.m)'), |
646 QApplication.translate( |
661 QApplication.translate( |
647 'Lexers', |
662 'Lexers', |
648 'Octave Files (*.m.octave)'), |
663 'Octave Files (*.m.octave)'), |
649 ]) |
664 ]) |
|
665 |
|
666 if QSCINTILLA_VERSION() >= 0x020802: |
|
667 saveFileFiltersList.append( |
|
668 QApplication.translate( |
|
669 'Lexers', |
|
670 'Gettext Files (*.po)'), |
|
671 ) |
650 |
672 |
651 for name in LexerRegistry: |
673 for name in LexerRegistry: |
652 saveFileFiltersList.extend(LexerRegistry[name][4]) |
674 saveFileFiltersList.extend(LexerRegistry[name][4]) |
653 |
675 |
654 if withAdditional: |
676 if withAdditional: |
800 '*.m': "Matlab", |
822 '*.m': "Matlab", |
801 '*.m.matlab': "Matlab", |
823 '*.m.matlab': "Matlab", |
802 '*.m.octave': "Octave", |
824 '*.m.octave': "Octave", |
803 }) |
825 }) |
804 |
826 |
|
827 if QSCINTILLA_VERSION() >= 0x020802: |
|
828 assocs['*.po'] = "Gettext" |
|
829 |
805 for name in LexerRegistry: |
830 for name in LexerRegistry: |
806 for pattern in LexerRegistry[name][5]: |
831 for pattern in LexerRegistry[name][5]: |
807 assocs[pattern] = name |
832 assocs[pattern] = name |
808 |
833 |
809 return assocs |
834 return assocs |