mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-11 10:59:00 +00:00
Fix fsize by initialising gettext
This commit is contained in:
parent
86232cac8e
commit
80e480854e
1 changed files with 18 additions and 0 deletions
|
@ -64,6 +64,24 @@ if not hasattr(json, "dumps"):
|
||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import xdg, xdg.BaseDirectory
|
import xdg, xdg.BaseDirectory
|
||||||
|
import gettext
|
||||||
|
import locale
|
||||||
|
|
||||||
|
# Initialize gettext
|
||||||
|
try:
|
||||||
|
if hasattr(locale, "bindtextdomain"):
|
||||||
|
locale.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
if hasattr(locale, "textdomain"):
|
||||||
|
locale.textdomain("deluge")
|
||||||
|
gettext.bindtextdomain("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
gettext.textdomain("deluge")
|
||||||
|
gettext.install("deluge", pkg_resources.resource_filename("deluge", "i18n"))
|
||||||
|
except Exception, e:
|
||||||
|
from deluge.log import LOG as log
|
||||||
|
log.error("Unable to initialize gettext/locale!")
|
||||||
|
log.exception(e)
|
||||||
|
import __builtin__
|
||||||
|
__builtin__.__dict__["_"] = lambda x: x
|
||||||
|
|
||||||
from deluge.error import *
|
from deluge.error import *
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue