mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 22:06:27 +00:00
I18N tweaks.
This commit is contained in:
parent
e46c75ecff
commit
ba675a89b3
@ -1 +1,14 @@
|
|||||||
|
import gettext
|
||||||
|
import locale
|
||||||
|
import os
|
||||||
|
|
||||||
|
from common import INSTALL_PREFIX
|
||||||
|
|
||||||
|
APP = 'deluge'
|
||||||
|
DIR = os.path.join(INSTALL_PREFIX, 'share', 'locale')
|
||||||
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
|
locale.bindtextdomain(APP, DIR)
|
||||||
|
locale.textdomain(APP)
|
||||||
|
gettext.bindtextdomain(APP, DIR)
|
||||||
|
gettext.textdomain(APP)
|
||||||
|
gettext.install(APP, DIR)
|
||||||
|
@ -107,6 +107,8 @@ def ftime(seconds):
|
|||||||
return 'unknown'
|
return 'unknown'
|
||||||
|
|
||||||
def fpriority(priority):
|
def fpriority(priority):
|
||||||
|
from core import PRIORITY_DICT
|
||||||
|
|
||||||
return PRIORITY_DICT[priority]
|
return PRIORITY_DICT[priority]
|
||||||
|
|
||||||
def get_glade_file(fname):
|
def get_glade_file(fname):
|
||||||
@ -147,9 +149,6 @@ def fetch_url(url):
|
|||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def N_(arg):
|
|
||||||
return arg
|
|
||||||
|
|
||||||
# Encryption States
|
# Encryption States
|
||||||
class EncState:
|
class EncState:
|
||||||
forced, enabled, disabled = range(3)
|
forced, enabled, disabled = range(3)
|
||||||
@ -159,14 +158,3 @@ class EncLevel:
|
|||||||
|
|
||||||
class ProxyType:
|
class ProxyType:
|
||||||
none, socks4, socks5, socks5_pw, http, http_pw = range(6)
|
none, socks4, socks5, socks5_pw, http, http_pw = range(6)
|
||||||
|
|
||||||
# Priorities
|
|
||||||
PRIORITY_DONT_DOWNLOAD = 0
|
|
||||||
PRIORITY_NORMAL = 1
|
|
||||||
PRIORITY_HIGH = 2
|
|
||||||
PRIORITY_HIGHEST = 5
|
|
||||||
|
|
||||||
PRIORITY_DICT = {PRIORITY_DONT_DOWNLOAD: N_("Don't download"),
|
|
||||||
PRIORITY_NORMAL: N_("Normal"),
|
|
||||||
PRIORITY_HIGH: N_("High"),
|
|
||||||
PRIORITY_HIGHEST: N_("Highest")}
|
|
||||||
|
24
src/core.py
24
src/core.py
@ -55,11 +55,9 @@ import re
|
|||||||
import shutil
|
import shutil
|
||||||
import statvfs
|
import statvfs
|
||||||
import time
|
import time
|
||||||
import gettext
|
|
||||||
import deluge_core
|
import deluge_core
|
||||||
import pref
|
import pref
|
||||||
import common
|
|
||||||
import locale
|
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
|
|
||||||
@ -82,14 +80,6 @@ PREF_FUNCTIONS = {
|
|||||||
"use_natpmp" : deluge_core.use_natpmp,
|
"use_natpmp" : deluge_core.use_natpmp,
|
||||||
"use_utpex" : deluge_core.use_utpex,
|
"use_utpex" : deluge_core.use_utpex,
|
||||||
}
|
}
|
||||||
APP = 'deluge'
|
|
||||||
DIR = os.path.join(common.INSTALL_PREFIX, 'share', 'locale')
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
|
||||||
locale.bindtextdomain(APP, DIR)
|
|
||||||
locale.textdomain(APP)
|
|
||||||
gettext.bindtextdomain(APP, DIR)
|
|
||||||
gettext.textdomain(APP)
|
|
||||||
gettext.install(APP, DIR)
|
|
||||||
|
|
||||||
STATE_MESSAGES = (_("Queued"),
|
STATE_MESSAGES = (_("Queued"),
|
||||||
_("Checking"),
|
_("Checking"),
|
||||||
@ -99,6 +89,18 @@ STATE_MESSAGES = (_("Queued"),
|
|||||||
_("Finished"),
|
_("Finished"),
|
||||||
_("Seeding"),
|
_("Seeding"),
|
||||||
_("Allocating"))
|
_("Allocating"))
|
||||||
|
|
||||||
|
# Priorities
|
||||||
|
PRIORITY_DONT_DOWNLOAD = 0
|
||||||
|
PRIORITY_NORMAL = 1
|
||||||
|
PRIORITY_HIGH = 2
|
||||||
|
PRIORITY_HIGHEST = 5
|
||||||
|
|
||||||
|
PRIORITY_DICT = {PRIORITY_DONT_DOWNLOAD: _("Don't download"),
|
||||||
|
PRIORITY_NORMAL: _("Normal"),
|
||||||
|
PRIORITY_HIGH: _("High"),
|
||||||
|
PRIORITY_HIGHEST: _("Highest")}
|
||||||
|
|
||||||
# Exceptions
|
# Exceptions
|
||||||
|
|
||||||
class DelugeError(Exception):
|
class DelugeError(Exception):
|
||||||
|
@ -34,10 +34,8 @@
|
|||||||
import os.path
|
import os.path
|
||||||
from itertools import izip
|
from itertools import izip
|
||||||
|
|
||||||
import gettext
|
|
||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
import locale
|
|
||||||
import pygtk
|
import pygtk
|
||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
|
|
||||||
@ -52,15 +50,6 @@ import tab_files
|
|||||||
|
|
||||||
class DelugeGTK:
|
class DelugeGTK:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
APP = 'deluge'
|
|
||||||
DIR = os.path.join(common.INSTALL_PREFIX, 'share', 'locale')
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
|
||||||
locale.bindtextdomain(APP, DIR)
|
|
||||||
locale.textdomain(APP)
|
|
||||||
gettext.bindtextdomain(APP, DIR)
|
|
||||||
gettext.textdomain(APP)
|
|
||||||
gettext.install(APP, DIR)
|
|
||||||
|
|
||||||
self.ipc_manager = ipc_manager.Manager(self)
|
self.ipc_manager = ipc_manager.Manager(self)
|
||||||
#Start the Deluge Manager:
|
#Start the Deluge Manager:
|
||||||
self.manager = core.Manager(common.CLIENT_CODE, common.CLIENT_VERSION,
|
self.manager = core.Manager(common.CLIENT_CODE, common.CLIENT_VERSION,
|
||||||
@ -72,7 +61,7 @@ class DelugeGTK:
|
|||||||
self.plugins.scan_for_plugins()
|
self.plugins.scan_for_plugins()
|
||||||
self.config = self.manager.get_config()
|
self.config = self.manager.get_config()
|
||||||
#Set up the interface:
|
#Set up the interface:
|
||||||
self.wtree = gtk.glade.XML(common.get_glade_file("delugegtk.glade"), domain=APP)
|
self.wtree = gtk.glade.XML(common.get_glade_file("delugegtk.glade"), domain='deluge')
|
||||||
self.window = self.wtree.get_widget("main_window")
|
self.window = self.wtree.get_widget("main_window")
|
||||||
self.toolbar = self.wtree.get_widget("tb_middle")
|
self.toolbar = self.wtree.get_widget("tb_middle")
|
||||||
self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL,[('text/uri-list', 0, 80)], gtk.gdk.ACTION_COPY)
|
self.window.drag_dest_set(gtk.DEST_DEFAULT_ALL,[('text/uri-list', 0, 80)], gtk.gdk.ACTION_COPY)
|
||||||
|
@ -35,9 +35,9 @@ from itertools import izip
|
|||||||
|
|
||||||
import gobject
|
import gobject
|
||||||
import gtk
|
import gtk
|
||||||
import gtk.glade
|
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
import core
|
||||||
import dgtk
|
import dgtk
|
||||||
import pref
|
import pref
|
||||||
|
|
||||||
@ -102,10 +102,10 @@ class FilesBaseManager(object):
|
|||||||
|
|
||||||
def priority_clicked(self, widget):
|
def priority_clicked(self, widget):
|
||||||
widget_name = widget.get_name()
|
widget_name = widget.get_name()
|
||||||
priority = {'priority_dont_download': common.PRIORITY_DONT_DOWNLOAD,
|
priority = {'priority_dont_download': core.PRIORITY_DONT_DOWNLOAD,
|
||||||
'priority_normal': common.PRIORITY_NORMAL,
|
'priority_normal': core.PRIORITY_NORMAL,
|
||||||
'priority_high': common.PRIORITY_HIGH,
|
'priority_high': core.PRIORITY_HIGH,
|
||||||
'priority_highest': common.PRIORITY_HIGHEST}[widget_name]
|
'priority_highest': core.PRIORITY_HIGHEST}[widget_name]
|
||||||
|
|
||||||
selected_paths = self.file_view.get_selection().get_selected_rows()[1]
|
selected_paths = self.file_view.get_selection().get_selected_rows()[1]
|
||||||
for path in selected_paths:
|
for path in selected_paths:
|
||||||
@ -205,7 +205,7 @@ class FilesDialogManager(FilesBaseManager):
|
|||||||
def prepare_file_store(self):
|
def prepare_file_store(self):
|
||||||
for file in self.dumped_torrent:
|
for file in self.dumped_torrent:
|
||||||
self.file_store.append([file['path'], file['size'],
|
self.file_store.append([file['path'], file['size'],
|
||||||
common.PRIORITY_NORMAL])
|
core.PRIORITY_NORMAL])
|
||||||
|
|
||||||
def priority_clicked(self, widget):
|
def priority_clicked(self, widget):
|
||||||
if self.config.get("use_compact_storage"):
|
if self.config.get("use_compact_storage"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user