Localize the Desktop file

Conflicts:

	setup.py
This commit is contained in:
Calum Lind 2011-07-13 21:49:25 +01:00
parent bf145c0715
commit 15ef668fef
8 changed files with 78 additions and 2992 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ dist
*.tar.*
_trial_temp
deluge/i18n/*
*.desktop

21
check_glade.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
# Fixes glade files which may have set gtk stock labels set to translatable
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-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-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 \
gtk-justify-center gtk-justify-fill gtk-justify-left gtk-missing-image \
gtk-new gtk-no gtk-ok gtk-open gtk-paste gtk-preferences gtk-print \
gtk-print-preview gtk-properties gtk-quit gtk-redo gtk-refresh \
gtk-remove gtk-revert-to-saved gtk-save gtk-save-as gtk-select-color \
gtk-select-font gtk-sort-descending gtk-spell-check gtk-stop \
gtk-strikethrough gtk-undelete gtk-underline gtk-undo gtk-yes \
gtk-zoom-100 gtk-zoom-fit gtk-zoom-in gtk-zoom-out; do \
sed -i "s/<property\ name\=\"label\"\ translatable\=\"yes\">$y<\/property>/<property\ name\=\"label\"\ translatable\=\"no\">$y<\/property>/g" $x; \
done;\
done

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
import os
import re
import sys
# Paths to exclude
EXCLUSIONS = [
"deluge/scripts",
@ -13,11 +13,12 @@ POTFILE_IN = "deluge/i18n/POTFILES.in"
pattern = "deluge\/plugins\/.*\/build"
compiled = re.compile(pattern)
print "Creating " + POTFILE_IN + " ..."
sys.stdout.write("Creating " + POTFILE_IN + " ... ")
sys.stdout.flush()
to_translate = []
for (dirpath, dirnames, filenames) in os.walk("deluge"):
for filename in filenames:
if os.path.splitext(filename)[1] in (".py", ".glade") \
if os.path.splitext(filename)[1] in (".py", ".glade", ".in") \
and dirpath not in EXCLUSIONS \
and not compiled.match(dirpath):
to_translate.append(os.path.join(dirpath, filename))

View File

@ -1,264 +0,0 @@
deluge/event.py
deluge/httpdownloader.py
deluge/common.py
deluge/main.py
deluge/metafile.py
deluge/log.py
deluge/pluginmanagerbase.py
deluge/config.py
deluge/__rpcapi.py
deluge/__init__.py
deluge/component.py
deluge/maketorrent.py
deluge/_libtorrent.py
deluge/decorators.py
deluge/bencode.py
deluge/rencode.py
deluge/configmanager.py
deluge/error.py
deluge/tests/test_common.py
deluge/tests/test_core.py
deluge/tests/common.py
deluge/tests/test_alertmanager.py
deluge/tests/test_decorators.py
deluge/tests/test_plugin_metadata.py
deluge/tests/test_log.py
deluge/tests/test_sessionproxy.py
deluge/tests/__init__.py
deluge/tests/test_client.py
deluge/tests/test_tracker_icons.py
deluge/tests/test_component.py
deluge/tests/test_httpdownloader.py
deluge/tests/test_maketorrent.py
deluge/tests/test_config.py
deluge/tests/test_authmanager.py
deluge/plugins/init.py
deluge/plugins/pluginbase.py
deluge/plugins/__init__.py
deluge/plugins/Feeder/setup.py
deluge/plugins/Feeder/deluge/__init__.py
deluge/plugins/Feeder/deluge/plugins/__init__.py
deluge/plugins/Feeder/deluge/plugins/feeder/webui.py
deluge/plugins/Feeder/deluge/plugins/feeder/__init__.py
deluge/plugins/Feeder/deluge/plugins/feeder/core.py
deluge/plugins/WebUi/setup.py
deluge/plugins/WebUi/deluge/__init__.py
deluge/plugins/WebUi/deluge/plugins/__init__.py
deluge/plugins/WebUi/deluge/plugins/webui/common.py
deluge/plugins/WebUi/deluge/plugins/webui/__init__.py
deluge/plugins/WebUi/deluge/plugins/webui/gtkui.py
deluge/plugins/WebUi/deluge/plugins/webui/core.py
deluge/plugins/WebUi/deluge/plugins/webui/data/config.glade
deluge/plugins/Extractor/setup.py
deluge/plugins/Extractor/deluge/__init__.py
deluge/plugins/Extractor/deluge/plugins/__init__.py
deluge/plugins/Extractor/deluge/plugins/extractor/common.py
deluge/plugins/Extractor/deluge/plugins/extractor/webui.py
deluge/plugins/Extractor/deluge/plugins/extractor/__init__.py
deluge/plugins/Extractor/deluge/plugins/extractor/gtkui.py
deluge/plugins/Extractor/deluge/plugins/extractor/core.py
deluge/plugins/Extractor/deluge/plugins/extractor/data/extractor_prefs.glade
deluge/plugins/Scheduler/setup.py
deluge/plugins/Scheduler/deluge/__init__.py
deluge/plugins/Scheduler/deluge/plugins/__init__.py
deluge/plugins/Scheduler/deluge/plugins/scheduler/common.py
deluge/plugins/Scheduler/deluge/plugins/scheduler/webui.py
deluge/plugins/Scheduler/deluge/plugins/scheduler/__init__.py
deluge/plugins/Scheduler/deluge/plugins/scheduler/gtkui.py
deluge/plugins/Scheduler/deluge/plugins/scheduler/core.py
deluge/plugins/Notifications/setup.py
deluge/plugins/Notifications/deluge/__init__.py
deluge/plugins/Notifications/deluge/plugins/__init__.py
deluge/plugins/Notifications/deluge/plugins/notifications/common.py
deluge/plugins/Notifications/deluge/plugins/notifications/webui.py
deluge/plugins/Notifications/deluge/plugins/notifications/__init__.py
deluge/plugins/Notifications/deluge/plugins/notifications/test.py
deluge/plugins/Notifications/deluge/plugins/notifications/gtkui.py
deluge/plugins/Notifications/deluge/plugins/notifications/core.py
deluge/plugins/Notifications/deluge/plugins/notifications/data/config.glade
deluge/plugins/Blocklist/setup.py
deluge/plugins/Blocklist/deluge/__init__.py
deluge/plugins/Blocklist/deluge/plugins/__init__.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/common.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/webui.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/peerguardian.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/__init__.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/decompressers.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/readers.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/detect.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/gtkui.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/core.py
deluge/plugins/Blocklist/deluge/plugins/blocklist/data/blocklist_pref.glade
deluge/plugins/Stats/setup.py
deluge/plugins/Stats/deluge/__init__.py
deluge/plugins/Stats/deluge/plugins/__init__.py
deluge/plugins/Stats/deluge/plugins/stats/test_total.py
deluge/plugins/Stats/deluge/plugins/stats/common.py
deluge/plugins/Stats/deluge/plugins/stats/webui.py
deluge/plugins/Stats/deluge/plugins/stats/graph.py
deluge/plugins/Stats/deluge/plugins/stats/__init__.py
deluge/plugins/Stats/deluge/plugins/stats/test.py
deluge/plugins/Stats/deluge/plugins/stats/gtkui.py
deluge/plugins/Stats/deluge/plugins/stats/core.py
deluge/plugins/Stats/deluge/plugins/stats/data/config.glade
deluge/plugins/Stats/deluge/plugins/stats/data/tabs.glade
deluge/plugins/Execute/setup.py
deluge/plugins/Execute/deluge/__init__.py
deluge/plugins/Execute/deluge/plugins/__init__.py
deluge/plugins/Execute/deluge/plugins/execute/common.py
deluge/plugins/Execute/deluge/plugins/execute/webui.py
deluge/plugins/Execute/deluge/plugins/execute/__init__.py
deluge/plugins/Execute/deluge/plugins/execute/gtkui.py
deluge/plugins/Execute/deluge/plugins/execute/core.py
deluge/plugins/Execute/deluge/plugins/execute/data/execute_prefs.glade
deluge/plugins/Toggle/setup.py
deluge/plugins/Toggle/deluge/__init__.py
deluge/plugins/Toggle/deluge/plugins/__init__.py
deluge/plugins/Toggle/deluge/plugins/toggle/common.py
deluge/plugins/Toggle/deluge/plugins/toggle/webui.py
deluge/plugins/Toggle/deluge/plugins/toggle/__init__.py
deluge/plugins/Toggle/deluge/plugins/toggle/gtkui.py
deluge/plugins/Toggle/deluge/plugins/toggle/core.py
deluge/plugins/Example/setup.py
deluge/plugins/Example/deluge/__init__.py
deluge/plugins/Example/deluge/plugins/__init__.py
deluge/plugins/Example/deluge/plugins/example/common.py
deluge/plugins/Example/deluge/plugins/example/webui.py
deluge/plugins/Example/deluge/plugins/example/__init__.py
deluge/plugins/Example/deluge/plugins/example/gtkui.py
deluge/plugins/Example/deluge/plugins/example/core.py
deluge/plugins/FreeSpace/setup.py
deluge/plugins/FreeSpace/deluge/__init__.py
deluge/plugins/FreeSpace/deluge/plugins/__init__.py
deluge/plugins/FreeSpace/deluge/plugins/freespace/common.py
deluge/plugins/FreeSpace/deluge/plugins/freespace/webui.py
deluge/plugins/FreeSpace/deluge/plugins/freespace/__init__.py
deluge/plugins/FreeSpace/deluge/plugins/freespace/gtkui.py
deluge/plugins/FreeSpace/deluge/plugins/freespace/core.py
deluge/plugins/FreeSpace/deluge/plugins/freespace/data/config.glade
deluge/plugins/AutoAdd/setup.py
deluge/plugins/AutoAdd/deluge/__init__.py
deluge/plugins/AutoAdd/deluge/plugins/__init__.py
deluge/plugins/AutoAdd/deluge/plugins/autoadd/common.py
deluge/plugins/AutoAdd/deluge/plugins/autoadd/webui.py
deluge/plugins/AutoAdd/deluge/plugins/autoadd/__init__.py
deluge/plugins/AutoAdd/deluge/plugins/autoadd/gtkui.py
deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py
deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/autoadd_options.glade
deluge/plugins/AutoAdd/deluge/plugins/autoadd/data/config.glade
deluge/plugins/Label/setup.py
deluge/plugins/Label/deluge/__init__.py
deluge/plugins/Label/deluge/plugins/__init__.py
deluge/plugins/Label/deluge/plugins/label/webui.py
deluge/plugins/Label/deluge/plugins/label/__init__.py
deluge/plugins/Label/deluge/plugins/label/test.py
deluge/plugins/Label/deluge/plugins/label/core.py
deluge/plugins/Label/deluge/plugins/label/gtkui/submenu.py
deluge/plugins/Label/deluge/plugins/label/gtkui/__init__.py
deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py
deluge/plugins/Label/deluge/plugins/label/gtkui/label_config.py
deluge/plugins/Label/deluge/plugins/label/data/label_options.glade
deluge/plugins/Label/deluge/plugins/label/data/label_pref.glade
deluge/core/eventmanager.py
deluge/core/torrent.py
deluge/core/oldstateupgrader.py
deluge/core/authmanager.py
deluge/core/__init__.py
deluge/core/torrentmanager.py
deluge/core/alertmanager.py
deluge/core/filtermanager.py
deluge/core/preferencesmanager.py
deluge/core/rpcserver.py
deluge/core/daemon.py
deluge/core/core.py
deluge/core/pluginmanager.py
deluge/ui/ui.py
deluge/ui/common.py
deluge/ui/coreconfig.py
deluge/ui/countries.py
deluge/ui/__init__.py
deluge/ui/sessionproxy.py
deluge/ui/client.py
deluge/ui/Win32IconImagePlugin.py
deluge/ui/tracker_icons.py
deluge/ui/web/common.py
deluge/ui/web/gen_gettext.py
deluge/ui/web/json_api.py
deluge/ui/web/web.py
deluge/ui/web/__init__.py
deluge/ui/web/server.py
deluge/ui/web/auth.py
deluge/ui/web/pluginmanager.py
deluge/ui/gtkui/peers_tab.py
deluge/ui/gtkui/queuedtorrents.py
deluge/ui/gtkui/common.py
deluge/ui/gtkui/mainwindow.py
deluge/ui/gtkui/systemtray.py
deluge/ui/gtkui/notification.py
deluge/ui/gtkui/options_tab.py
deluge/ui/gtkui/new_release_dialog.py
deluge/ui/gtkui/torrentdetails.py
deluge/ui/gtkui/preferences.py
deluge/ui/gtkui/addtorrentdialog.py
deluge/ui/gtkui/createtorrentdialog.py
deluge/ui/gtkui/statusbar.py
deluge/ui/gtkui/__init__.py
deluge/ui/gtkui/removetorrentdialog.py
deluge/ui/gtkui/listview.py
deluge/ui/gtkui/edittrackersdialog.py
deluge/ui/gtkui/ipcinterface.py
deluge/ui/gtkui/piecesbar.py
deluge/ui/gtkui/details_tab.py
deluge/ui/gtkui/filtertreeview.py
deluge/ui/gtkui/aboutdialog.py
deluge/ui/gtkui/toolbar.py
deluge/ui/gtkui/sidebar.py
deluge/ui/gtkui/connectionmanager.py
deluge/ui/gtkui/gtkui.py
deluge/ui/gtkui/status_tab.py
deluge/ui/gtkui/menubar.py
deluge/ui/gtkui/files_tab.py
deluge/ui/gtkui/dialogs.py
deluge/ui/gtkui/torrentview.py
deluge/ui/gtkui/pluginmanager.py
deluge/ui/gtkui/glade/remove_torrent_dialog2.glade
deluge/ui/console/commander.py
deluge/ui/console/main.py
deluge/ui/console/eventlog.py
deluge/ui/console/__init__.py
deluge/ui/console/colors.py
deluge/ui/console/statusbars.py
deluge/ui/console/modes/legacy.py
deluge/ui/console/modes/alltorrents.py
deluge/ui/console/modes/format_utils.py
deluge/ui/console/modes/column.py
deluge/ui/console/modes/torrent_actions.py
deluge/ui/console/modes/preferences.py
deluge/ui/console/modes/torrentdetail.py
deluge/ui/console/modes/__init__.py
deluge/ui/console/modes/eventview.py
deluge/ui/console/modes/preference_panes.py
deluge/ui/console/modes/basemode.py
deluge/ui/console/modes/popup.py
deluge/ui/console/modes/add_util.py
deluge/ui/console/modes/connectionmanager.py
deluge/ui/console/modes/input_popup.py
deluge/ui/console/commands/rm.py
deluge/ui/console/commands/cache.py
deluge/ui/console/commands/info.py
deluge/ui/console/commands/debug.py
deluge/ui/console/commands/quit.py
deluge/ui/console/commands/resume.py
deluge/ui/console/commands/update-tracker.py
deluge/ui/console/commands/gui.py
deluge/ui/console/commands/config.py
deluge/ui/console/commands/status.py
deluge/ui/console/commands/move.py
deluge/ui/console/commands/__init__.py
deluge/ui/console/commands/halt.py
deluge/ui/console/commands/recheck.py
deluge/ui/console/commands/connect.py
deluge/ui/console/commands/plugin.py
deluge/ui/console/commands/pause.py
deluge/ui/console/commands/help.py
deluge/ui/console/commands/add.py

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
[Desktop Entry]
Version=1.0
Name=Deluge
GenericName=BitTorrent Client
X-GNOME-FullName=Deluge BitTorrent Client
Comment=Download and share files over BitTorrent
_Name=Deluge
_GenericName=BitTorrent Client
_X-GNOME-FullName=Deluge BitTorrent Client
_Comment=Download and share files over BitTorrent
TryExec=deluge-gtk
Exec=deluge-gtk %U
Icon=deluge

View File

@ -1,20 +1,26 @@
#!/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-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-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 \
gtk-justify-center gtk-justify-fill gtk-justify-left gtk-missing-image \
gtk-new gtk-no gtk-ok gtk-open gtk-paste gtk-preferences gtk-print \
gtk-print-preview gtk-properties gtk-quit gtk-redo gtk-refresh \
gtk-remove gtk-revert-to-saved gtk-save gtk-save-as gtk-select-color \
gtk-select-font gtk-sort-descending gtk-spell-check gtk-stop \
gtk-strikethrough gtk-undelete gtk-underline gtk-undo gtk-yes \
gtk-zoom-100 gtk-zoom-fit gtk-zoom-in gtk-zoom-out; do \
sed -i "s/<property\ name\=\"label\"\ translatable\=\"yes\">$y<\/property>/<property\ name\=\"label\"\ translatable\=\"no\">$y<\/property>/g" $x; \
done;\
done
xgettext --from-code ISO-8859-1 -f deluge/i18n/POTFILES.in -o deluge/i18n/deluge.pot
PACKAGE="Deluge"
PKG_VERSION=`grep "version\ =\ \"" setup.py | cut -d '"' -f2`
PO_DIR="deluge/i18n"
POTFILES_IN="infiles.list"
POT_FILE=deluge.pot
cp $PO_DIR/POTFILES.in $POTFILES_IN
DESKTOP_FILE=`grep ".*desktop.in$" $POTFILES_IN`
if [ $DESKTOP_FILE ]; then
sed -i "\:$DESKTOP_FILE:d" $POTFILES_IN
intltool-extract --quiet --type=gettext/ini $DESKTOP_FILE
echo "$DESKTOP_FILE.h" >> $POTFILES_IN
fi
xgettext --from-code=UTF-8 -kN_:1 -f $POTFILES_IN -o $PO_DIR/$POT_FILE --package-name=$PACKAGE \
--copyright-holder='Deluge Team' --package-version=$PKG_VERSION \
--msgid-bugs-address=http://deluge-torrent.org
# sub the YEAR in the copyright message
sed -i -e '2s/YEAR/'`date +%Y`'/' "$PO_DIR/$POT_FILE"
rm -f $POTFILES_IN
rm -f "$DESKTOP_FILE.h"
echo "Created $PO_DIR/$POT_FILE"

View File

@ -256,12 +256,25 @@ class build_trans(cmd.Command):
def run(self):
po_dir = os.path.join(os.path.dirname(__file__), 'deluge/i18n/')
if self.develop_mode:
basedir = po_dir
else:
basedir = os.path.join(self.build_lib, 'deluge', 'i18n')
# creates the translated desktop file
INTLTOOL_MERGE='intltool-merge'
INTLTOOL_MERGE_OPTS='--utf8 --quiet --desktop-style'
desktop_in='deluge/ui/data/share/applications/deluge.desktop.in'
desktop_data='deluge/ui/data/share/applications/deluge.desktop'
print('Creating desktop file: %s' % desktop_data)
os.system('C_ALL=C ' + '%s '*5 % (INTLTOOL_MERGE, INTLTOOL_MERGE_OPTS, \
po_dir, desktop_in, desktop_data))
print('Compiling po files from %s...' % po_dir),
for path, names, filenames in os.walk(po_dir):
for f in filenames:
uptoDate = False
if f.endswith('.po'):
lang = f[:len(f) - 3]
src = os.path.join(path, f)
@ -270,14 +283,22 @@ class build_trans(cmd.Command):
if not os.path.exists(dest_path):
os.makedirs(dest_path)
if not os.path.exists(dest):
print('Compiling %s' % src)
sys.stdout.write('%s, ' % lang)
sys.stdout.flush()
msgfmt.make(src, dest)
else:
src_mtime = os.stat(src)[8]
dest_mtime = os.stat(dest)[8]
if src_mtime > dest_mtime:
print('Compiling %s' % src)
sys.stdout.write('%s, ' % lang)
sys.stdout.flush()
msgfmt.make(src, dest)
else:
uptoDate = True
if uptoDate:
sys.stdout.write(' po files already upto date. ')
sys.stdout.write('\b\b \nFinished compiling translation files. \n')
class build_plugins(cmd.Command):
description = "Build plugins into .eggs"
@ -513,7 +534,6 @@ setup(
libtorrent in it's backend to handle the bittorrent protocol.""",
url = "http://deluge-torrent.org",
license = "GPLv3",
cmdclass = cmdclass,
data_files = _data_files,
ext_package = "deluge",
@ -526,7 +546,6 @@ setup(
"ui/data/pixmaps/*.gif",
"ui/data/pixmaps/flags/*.png",
"plugins/*.egg",
"i18n/*.pot",
"i18n/*/LC_MESSAGES/*.mo",
"ui/web/gettext.js",
"ui/web/index.html",