1 # -*- coding: utf-8 -*-
3 from __future__
import absolute_import
5 from optparse
import OptionParser
6 from jben
.app
import Application
7 from jben
import configure
8 import gettext
, locale
, os
10 def init_windows_locale():
11 """Sets expected environment variables for Windows.
13 If LANG is already specified, this will have no effect.
16 if "LANG" not in os
.environ
:
17 def_locale
, def_encoding
= locale
.getdefaultlocale()
18 os
.environ
["LANG"] = def_locale
21 """Initializes gettext globally."""
22 # This function may be replaced later to support dynamic language switching.
26 localedir
= os
.path
.join(configure
.datarootdir
, "locale")
27 gettext
.install("jben", localedir
=localedir
, unicode=True)
31 op
.set_defaults(interface
="gtk")
32 op
.add_option("-i", "--interface",
33 help=_("Select interface: gtk, console (default: %default)"))
34 return op
.parse_args()
40 (options
, args
) = parse_args()
41 app
= Application(interface
=options
.interface
)
44 if __name__
== "__main__":