Translation preparation and some webgui code
This commit is contained in:
@@ -14,6 +14,7 @@ Configuration file located at ~/.config/ymsgui.conf:
|
||||
import os
|
||||
import sys
|
||||
import locale
|
||||
import gettext
|
||||
import configparser
|
||||
|
||||
import gi
|
||||
@@ -89,9 +90,12 @@ def messagebox(messagetext, symbol=None, title=None, parent=None):
|
||||
|
||||
if __name__ == "__main__":
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
gettext.bindtextdomain('ymsgui', 'locale')
|
||||
gettext.textdomain('ymsgui')
|
||||
_ = gettext.gettext
|
||||
config = configparser.ConfigParser()
|
||||
if not config.read(os.path.expanduser(cfg['cfgfile'])):
|
||||
messagebox("Configuration file not found", title="YMS")
|
||||
messagebox(_("Configuration file not found"), title="YMS")
|
||||
else:
|
||||
cfg['host'] = config.get('DB', 'host')
|
||||
cfg['db'] = config.get('DB', 'db')
|
||||
@@ -103,6 +107,6 @@ if __name__ == "__main__":
|
||||
app.run()
|
||||
db.disconnect()
|
||||
else:
|
||||
messagebox("Database connection cannot be established", title="YMS")
|
||||
messagebox(_("Database connection cannot be established"), title="YMS")
|
||||
|
||||
# Another fine product of the sirius cybernetics corporation
|
||||
|
||||
Reference in New Issue
Block a user