Add some localization
This commit is contained in:
parent
470bb6d9e1
commit
f43bba94ad
@ -21,22 +21,29 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import getopt
|
import getopt
|
||||||
|
import gettext
|
||||||
|
|
||||||
|
|
||||||
|
gettext.bindtextdomain('relational')
|
||||||
|
gettext.textdomain('relational')
|
||||||
|
_ = gettext.gettext
|
||||||
|
|
||||||
|
|
||||||
version = "3.1"
|
version = "3.1"
|
||||||
|
|
||||||
|
|
||||||
def printver(exit=True):
|
def printver(exit=True):
|
||||||
print ("Relational %s" % version)
|
print ("Relational %s" % version)
|
||||||
print ("Copyright (C) 2008-2020 Salvo 'LtWorf' Tomaselli.")
|
print (_("Copyright (C) 2008-2020 Salvo 'LtWorf' Tomaselli.\n"
|
||||||
print ()
|
"\n"
|
||||||
print ("This program comes with ABSOLUTELY NO WARRANTY.")
|
"This program comes with ABSOLUTELY NO WARRANTY.\n"
|
||||||
print ("This is free software, and you are welcome to redistribute it")
|
"This is free software, and you are welcome to redistribute it\n"
|
||||||
print ("under certain conditions.")
|
"under certain conditions.\n"
|
||||||
print ("For details see the GPLv3 Licese.")
|
"For details see the GPLv3 Licese.\n"
|
||||||
print ()
|
"\n"
|
||||||
print ("Written by Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>")
|
"Written by Salvo 'LtWorf' Tomaselli <tiposchi@tiscali.it>\n"
|
||||||
print ()
|
"\n"
|
||||||
print ("https://ltworf.github.io/relational/")
|
"https://ltworf.github.io/relational/"))
|
||||||
if exit:
|
if exit:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
@ -46,15 +53,10 @@ def printhelp(code=0):
|
|||||||
print ()
|
print ()
|
||||||
print ("Usage: %s [options] [files]" % sys.argv[0])
|
print ("Usage: %s [options] [files]" % sys.argv[0])
|
||||||
print ()
|
print ()
|
||||||
print (" -v Print version and exits")
|
print (_(' -v Print version and exits'))
|
||||||
print (" -h Print this help and exits")
|
print (_(' -h Print this help and exits'))
|
||||||
|
print (_(' -q Uses Qt user interface'))
|
||||||
if sys.argv[0].endswith('relational-cli'):
|
print (_(' -r Uses readline user interface'))
|
||||||
print (" -q Uses QT user interface")
|
|
||||||
print (" -r Uses readline user interface (default)")
|
|
||||||
else:
|
|
||||||
print (" -q Uses QT user interface (default)")
|
|
||||||
print (" -r Uses readline user interface")
|
|
||||||
sys.exit(code)
|
sys.exit(code)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@ -87,8 +89,7 @@ if __name__ == "__main__":
|
|||||||
from relational_gui import guihandler, about, surveyForm
|
from relational_gui import guihandler, about, surveyForm
|
||||||
except:
|
except:
|
||||||
print (
|
print (
|
||||||
"Module relational_gui is missing.\n"
|
_('Module relational_gui is missing.\nPlease install relational package or run make.'),
|
||||||
"Please install relational package or run make.",
|
|
||||||
file=sys.stderr
|
file=sys.stderr
|
||||||
)
|
)
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
@ -124,7 +125,7 @@ if __name__ == "__main__":
|
|||||||
printver(False)
|
printver(False)
|
||||||
except:
|
except:
|
||||||
print (
|
print (
|
||||||
"Module relational_readline is missing.\nPlease install relational-cli package.",
|
_('Module relational_readline is missing.\nPlease install relational-cli package.'),
|
||||||
file=sys.stderr
|
file=sys.stderr
|
||||||
)
|
)
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
Loading…
Reference in New Issue
Block a user