From a75fa41c42a6369991013a1c7baeccc5c95967e5 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 00:14:59 +0100 Subject: [PATCH 1/8] update create_potfiles_in to ignore plugins build dir --- create_potfiles_in.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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") From 85d460294977cc08372f48982be4660d73066e29 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 01:08:04 +0100 Subject: [PATCH 2/8] Fix translated string in addtorrentdialog --- deluge/ui/gtkui/addtorrentdialog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index a6a05b712..260cb3afe 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -619,11 +619,11 @@ class AddTorrentDialog(component.Component): elif deluge.common.is_magnet(url): self.add_from_magnets([url]) else: - dialogs.ErrorDialog(_("Invalid URL"), _("%s is not a valid URL." % url), self.dialog).run() + dialogs.ErrorDialog(_("Invalid 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) @@ -665,7 +665,7 @@ class AddTorrentDialog(component.Component): else: log.debug("Download failed: %s", result) dialog.destroy() - dialogs.ErrorDialog(_("Download Failed"), _("Failed to download : %s" % url), + dialogs.ErrorDialog(_("Download Failed"), "%s %s" % (_("Failed to download:"), url), details=result.getErrorMessage(), parent=self.dialog).run() return result From 36d5ff5040649f3f25153b678bc751b12f52e509 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 01:21:40 +0100 Subject: [PATCH 3/8] Fix translate string in notifications plugin --- deluge/ui/gtkui/notification.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deluge/ui/gtkui/notification.py b/deluge/ui/gtkui/notification.py index fe2d1e0e9..21980d607 100644 --- a/deluge/ui/gtkui/notification.py +++ b/deluge/ui/gtkui/notification.py @@ -77,7 +77,7 @@ class Notification: if not pynotify.init("Deluge"): return title = deluge.common.xml_encode(_("Torrent complete")) - message = deluge.common.xml_encode(status["name"] + "\n" + _("Including %i files" % status["num_files"])) + message = deluge.common.xml_encode("%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)) if not self.note.show(): From 263b10ffd274b53cd804c2a7052e8ba93d555ae7 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 02:24:10 +0100 Subject: [PATCH 4/8] Update gettextize to ignore .git folder --- gettextize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gettextize.sh b/gettextize.sh index 056b0cf33..459ba4362 100755 --- a/gettextize.sh +++ b/gettextize.sh @@ -1,5 +1,5 @@ #!/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-delete gtk-dialog-error gtk-dialog-info gtk-dialog-question \ From 7232dc4b015daf7f57b6dca7546bf8d15667dd28 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 02:31:29 +0100 Subject: [PATCH 5/8] Add gtk-* items to gettextize --- gettextize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gettextize.sh b/gettextize.sh index 459ba4362..cc2d5ab00 100755 --- a/gettextize.sh +++ b/gettextize.sh @@ -1,9 +1,9 @@ #!/bin/sh 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 \ From af058bbdc7126fd1fba6b99b8a3db78b9d7c27bd Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 02:32:25 +0100 Subject: [PATCH 6/8] Change translatable to No for gtk stock labels --- deluge/plugins/autoadd/autoadd/data/config.glade | 2 +- deluge/ui/gtkui/glade/connection_manager.glade | 2 +- deluge/ui/gtkui/glade/edit_trackers.glade | 2 +- deluge/ui/gtkui/glade/main_window.glade | 4 ++-- deluge/ui/gtkui/glade/tray_menu.glade | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deluge/plugins/autoadd/autoadd/data/config.glade b/deluge/plugins/autoadd/autoadd/data/config.glade index e051e64b1..33ab498bd 100644 --- a/deluge/plugins/autoadd/autoadd/data/config.glade +++ b/deluge/plugins/autoadd/autoadd/data/config.glade @@ -84,7 +84,7 @@ - gtk-edit + gtk-edit True False True diff --git a/deluge/ui/gtkui/glade/connection_manager.glade b/deluge/ui/gtkui/glade/connection_manager.glade index af4129507..3104bee81 100644 --- a/deluge/ui/gtkui/glade/connection_manager.glade +++ b/deluge/ui/gtkui/glade/connection_manager.glade @@ -491,7 +491,7 @@ True True True - gtk-connect + gtk-connect True 0 diff --git a/deluge/ui/gtkui/glade/edit_trackers.glade b/deluge/ui/gtkui/glade/edit_trackers.glade index 2a6269196..587f2980e 100644 --- a/deluge/ui/gtkui/glade/edit_trackers.glade +++ b/deluge/ui/gtkui/glade/edit_trackers.glade @@ -119,7 +119,7 @@ True True True - gtk-edit + gtk-edit True 0 diff --git a/deluge/ui/gtkui/glade/main_window.glade b/deluge/ui/gtkui/glade/main_window.glade index 411cd5644..b02d79f52 100644 --- a/deluge/ui/gtkui/glade/main_window.glade +++ b/deluge/ui/gtkui/glade/main_window.glade @@ -84,7 +84,7 @@ - gtk-quit + gtk-quit True True True @@ -105,7 +105,7 @@ True - gtk-preferences + gtk-preferences True True True 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 From 30d91f17dc97340f35ba67c7e0fe38744132eee2 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 02:58:06 +0100 Subject: [PATCH 7/8] Remove page x from translatable in pref_diaog glade --- deluge/ui/gtkui/glade/preferences_dialog.glade | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 76c71ce58..205039da0 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -493,7 +493,7 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - page 6 + page 6 False @@ -1282,7 +1282,7 @@ Disabled True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - page 7 + page 7 1 @@ -1781,7 +1781,7 @@ Disabled True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - page 8 + page 8 2 @@ -2187,7 +2187,7 @@ Disabled True - page 10 + page 10 3 @@ -2521,7 +2521,7 @@ Disabled True - page 11 + page 11 4 @@ -2748,7 +2748,7 @@ Disabled True - page 11 + page 11 5 @@ -3225,7 +3225,7 @@ Disabled True - page 12 + page 12 6 From e54f6c84d6cd1828c7be5510f631553a32e83a10 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 3 Jun 2011 19:01:20 +0100 Subject: [PATCH 8/8] Fix translations texts in glade and python files --- .../plugins/autoadd/autoadd/data/autoadd_options.glade | 10 +++++----- deluge/plugins/label/label/data/label_options.glade | 5 +---- deluge/ui/gtkui/createtorrentdialog.py | 2 +- deluge/ui/gtkui/glade/dgtkpopups.glade | 2 +- deluge/ui/gtkui/glade/preferences_dialog.glade | 4 ++-- deluge/ui/gtkui/menubar.py | 2 +- deluge/ui/gtkui/systemtray.py | 6 +++--- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/deluge/plugins/autoadd/autoadd/data/autoadd_options.glade b/deluge/plugins/autoadd/autoadd/data/autoadd_options.glade index 3ec79b716..49b93b531 100644 --- a/deluge/plugins/autoadd/autoadd/data/autoadd_options.glade +++ b/deluge/plugins/autoadd/autoadd/data/autoadd_options.glade @@ -29,7 +29,7 @@ True 0.46000000834465027 - Error + gtk-dialog-error True @@ -833,7 +833,7 @@ True - Yes + gtk-yes True True False @@ -846,7 +846,7 @@ - No + gtk-no True True False @@ -901,7 +901,7 @@ True - Yes + gtk-yes True True False @@ -914,7 +914,7 @@ - No + gtk-no True True False diff --git a/deluge/plugins/label/label/data/label_options.glade b/deluge/plugins/label/label/data/label_options.glade index 0316d2205..db13b57cb 100644 --- a/deluge/plugins/label/label/data/label_options.glade +++ b/deluge/plugins/label/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/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py index f794b761b..38f1078ac 100644 --- a/deluge/ui/gtkui/createtorrentdialog.py +++ b/deluge/ui/gtkui/createtorrentdialog.py @@ -370,7 +370,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 205039da0..189c81793 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -601,7 +601,7 @@ True 0 - 0000 + 0000 5 @@ -949,7 +949,7 @@ True True 4 - 0x00 + 0x00 False diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py index f4c8f62d8..8677ba67a 100644 --- a/deluge/ui/gtkui/menubar.py +++ b/deluge/ui/gtkui/menubar.py @@ -78,7 +78,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/systemtray.py b/deluge/ui/gtkui/systemtray.py index cb10370fa..41c6f3265 100644 --- a/deluge/ui/gtkui/systemtray.py +++ b/deluge/ui/gtkui/systemtray.py @@ -198,7 +198,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"]: @@ -467,13 +467,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)