Gentoo Archives: gentoo-commits

From: "Preston Cody (codeman)" <codeman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gli r1904 - trunk/src/fe/gtk
Date: Mon, 26 May 2008 02:20:48
Message-Id: E1K0SKK-0000jl-DL@stork.gentoo.org
1 Author: codeman
2 Date: 2008-05-26 02:20:43 +0000 (Mon, 26 May 2008)
3 New Revision: 1904
4
5 Modified:
6 trunk/src/fe/gtk/ProgressDialog.py
7 trunk/src/fe/gtk/RootPass.py
8 trunk/src/fe/gtk/StartupServices.py
9 trunk/src/fe/gtk/Timezone.py
10 trunk/src/fe/gtk/Users.py
11 Log:
12
13 committing changes to gtkfe in stages.
14 adding internalization support written by
15 Jesus Rivero (Neurogeek)
16 basically sets everything in gettext.
17
18
19 Modified: trunk/src/fe/gtk/ProgressDialog.py
20 ===================================================================
21 --- trunk/src/fe/gtk/ProgressDialog.py 2008-05-26 01:55:03 UTC (rev 1903)
22 +++ trunk/src/fe/gtk/ProgressDialog.py 2008-05-26 02:20:43 UTC (rev 1904)
23 @@ -24,23 +24,23 @@
24 self.connect("destroy", self.destroy_event)
25 self.set_default_size(500, -1)
26 self.set_resizable(True)
27 - self.set_title("Gentoo Linux Installer - Installation Progress")
28 + self.set_title(_("Gentoo Linux Installer - Installation Progress"))
29 self.set_modal(True)
30 self.set_transient_for(controller.window)
31
32 self.globalbox = gtk.VBox(False, 0)
33 self.globalbox.set_border_width(10)
34 hbox = gtk.HBox(False)
35 - step_label = gtk.Label("Step:")
36 + step_label = gtk.Label(_("Step:"))
37 hbox.pack_start(step_label, expand=False, fill=False, padding=0)
38 self.step_text = gtk.Label()
39 - self.step_text.set_text("Step description here")
40 + self.step_text.set_text(_("Step description here"))
41 hbox.pack_start(self.step_text, expand=False, fill=False, padding=15)
42 self.globalbox.pack_start(hbox, expand=True, fill=False, padding=0)
43 self.progress_bar = gtk.ProgressBar()
44 self.globalbox.pack_start(self.progress_bar, expand=True, fill=False, padding=5)
45 hbox = gtk.HBox(True)
46 - self.cancel_button = gtk.Button(label="_Cancel")
47 + self.cancel_button = gtk.Button(label=_("_Cancel"))
48 self.cancel_button.connect("clicked", self.cancel_clicked)
49 if not self.callback:
50 self.cancel_button.set_sensitive(False)
51 @@ -74,7 +74,7 @@
52 step_descr = self.controller.cc.get_step_info(step_name)
53 self.step_text.set_text(step_descr)
54 self.progress_bar.set_fraction(0)
55 - self.progress_bar.set_text("Working...")
56 + self.progress_bar.set_text(_("Working..."))
57 self.controller.cc.run_step(step_name)
58
59 def poll_notifications(self):
60 @@ -91,7 +91,7 @@
61 elif ntype == "int":
62 if ndata == NEXT_STEP_READY:
63 self.progress_bar.set_fraction(1)
64 - self.progress_bar.set_text("Done")
65 + self.progress_bar.set_text(_("Done"))
66 if not len(self.install_steps):
67 self.destroy()
68 if self.callback:
69
70 Modified: trunk/src/fe/gtk/RootPass.py
71 ===================================================================
72 --- trunk/src/fe/gtk/RootPass.py 2008-05-26 01:55:03 UTC (rev 1903)
73 +++ trunk/src/fe/gtk/RootPass.py 2008-05-26 02:20:43 UTC (rev 1904)
74 @@ -10,13 +10,13 @@
75
76 class Panel(GLIScreen):
77
78 - title = "Root Password"
79 - _helptext = """
80 + title = _("Root Password")
81 + _helptext = _("""
82 <b><u>Root Password</u></b>
83
84 Enter the password for the root user in your new install. Enter it again to \
85 confirm it (to prevent typos).
86 -"""
87 +""")
88
89 def __init__(self, controller):
90 GLIScreen.__init__(self, controller)
91 @@ -26,7 +26,7 @@
92
93 hbox = gtk.HBox(False, 0)
94 label = gtk.Label()
95 - label.set_markup('<b>Enter a root password</b>')
96 + label.set_markup(_('<b>Enter a root password</b>'))
97 hbox.pack_start(label, expand=False, fill=False, padding=5)
98 vert.pack_start(hbox, expand=False, fill=False, padding=10)
99
100 @@ -34,7 +34,7 @@
101 table.set_row_spacings(5)
102 table.set_col_spacings(10)
103
104 - label = gtk.Label("Password")
105 + label = gtk.Label(_("Password"))
106 label.set_alignment(0.0, 0.5)
107 table.attach(label, 0, 1, 0, 1)
108 self.entry_password = gtk.Entry()
109 @@ -42,7 +42,7 @@
110 self.entry_password.set_visibility(False)
111 table.attach(self.entry_password, 1, 2, 0, 1)
112
113 - label = gtk.Label("Confirm")
114 + label = gtk.Label(_("Confirm"))
115 label.set_alignment(0.0, 0.5)
116 table.attach(label, 0, 1, 1, 2)
117 self.entry_confirm = gtk.Entry()
118 @@ -69,11 +69,11 @@
119 root_hash = GLIUtility.hash_password(self.entry_password.get_text())
120 self.controller.install_profile.set_root_pass_hash(None, root_hash, None)
121 else:
122 - msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format="The passwords you entered do not match!")
123 + msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format=_("The passwords you entered do not match!"))
124 msgdlg.run()
125 msgdlg.destroy()
126 return
127 - progress = ProgressDialog(self.controller, ("set_root_password", ), self.progress_callback)
128 + progress = ProgressDialog(self.controller, (_("set_root_password"), ), self.progress_callback)
129 progress.run()
130
131 def progress_callback(self, result, data=None):
132
133 Modified: trunk/src/fe/gtk/StartupServices.py
134 ===================================================================
135 --- trunk/src/fe/gtk/StartupServices.py 2008-05-26 01:55:03 UTC (rev 1903)
136 +++ trunk/src/fe/gtk/StartupServices.py 2008-05-26 02:20:43 UTC (rev 1904)
137 @@ -7,20 +7,19 @@
138 import gobject
139 import os
140 from GLIScreen import *
141 -from gettext import gettext as _
142
143 class Panel(GLIScreen):
144
145 title = _("Startup Services")
146 - _helptext = """
147 + _helptext = _("""
148 <b><u>Startup Services</u></b>
149
150 On this screen, you can select services that you would like to startup at boot. \
151 -Common choices are sshd (remote access) and xdm (graphical login...choose this \
152 +Common choices are sshd (remote access) and xdm (graphical login... choose this \
153 for kdm, gdm, and entrance, as well). Only services that are provided by a \
154 package you already have installed and are not already in a runlevel are \
155 displayed.
156 -"""
157 +""")
158
159 def __init__(self, controller):
160 GLIScreen.__init__(self, controller)
161 @@ -42,16 +41,16 @@
162 self.new_services.sort()
163
164 self.choice_list = {
165 - "alsasound": _(u"Loads ALSA modules and restores mixer levels"),
166 - "apache": _(u"Common web server (version 1.x)"),
167 - "apache2": _(u"Common web server (version 2.x)"),
168 - "distccd": _(u"Allows your system to help other systems compile"),
169 - "hdparm": _(u"Makes it easy to set drive parameters automatically at boot"),
170 - "portmap": _(u"Necessary for mounting NFS shares"),
171 - "proftpd": _(u"Common FTP server"),
172 - "sshd": _(u"OpenSSH server (allows remote logins)"),
173 - "xfs": _(u"X Font Server (available if xorg-x11 compiled with USE=font-server)"),
174 - "xdm": _(u"Gives you a graphical login which then starts X")
175 + "alsasound": _("Loads ALSA modules and restores mixer levels"),
176 + "apache": _("Common web server (version 1.x)"),
177 + "apache2": _("Common web server (version 2.x)"),
178 + "distccd": _("Allows your system to help other systems compile"),
179 + "hdparm": _("Makes it easy to set drive parameters automatically at boot"),
180 + "portmap": _("Necessary for mounting NFS shares"),
181 + "proftpd": _("Common FTP server"),
182 + "sshd": _("OpenSSH server (allows remote logins)"),
183 + "xfs": _("X Font Server (available if xorg-x11 compiled with USE=font-server)"),
184 + "xdm": _("Gives you a graphical login which then starts X")
185 }
186
187 self.treedata = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING)
188 @@ -61,8 +60,8 @@
189 self.toggle_renderer.connect("toggled", self.flag_toggled)
190 self.columns = []
191 self.columns.append(gtk.TreeViewColumn("", self.toggle_renderer, active=0))
192 - self.columns.append(gtk.TreeViewColumn("Service", gtk.CellRendererText(), text=1))
193 - self.columns.append(gtk.TreeViewColumn("Description", gtk.CellRendererText(), text=2))
194 + self.columns.append(gtk.TreeViewColumn(_("Service"), gtk.CellRendererText(), text=1))
195 + self.columns.append(gtk.TreeViewColumn(_("Description"), gtk.CellRendererText(), text=2))
196 for column in self.columns:
197 # column.set_resizable(True)
198 self.treeview.append_column(column)
199
200 Modified: trunk/src/fe/gtk/Timezone.py
201 ===================================================================
202 --- trunk/src/fe/gtk/Timezone.py 2008-05-26 01:55:03 UTC (rev 1903)
203 +++ trunk/src/fe/gtk/Timezone.py 2008-05-26 02:20:43 UTC (rev 1904)
204 @@ -19,13 +19,13 @@
205 @license: GPL
206 """
207 # Attributes:
208 - title="Timezone"
209 - _helptext = """
210 + title= _("Timezone")
211 + _helptext = _("""
212 <b><u>Timezone</u></b>
213
214 Pick your timezone. If you choose a local timezone, you'll want to choose "local" for the clock \
215 setting later on in the Other Settings screen.
216 -"""
217 +""")
218
219 # Operations
220 def __init__(self, controller):
221
222 Modified: trunk/src/fe/gtk/Users.py
223 ===================================================================
224 --- trunk/src/fe/gtk/Users.py 2008-05-26 01:55:03 UTC (rev 1903)
225 +++ trunk/src/fe/gtk/Users.py 2008-05-26 02:20:43 UTC (rev 1904)
226 @@ -19,11 +19,11 @@
227 """
228
229 # Attributes:
230 - title="User Settings"
231 + title = _("User Settings")
232 columns = []
233 users = []
234 current_users=[]
235 - _helptext = """
236 + _helptext = _("""
237 <b><u>Users</u></b>
238
239 Working as root on a Unix/Linux system is dangerous and should be avoided as \
240 @@ -57,12 +57,12 @@
241
242 Make sure to click Accept Changes to save the changes to your user. They will \
243 then show up in the list.
244 -"""
245 +""")
246
247 def __init__(self,controller):
248 GLIScreen.__init__(self, controller)
249
250 - content_str = "User screen!"
251 + content_str = _("User screen!")
252
253 vert = gtk.VBox(False, 0)
254 vert.set_border_width(10)
255 @@ -74,12 +74,12 @@
256
257 self.treeview = gtk.TreeView(self.treedata)
258 self.treeview.connect("cursor-changed", self.selection_changed)
259 - self.columns.append(gtk.TreeViewColumn("Username ", gtk.CellRendererText(), text=1))
260 - self.columns.append(gtk.TreeViewColumn("Groups", gtk.CellRendererText(), text=2))
261 - self.columns.append(gtk.TreeViewColumn("Shell ", gtk.CellRendererText(), text=3))
262 - self.columns.append(gtk.TreeViewColumn("HomeDir ", gtk.CellRendererText(), text=4))
263 - self.columns.append(gtk.TreeViewColumn("UserID", gtk.CellRendererText(), text=5))
264 - self.columns.append(gtk.TreeViewColumn("Comment", gtk.CellRendererText(), text=6))
265 + self.columns.append(gtk.TreeViewColumn(_("Username "), gtk.CellRendererText(), text=1))
266 + self.columns.append(gtk.TreeViewColumn(_("Groups"), gtk.CellRendererText(), text=2))
267 + self.columns.append(gtk.TreeViewColumn(_("Shell "), gtk.CellRendererText(), text=3))
268 + self.columns.append(gtk.TreeViewColumn(_("HomeDir "), gtk.CellRendererText(), text=4))
269 + self.columns.append(gtk.TreeViewColumn(_("UserID"), gtk.CellRendererText(), text=5))
270 + self.columns.append(gtk.TreeViewColumn(_("Comment"), gtk.CellRendererText(), text=6))
271 col_num = 0
272 for column in self.columns:
273 column.set_resizable(True)
274 @@ -104,13 +104,13 @@
275 #frame.add(frame_vert)
276
277 hbox = gtk.HBox(False)
278 - add = gtk.Button("Add user", stock=None)
279 + add = gtk.Button(_("Add user"), stock=None)
280 add.connect("clicked", self.addu, "add")
281 add.set_size_request(150, -1)
282 add.show()
283 hbox.pack_start(add, expand=False, fill=False, padding=5)
284
285 - delete = gtk.Button("Delete user", stock=None)
286 + delete = gtk.Button(_("Delete user"), stock=None)
287 delete.connect("clicked", self.delete, "delete")
288 delete.set_size_request(150, -1)
289 delete.show()
290 @@ -147,7 +147,7 @@
291 self.user = {}
292
293 hbox = gtk.HBox(False, 0)
294 - label = gtk.Label("Username")
295 + label = gtk.Label(_("Username"))
296 label.set_size_request(100, -1)
297 hbox.pack_start(label, expand=False, fill=False, padding=5)
298 self.username = gtk.Entry()
299 @@ -158,7 +158,7 @@
300 frame_vert.add(hbox)
301
302 hbox = gtk.HBox(False, 0)
303 - label = gtk.Label("Password")
304 + label = gtk.Label(_("Password"))
305 label.set_size_request(100, -1)
306 hbox.pack_start(label, expand=False, fill=False, padding=5)
307 self.password = gtk.Entry()
308 @@ -169,7 +169,7 @@
309 hbox.pack_start(self.password, expand=False, fill=False, padding=5)
310 # reset button if they want to reset a user password that was
311 # loaded from a user profile
312 - self.reset_pass = gtk.Button("Reset loaded password")
313 + self.reset_pass = gtk.Button(_("Reset loaded password"))
314 self.reset_pass.connect("clicked", self.reset_userpass_from_profile, "reset loaded pass")
315 self.reset_pass.set_size_request(150, 5)
316 self.reset_pass.set_sensitive(False)
317 @@ -177,7 +177,7 @@
318 frame_vert.add(hbox)
319
320 hbox = gtk.HBox(False, 0)
321 - label = gtk.Label("Groups")
322 + label = gtk.Label(_("Groups"))
323 label.set_size_request(100, -1)
324 hbox.pack_start(label, expand=False, fill=False, padding=5)
325 self.groups = gtk.Entry()
326 @@ -188,7 +188,7 @@
327 frame_vert.add(hbox)
328
329 hbox = gtk.HBox(False, 0)
330 - label = gtk.Label("Shell")
331 + label = gtk.Label(_("Shell"))
332 label.set_size_request(100, -1)
333 hbox.pack_start(label, expand=False, fill=False, padding=5)
334 self.shell = gtk.Entry()
335 @@ -199,7 +199,7 @@
336 frame_vert.add(hbox)
337
338 hbox = gtk.HBox(False, 0)
339 - label = gtk.Label("HomeDir")
340 + label = gtk.Label(_("HomeDir"))
341 label.set_size_request(100, -1)
342 hbox.pack_start(label, expand=False, fill=False, padding=5)
343 self.homedir = gtk.Entry()
344 @@ -210,7 +210,7 @@
345 frame_vert.add(hbox)
346
347 hbox = gtk.HBox(False, 0)
348 - label = gtk.Label("UserID")
349 + label = gtk.Label(_("UserID"))
350 label.set_size_request(100, -1)
351 hbox.pack_start(label, expand=False, fill=False, padding=5)
352 self.userid = gtk.Entry()
353 @@ -221,7 +221,7 @@
354 frame_vert.add(hbox)
355
356 hbox = gtk.HBox(False, 0)
357 - label = gtk.Label("Comment")
358 + label = gtk.Label(_("Comment"))
359 label.set_size_request(100, -1)
360 hbox.pack_start(label, expand=False, fill=False, padding=5)
361 self.comment = gtk.Entry()
362 @@ -229,13 +229,13 @@
363 self.comment.set_size_request(150, -1)
364 self.comment.set_name("comment")
365 hbox.pack_start(self.comment, expand=False, fill=False, padding=5)
366 - button = gtk.Button("Accept Changes")
367 + button = gtk.Button(_("Accept Changes"))
368 button.connect("clicked", self.add_edit_user, "add/edit user")
369 button.set_size_request(150, -1)
370 hbox.pack_start(button, expand=False, fill=False, padding=5)
371 frame_vert.add(hbox)
372
373 - label = gtk.Label("Add/Edit a user")
374 + label = gtk.Label(_("Add/Edit a user"))
375
376 vert.pack_start(frame_vert, expand=False, fill=False, padding=5)
377 self.add_content(vert)
378
379 --
380 gentoo-commits@l.g.o mailing list