forked from benoitfragit/google2ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
google2ubuntu-manager.py
executable file
·47 lines (37 loc) · 1.28 KB
/
google2ubuntu-manager.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gi.repository import Gtk
from gi.repository import Notify
from gi.repository import Gdk
from gi.repository import Gio
from os.path import expanduser
import os
import sys
import subprocess
import gettext
import xml.etree.ElementTree as ET
sys.path.append(os.path.dirname(os.path.abspath(__file__))+'/librairy')
from MainWindow import *
from localehelper import LocaleHelper
localeHelper = LocaleHelper()
lang = localeHelper.getLocale()
t=gettext.translation('google2ubuntu',os.path.dirname(os.path.abspath(__file__))+'/i18n/',languages=[lang])
t.install()
#keep the old way for the moment
#gettext.install('google2ubuntu',os.path.dirname(os.path.abspath(__file__))+'/i18n/')
# application principale
class MyApplication(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self)
def do_activate(self):
win = MainWindow(self)
win.show_all()
localeHelper = LocaleHelper()
lang = localeHelper.getLocale()
t=gettext.translation('google2ubuntu',os.path.dirname(os.path.abspath(__file__))+'/i18n/',languages=[lang])
t.install()
def do_startup(self):
Gtk.Application.do_startup(self)
app = MyApplication()
exit_status = app.run(sys.argv)
sys.exit(exit_status)