Localized g++ theme
Use gettext to get the GCC localized messages
This commit is contained in:
parent
f2df87b88c
commit
64c50cca00
1 changed files with 15 additions and 3 deletions
|
|
@ -1,9 +1,21 @@
|
|||
|
||||
def theme():
|
||||
import gettext
|
||||
import os
|
||||
|
||||
# get g++ version
|
||||
gv = os.popen("g++ -dumpversion").read().strip()
|
||||
|
||||
# get the current translations of gcc
|
||||
t = gettext.translation("gcc-"+gv)
|
||||
_ = t.ugettext
|
||||
# _("msg") will return the given message, translated
|
||||
|
||||
|
||||
return [
|
||||
[ "error", "red", "bold" ],
|
||||
[ "warning", "magenta", "bold" ],
|
||||
[ "note", "blue", "bold" ],
|
||||
[ _("error: "), "red", "bold" ],
|
||||
[ _("warning: "), "magenta", "bold" ],
|
||||
[ _("note: "), "blue", "bold" ],
|
||||
# [-Wflag]
|
||||
[ "\[-W.*\]", "magenta"],
|
||||
# Filename:line number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue