diff options
author | 2008-05-26 02:20:43 +0000 | |
---|---|---|
committer | 2008-05-26 02:20:43 +0000 | |
commit | d752b51b201f20547a1054f60442a2596e5c8073 (patch) | |
tree | 9f8690bb772c377b2f50fe493cdc820cd40029f1 | |
parent | adding gettext support written by Jesus Rivero (Neurogeek) (diff) | |
download | gli-d752b51b201f20547a1054f60442a2596e5c8073.tar.gz gli-d752b51b201f20547a1054f60442a2596e5c8073.tar.bz2 gli-d752b51b201f20547a1054f60442a2596e5c8073.zip |
committing changes to gtkfe in stages.
adding internalization support written by
Jesus Rivero (Neurogeek)
basically sets everything in gettext.
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/trunk@1904 f8877401-5920-0410-a79b-8e2d7e04ca0d
-rwxr-xr-x | src/fe/gtk/ProgressDialog.py | 12 | ||||
-rw-r--r-- | src/fe/gtk/RootPass.py | 16 | ||||
-rw-r--r-- | src/fe/gtk/StartupServices.py | 31 | ||||
-rw-r--r-- | src/fe/gtk/Timezone.py | 6 | ||||
-rw-r--r-- | src/fe/gtk/Users.py | 44 |
5 files changed, 54 insertions, 55 deletions
diff --git a/src/fe/gtk/ProgressDialog.py b/src/fe/gtk/ProgressDialog.py index 76e690a..0bdd99a 100755 --- a/src/fe/gtk/ProgressDialog.py +++ b/src/fe/gtk/ProgressDialog.py @@ -24,23 +24,23 @@ class ProgressDialog(gtk.Window): self.connect("destroy", self.destroy_event) self.set_default_size(500, -1) self.set_resizable(True) - self.set_title("Gentoo Linux Installer - Installation Progress") + self.set_title(_("Gentoo Linux Installer - Installation Progress")) self.set_modal(True) self.set_transient_for(controller.window) self.globalbox = gtk.VBox(False, 0) self.globalbox.set_border_width(10) hbox = gtk.HBox(False) - step_label = gtk.Label("Step:") + step_label = gtk.Label(_("Step:")) hbox.pack_start(step_label, expand=False, fill=False, padding=0) self.step_text = gtk.Label() - self.step_text.set_text("Step description here") + self.step_text.set_text(_("Step description here")) hbox.pack_start(self.step_text, expand=False, fill=False, padding=15) self.globalbox.pack_start(hbox, expand=True, fill=False, padding=0) self.progress_bar = gtk.ProgressBar() self.globalbox.pack_start(self.progress_bar, expand=True, fill=False, padding=5) hbox = gtk.HBox(True) - self.cancel_button = gtk.Button(label="_Cancel") + self.cancel_button = gtk.Button(label=_("_Cancel")) self.cancel_button.connect("clicked", self.cancel_clicked) if not self.callback: self.cancel_button.set_sensitive(False) @@ -74,7 +74,7 @@ class ProgressDialog(gtk.Window): step_descr = self.controller.cc.get_step_info(step_name) self.step_text.set_text(step_descr) self.progress_bar.set_fraction(0) - self.progress_bar.set_text("Working...") + self.progress_bar.set_text(_("Working...")) self.controller.cc.run_step(step_name) def poll_notifications(self): @@ -91,7 +91,7 @@ class ProgressDialog(gtk.Window): elif ntype == "int": if ndata == NEXT_STEP_READY: self.progress_bar.set_fraction(1) - self.progress_bar.set_text("Done") + self.progress_bar.set_text(_("Done")) if not len(self.install_steps): self.destroy() if self.callback: diff --git a/src/fe/gtk/RootPass.py b/src/fe/gtk/RootPass.py index 814035a..72894ed 100644 --- a/src/fe/gtk/RootPass.py +++ b/src/fe/gtk/RootPass.py @@ -10,13 +10,13 @@ from ProgressDialog import * class Panel(GLIScreen): - title = "Root Password" - _helptext = """ + title = _("Root Password") + _helptext = _(""" <b><u>Root Password</u></b> Enter the password for the root user in your new install. Enter it again to \ confirm it (to prevent typos). -""" +""") def __init__(self, controller): GLIScreen.__init__(self, controller) @@ -26,7 +26,7 @@ confirm it (to prevent typos). hbox = gtk.HBox(False, 0) label = gtk.Label() - label.set_markup('<b>Enter a root password</b>') + label.set_markup(_('<b>Enter a root password</b>')) hbox.pack_start(label, expand=False, fill=False, padding=5) vert.pack_start(hbox, expand=False, fill=False, padding=10) @@ -34,7 +34,7 @@ confirm it (to prevent typos). table.set_row_spacings(5) table.set_col_spacings(10) - label = gtk.Label("Password") + label = gtk.Label(_("Password")) label.set_alignment(0.0, 0.5) table.attach(label, 0, 1, 0, 1) self.entry_password = gtk.Entry() @@ -42,7 +42,7 @@ confirm it (to prevent typos). self.entry_password.set_visibility(False) table.attach(self.entry_password, 1, 2, 0, 1) - label = gtk.Label("Confirm") + label = gtk.Label(_("Confirm")) label.set_alignment(0.0, 0.5) table.attach(label, 0, 1, 1, 2) self.entry_confirm = gtk.Entry() @@ -69,11 +69,11 @@ confirm it (to prevent typos). root_hash = GLIUtility.hash_password(self.entry_password.get_text()) self.controller.install_profile.set_root_pass_hash(None, root_hash, None) else: - msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format="The passwords you entered do not match!") + msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format=_("The passwords you entered do not match!")) msgdlg.run() msgdlg.destroy() return - progress = ProgressDialog(self.controller, ("set_root_password", ), self.progress_callback) + progress = ProgressDialog(self.controller, (_("set_root_password"), ), self.progress_callback) progress.run() def progress_callback(self, result, data=None): diff --git a/src/fe/gtk/StartupServices.py b/src/fe/gtk/StartupServices.py index ba7060a..eb11d7d 100644 --- a/src/fe/gtk/StartupServices.py +++ b/src/fe/gtk/StartupServices.py @@ -7,20 +7,19 @@ import gtk import gobject import os from GLIScreen import * -from gettext import gettext as _ class Panel(GLIScreen): title = _("Startup Services") - _helptext = """ + _helptext = _(""" <b><u>Startup Services</u></b> On this screen, you can select services that you would like to startup at boot. \ -Common choices are sshd (remote access) and xdm (graphical login...choose this \ +Common choices are sshd (remote access) and xdm (graphical login... choose this \ for kdm, gdm, and entrance, as well). Only services that are provided by a \ package you already have installed and are not already in a runlevel are \ displayed. -""" +""") def __init__(self, controller): GLIScreen.__init__(self, controller) @@ -42,16 +41,16 @@ displayed. self.new_services.sort() self.choice_list = { - "alsasound": _(u"Loads ALSA modules and restores mixer levels"), - "apache": _(u"Common web server (version 1.x)"), - "apache2": _(u"Common web server (version 2.x)"), - "distccd": _(u"Allows your system to help other systems compile"), - "hdparm": _(u"Makes it easy to set drive parameters automatically at boot"), - "portmap": _(u"Necessary for mounting NFS shares"), - "proftpd": _(u"Common FTP server"), - "sshd": _(u"OpenSSH server (allows remote logins)"), - "xfs": _(u"X Font Server (available if xorg-x11 compiled with USE=font-server)"), - "xdm": _(u"Gives you a graphical login which then starts X") + "alsasound": _("Loads ALSA modules and restores mixer levels"), + "apache": _("Common web server (version 1.x)"), + "apache2": _("Common web server (version 2.x)"), + "distccd": _("Allows your system to help other systems compile"), + "hdparm": _("Makes it easy to set drive parameters automatically at boot"), + "portmap": _("Necessary for mounting NFS shares"), + "proftpd": _("Common FTP server"), + "sshd": _("OpenSSH server (allows remote logins)"), + "xfs": _("X Font Server (available if xorg-x11 compiled with USE=font-server)"), + "xdm": _("Gives you a graphical login which then starts X") } self.treedata = gtk.ListStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING) @@ -61,8 +60,8 @@ displayed. self.toggle_renderer.connect("toggled", self.flag_toggled) self.columns = [] self.columns.append(gtk.TreeViewColumn("", self.toggle_renderer, active=0)) - self.columns.append(gtk.TreeViewColumn("Service", gtk.CellRendererText(), text=1)) - self.columns.append(gtk.TreeViewColumn("Description", gtk.CellRendererText(), text=2)) + self.columns.append(gtk.TreeViewColumn(_("Service"), gtk.CellRendererText(), text=1)) + self.columns.append(gtk.TreeViewColumn(_("Description"), gtk.CellRendererText(), text=2)) for column in self.columns: # column.set_resizable(True) self.treeview.append_column(column) diff --git a/src/fe/gtk/Timezone.py b/src/fe/gtk/Timezone.py index fe01ca9..715a570 100644 --- a/src/fe/gtk/Timezone.py +++ b/src/fe/gtk/Timezone.py @@ -19,13 +19,13 @@ class Panel(GLIScreen): @license: GPL """ # Attributes: - title="Timezone" - _helptext = """ + title= _("Timezone") + _helptext = _(""" <b><u>Timezone</u></b> Pick your timezone. If you choose a local timezone, you'll want to choose "local" for the clock \ setting later on in the Other Settings screen. -""" +""") # Operations def __init__(self, controller): diff --git a/src/fe/gtk/Users.py b/src/fe/gtk/Users.py index 1d01904..becf4f9 100644 --- a/src/fe/gtk/Users.py +++ b/src/fe/gtk/Users.py @@ -19,11 +19,11 @@ class Panel(GLIScreen): """ # Attributes: - title="User Settings" + title = _("User Settings") columns = [] users = [] current_users=[] - _helptext = """ + _helptext = _(""" <b><u>Users</u></b> Working as root on a Unix/Linux system is dangerous and should be avoided as \ @@ -57,12 +57,12 @@ can also specify the user's home directory (default is /home/username), userid \ Make sure to click Accept Changes to save the changes to your user. They will \ then show up in the list. -""" +""") def __init__(self,controller): GLIScreen.__init__(self, controller) - content_str = "User screen!" + content_str = _("User screen!") vert = gtk.VBox(False, 0) vert.set_border_width(10) @@ -74,12 +74,12 @@ then show up in the list. self.treeview = gtk.TreeView(self.treedata) self.treeview.connect("cursor-changed", self.selection_changed) - self.columns.append(gtk.TreeViewColumn("Username ", gtk.CellRendererText(), text=1)) - self.columns.append(gtk.TreeViewColumn("Groups", gtk.CellRendererText(), text=2)) - self.columns.append(gtk.TreeViewColumn("Shell ", gtk.CellRendererText(), text=3)) - self.columns.append(gtk.TreeViewColumn("HomeDir ", gtk.CellRendererText(), text=4)) - self.columns.append(gtk.TreeViewColumn("UserID", gtk.CellRendererText(), text=5)) - self.columns.append(gtk.TreeViewColumn("Comment", gtk.CellRendererText(), text=6)) + self.columns.append(gtk.TreeViewColumn(_("Username "), gtk.CellRendererText(), text=1)) + self.columns.append(gtk.TreeViewColumn(_("Groups"), gtk.CellRendererText(), text=2)) + self.columns.append(gtk.TreeViewColumn(_("Shell "), gtk.CellRendererText(), text=3)) + self.columns.append(gtk.TreeViewColumn(_("HomeDir "), gtk.CellRendererText(), text=4)) + self.columns.append(gtk.TreeViewColumn(_("UserID"), gtk.CellRendererText(), text=5)) + self.columns.append(gtk.TreeViewColumn(_("Comment"), gtk.CellRendererText(), text=6)) col_num = 0 for column in self.columns: column.set_resizable(True) @@ -104,13 +104,13 @@ then show up in the list. #frame.add(frame_vert) hbox = gtk.HBox(False) - add = gtk.Button("Add user", stock=None) + add = gtk.Button(_("Add user"), stock=None) add.connect("clicked", self.addu, "add") add.set_size_request(150, -1) add.show() hbox.pack_start(add, expand=False, fill=False, padding=5) - delete = gtk.Button("Delete user", stock=None) + delete = gtk.Button(_("Delete user"), stock=None) delete.connect("clicked", self.delete, "delete") delete.set_size_request(150, -1) delete.show() @@ -147,7 +147,7 @@ then show up in the list. self.user = {} hbox = gtk.HBox(False, 0) - label = gtk.Label("Username") + label = gtk.Label(_("Username")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.username = gtk.Entry() @@ -158,7 +158,7 @@ then show up in the list. frame_vert.add(hbox) hbox = gtk.HBox(False, 0) - label = gtk.Label("Password") + label = gtk.Label(_("Password")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.password = gtk.Entry() @@ -169,7 +169,7 @@ then show up in the list. hbox.pack_start(self.password, expand=False, fill=False, padding=5) # reset button if they want to reset a user password that was # loaded from a user profile - self.reset_pass = gtk.Button("Reset loaded password") + self.reset_pass = gtk.Button(_("Reset loaded password")) self.reset_pass.connect("clicked", self.reset_userpass_from_profile, "reset loaded pass") self.reset_pass.set_size_request(150, 5) self.reset_pass.set_sensitive(False) @@ -177,7 +177,7 @@ then show up in the list. frame_vert.add(hbox) hbox = gtk.HBox(False, 0) - label = gtk.Label("Groups") + label = gtk.Label(_("Groups")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.groups = gtk.Entry() @@ -188,7 +188,7 @@ then show up in the list. frame_vert.add(hbox) hbox = gtk.HBox(False, 0) - label = gtk.Label("Shell") + label = gtk.Label(_("Shell")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.shell = gtk.Entry() @@ -199,7 +199,7 @@ then show up in the list. frame_vert.add(hbox) hbox = gtk.HBox(False, 0) - label = gtk.Label("HomeDir") + label = gtk.Label(_("HomeDir")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.homedir = gtk.Entry() @@ -210,7 +210,7 @@ then show up in the list. frame_vert.add(hbox) hbox = gtk.HBox(False, 0) - label = gtk.Label("UserID") + label = gtk.Label(_("UserID")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.userid = gtk.Entry() @@ -221,7 +221,7 @@ then show up in the list. frame_vert.add(hbox) hbox = gtk.HBox(False, 0) - label = gtk.Label("Comment") + label = gtk.Label(_("Comment")) label.set_size_request(100, -1) hbox.pack_start(label, expand=False, fill=False, padding=5) self.comment = gtk.Entry() @@ -229,13 +229,13 @@ then show up in the list. self.comment.set_size_request(150, -1) self.comment.set_name("comment") hbox.pack_start(self.comment, expand=False, fill=False, padding=5) - button = gtk.Button("Accept Changes") + button = gtk.Button(_("Accept Changes")) button.connect("clicked", self.add_edit_user, "add/edit user") button.set_size_request(150, -1) hbox.pack_start(button, expand=False, fill=False, padding=5) frame_vert.add(hbox) - label = gtk.Label("Add/Edit a user") + label = gtk.Label(_("Add/Edit a user")) vert.pack_start(frame_vert, expand=False, fill=False, padding=5) self.add_content(vert) |