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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
#
# langauge_gui.py: installtime language selection.
#
# Copyright 2001 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
from gtk import *
from iw_gui import *
from translate import _, N_
class LanguageWindow (InstallWindow):
windowTitle = N_("Language Selection")
htmlTag = "lang"
def __init__ (self, ics):
InstallWindow.__init__ (self, ics)
def getNext (self):
self.instLang.setRuntimeLanguage(self.lang)
self.ics.getICW().setLanguage (self.instLang.getLangNick(self.lang))
return None
def select_row (self, clist, row, col, event):
if self.running:
self.lang = clist.get_row_data (clist.selection[0])
# LanguageWindow tag="lang"
def getScreen (self, intf, instLang):
self.running = 0
mainBox = GtkVBox (FALSE, 10)
hbox = GtkHBox(FALSE, 5)
pix = self.ics.readPixmap ("gnome-globe.png")
if pix:
a = GtkAlignment ()
a.add (pix)
a.set (0.0, 0.0, 0.0, 0.0)
hbox.pack_start (a, FALSE)
label = GtkLabel (_("What language would you like to use during the "
"installation process?"))
label.set_line_wrap (TRUE)
label.set_usize(350, -1)
hbox.pack_start(label, FALSE)
self.language = GtkCList ()
self.language.set_selection_mode (SELECTION_BROWSE)
self.language.connect ("select_row", self.select_row)
self.instLang = instLang
default = -1
n = 0
for locale in instLang.available():
row = self.language.append ((_(locale),))
self.language.set_row_data (row, locale)
if locale == instLang.getCurrent():
self.lang = locale
default = n
n = n + 1
if default > 0:
self.language.select_row (default, 0)
sw = GtkScrolledWindow ()
sw.set_border_width (5)
sw.set_policy (POLICY_NEVER, POLICY_NEVER)
sw.add (self.language)
mainBox.pack_start (hbox, FALSE, FALSE, 10)
mainBox.pack_start (sw, TRUE)
self.running = 1
return mainBox
|