diff --git a/create_potfiles_in.py b/create_potfiles_in.py index e500a0a06..d6d21bd4f 100755 --- a/create_potfiles_in.py +++ b/create_potfiles_in.py @@ -1,18 +1,25 @@ #!/usr/bin/env python import os +import re # Paths to exclude EXCLUSIONS = [ - "deluge/scripts" + "deluge/scripts", + "deluge/i18n", ] POTFILE_IN = "deluge/i18n/POTFILES.in" -print "Creating " + POTFILE_IN + " .." +pattern = "deluge\/plugins\/.*\/build" +compiled = re.compile(pattern) + +print "Creating " + POTFILE_IN + " ..." to_translate = [] for (dirpath, dirnames, filenames) in os.walk("deluge"): for filename in filenames: - if os.path.splitext(filename)[1] in (".py", ".glade") and dirpath not in EXCLUSIONS: + if os.path.splitext(filename)[1] in (".py", ".glade") \ + and dirpath not in EXCLUSIONS \ + and not compiled.match(dirpath): to_translate.append(os.path.join(dirpath, filename)) f = open(POTFILE_IN, "wb") diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.glade b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.glade index ea7167e9d..adde185ed 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.glade +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.glade @@ -1096,7 +1096,7 @@ also delete the .torrent file used to add it. True - Yes + gtk-yes True True False @@ -1112,7 +1112,7 @@ also delete the .torrent file used to add it. - No + gtk-no True True False @@ -1173,7 +1173,7 @@ also delete the .torrent file used to add it. True - Yes + gtk-yes True True False @@ -1189,7 +1189,7 @@ also delete the .torrent file used to add it. - No + gtk-no True True False diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.glade b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.glade index e051e64b1..33ab498bd 100644 --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.glade +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.glade @@ -84,7 +84,7 @@ - gtk-edit + gtk-edit True False True diff --git a/deluge/plugins/Label/deluge/plugins/label/data/label_options.glade b/deluge/plugins/Label/deluge/plugins/label/data/label_options.glade index 0316d2205..db13b57cb 100644 --- a/deluge/plugins/Label/deluge/plugins/label/data/label_options.glade +++ b/deluge/plugins/Label/deluge/plugins/label/data/label_options.glade @@ -549,10 +549,7 @@ True True - tracker1.org -tracker2.com -this doesn't do anything yet.. - + tracker1.org diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index a5f413d31..309e9123b 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -649,13 +649,13 @@ class AddTorrentDialog(component.Component): else: dialogs.ErrorDialog( _("Invalid URL"), - _("%s is not a valid URL." % url), + "%s %s" % (url, _("is not a valid URL.")), self.dialog ).run() def add_from_url(self, url): dialog = gtk.Dialog( - _("Downloading.."), + _("Downloading..."), flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR, parent=self.dialog) dialog.set_transient_for(self.dialog) @@ -698,7 +698,7 @@ class AddTorrentDialog(component.Component): log.debug("Download failed: %s", result) dialog.destroy() dialogs.ErrorDialog( - _("Download Failed"), _("Failed to download : %s" % url), + _("Download Failed"), "%s %s" % (_("Failed to download:"), url), details=result.getErrorMessage(), parent=self.dialog ).run() return result diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py index 6c13f4534..ce74f6db8 100644 --- a/deluge/ui/gtkui/createtorrentdialog.py +++ b/deluge/ui/gtkui/createtorrentdialog.py @@ -371,7 +371,7 @@ class CreateTorrentDialog: def _on_create_torrent_progress(self, value, num_pieces): percent = float(value)/float(num_pieces) pbar = self.glade.get_widget("progressbar") - pbar.set_text(_("%.2f%%") % (percent*100)) + pbar.set_text("%.2f%%" % (percent*100)) if percent >= 0 and percent <= 1.0: pbar.set_fraction(percent) diff --git a/deluge/ui/gtkui/glade/dgtkpopups.glade b/deluge/ui/gtkui/glade/dgtkpopups.glade index 78e4a48ff..68f2c4b0a 100644 --- a/deluge/ui/gtkui/glade/dgtkpopups.glade +++ b/deluge/ui/gtkui/glade/dgtkpopups.glade @@ -34,7 +34,7 @@ True 0 - label + label True diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 6f1b7c7ac..e3f645903 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -619,7 +619,7 @@ used sparingly. True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - page 6 + page 6 False @@ -741,7 +741,7 @@ used sparingly. True False 0 - 0000 + 0000 5 @@ -1146,7 +1146,7 @@ used sparingly. True True 4 - 0x00 + 0x00 False False True @@ -1524,7 +1524,7 @@ Disabled True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - page 7 + page 7 1 @@ -2098,7 +2098,7 @@ Disabled True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - page 8 + page 8 2 @@ -2831,7 +2831,7 @@ status tab (<b>EXPERIMENTAL!!!</b>) True False - page 10 + page 10 3 @@ -3205,7 +3205,7 @@ status tab (<b>EXPERIMENTAL!!!</b>) True False - page 11 + page 11 4 @@ -3573,7 +3573,7 @@ status tab (<b>EXPERIMENTAL!!!</b>) True False - page 11 + page 11 5 @@ -4119,7 +4119,7 @@ status tab (<b>EXPERIMENTAL!!!</b>) True False - page 12 + page 12 6 diff --git a/deluge/ui/gtkui/glade/tray_menu.glade b/deluge/ui/gtkui/glade/tray_menu.glade index ac983601f..504e2e7d2 100644 --- a/deluge/ui/gtkui/glade/tray_menu.glade +++ b/deluge/ui/gtkui/glade/tray_menu.glade @@ -144,7 +144,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-quit + gtk-quit True True diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index a29350597..d0a844b3c 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -81,7 +81,7 @@ class MenuBar(component.Component): item.set_name(menuitem) item.connect("activate", self.on_menuitem_set_unlimited) submenu.append(item) - item = gtk.MenuItem(_("Other..")) + item = gtk.MenuItem(_("Other...")) item.set_name(menuitem) item.connect("activate", self.on_menuitem_set_other) submenu.append(item) diff --git a/deluge/ui/gtkui/notification.py b/deluge/ui/gtkui/notification.py index 7e17fa9d2..3b8071512 100644 --- a/deluge/ui/gtkui/notification.py +++ b/deluge/ui/gtkui/notification.py @@ -82,8 +82,8 @@ class Notification: return title = deluge.common.xml_encode(_("Torrent complete")) message = deluge.common.xml_encode( - status["name"] + "\n" + - _("Including %i files" % status["num_files"]) + "%s\n%s %i %s" % (status["name"], + _("Including"), status["num_files"], _("files")) ) self.note = pynotify.Notification(title, message) self.note.set_icon_from_pixbuf(common.get_logo(48)) diff --git a/deluge/ui/gtkui/systemtray.py b/deluge/ui/gtkui/systemtray.py index 542a56db1..b12feb2c5 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -200,7 +200,7 @@ class SystemTray(component.Component): except Exception, e: log.debug("Unable to hide system tray menu widgets: %s", e) - self.tray.set_tooltip(_("Deluge\nNot Connected..")) + self.tray.set_tooltip(_("Deluge") + "\n" + _("Not Connected...")) def shutdown(self): if self.config["enable_system_tray"]: @@ -469,13 +469,13 @@ class SystemTray(component.Component): vbox = gtk.VBox(spacing=5) hbox.pack_start(vbox, False) - label = gtk.Label(_("Deluge is password protected!")) + label = gtk.Label("%s" % _("Deluge is password protected!")) label.set_use_markup(True) label.set_alignment(0.0, 0.5) label.set_line_wrap(True) vbox.pack_start(label, False) - tlabel = gtk.Label(_("Enter your password to continue")) + tlabel = gtk.Label("%s" % _("Enter your password to continue")) tlabel.set_use_markup(True) tlabel.set_alignment(0.0, 0.5) tlabel.set_line_wrap(True) diff --git a/gettextize.sh b/gettextize.sh index 056b0cf33..cc2d5ab00 100755 --- a/gettextize.sh +++ b/gettextize.sh @@ -1,9 +1,9 @@ #!/bin/sh -for x in `find . -name '*.glade' |grep -v '.svn\|build'` ; do \ +for x in `find . -name '*.glade' |grep -v '.git\|build'` ; do \ for y in gtk-add gtk-apply gtk-bold gtk-cancel gtk-cdrom gtk-clear \ - gtk-close gtk-color-picker gtk-convert gtk-copy gtk-cut \ + gtk-close gtk-color-picker gtk-connect gtk-convert gtk-copy gtk-cut \ gtk-delete gtk-dialog-error gtk-dialog-info gtk-dialog-question \ - gtk-dialog-warning gtk-dnd gtk-dnd-multiple gtk-execute gtk-find \ + gtk-dialog-warning gtk-dnd gtk-dnd-multiple gtk-edit gtk-execute gtk-find \ gtk-find-and-replace gtk-floppy gtk-goto-bottom gtk-goto-first \ gtk-goto-last gtk-goto-top gtk-go-back gtk-go-down gtk-go-forward \ gtk-go-up gtk-help gtk-home gtk-index gtk-italic gtk-jump-to \