summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-02-03 16:18:03 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-02-03 16:18:03 +0100
commit5525a167566d5de569292f67857ec2454c8f5cd1 (patch)
treeeef4c2e685959d11e219750b0df8265f8438fc46
parentdownload resume working? (diff)
downloadpyload-5525a167566d5de569292f67857ec2454c8f5cd1.tar.xz
some l18n stuff
-rw-r--r--module/web/locale/de/LC_MESSAGES/django.mobin0 -> 449 bytes
-rw-r--r--module/web/locale/de/LC_MESSAGES/django.po186
-rw-r--r--module/web/locale/en/LC_MESSAGES/django.mobin0 -> 367 bytes
-rw-r--r--module/web/locale/en/LC_MESSAGES/django.po186
-rw-r--r--module/web/pyload/views.py7
-rw-r--r--module/web/settings.py5
-rw-r--r--module/web/templates/default/add.html12
-rw-r--r--module/web/templates/default/base.html37
-rw-r--r--module/web/templates/default/downloads.html5
-rw-r--r--module/web/templates/default/home.html13
-rw-r--r--module/web/templates/default/login.html9
-rw-r--r--module/web/templates/default/logout.html3
-rw-r--r--module/web/templates/default/logs.html3
-rw-r--r--module/web/templates/default/queue.html13
-rw-r--r--module/web/templates/default/window.html21
-rwxr-xr-xpyLoadCli.py70
-rw-r--r--systemCheck.py4
17 files changed, 475 insertions, 99 deletions
diff --git a/module/web/locale/de/LC_MESSAGES/django.mo b/module/web/locale/de/LC_MESSAGES/django.mo
new file mode 100644
index 000000000..5136d5503
--- /dev/null
+++ b/module/web/locale/de/LC_MESSAGES/django.mo
Binary files differ
diff --git a/module/web/locale/de/LC_MESSAGES/django.po b/module/web/locale/de/LC_MESSAGES/django.po
new file mode 100644
index 000000000..4a262d5ac
--- /dev/null
+++ b/module/web/locale/de/LC_MESSAGES/django.po
@@ -0,0 +1,186 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-02-03 15:16+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: pyload/views.py:26
+msgid ""
+"Can't connect to pyLoad. Please check your configuration and make sure "
+"pyLoad is running."
+msgstr ""
+
+#: pyload/views.py:47
+msgid "You don't have permission to view this page."
+msgstr ""
+
+#: pyload/views.py:88
+msgid "Download directory not found."
+msgstr ""
+
+#: templates/default/base.html:21 templates/default/base.html.py:184
+msgid "Webinterface"
+msgstr ""
+
+#: templates/default/base.html:126
+msgid "Logout"
+msgstr ""
+
+#: templates/default/base.html:128
+msgid "Administrate"
+msgstr ""
+
+#: templates/default/base.html:134
+msgid "Please Login!"
+msgstr ""
+
+#: templates/default/base.html:146 templates/default/queue.html:78
+msgid "Home"
+msgstr ""
+
+#: templates/default/base.html:149 templates/default/queue.html:75
+#: templates/default/queue.html.py:79
+msgid "Queue"
+msgstr ""
+
+#: templates/default/base.html:151 templates/default/downloads.html:20
+#: templates/default/queue.html:80
+msgid "Downloads"
+msgstr ""
+
+#: templates/default/base.html:153 templates/default/logs.html:4
+#: templates/default/queue.html:81
+msgid "Logs"
+msgstr ""
+
+#: templates/default/base.html:165
+msgid "Play"
+msgstr ""
+
+#: templates/default/base.html:166
+msgid "Cancel"
+msgstr ""
+
+#: templates/default/base.html:167
+msgid "Stop"
+msgstr ""
+
+#: templates/default/base.html:168
+msgid "Add"
+msgstr ""
+
+#: templates/default/base.html:174
+msgid "Speed:"
+msgstr ""
+
+#: templates/default/base.html:175
+msgid "Active:"
+msgstr ""
+
+#: templates/default/base.html:176
+msgid "Reload page"
+msgstr ""
+
+#: templates/default/base.html:204
+msgid "© 2008-2010 the pyLoad Team"
+msgstr "© 2008-2010 das pyLoad Team"
+
+#: templates/default/base.html:206
+msgid "Back to top"
+msgstr ""
+
+#: templates/default/downloads.html:25
+msgid "It's recommend not to download Files bigger than ~10MB from here."
+msgstr ""
+
+#: templates/default/home.html:198
+msgid "Active Downloads"
+msgstr ""
+
+#: templates/default/home.html:205 templates/default/window.html:11
+msgid "Name"
+msgstr ""
+
+#: templates/default/home.html:206
+msgid "Status"
+msgstr ""
+
+#: templates/default/home.html:207
+msgid "Infos"
+msgstr ""
+
+#: templates/default/home.html:208
+msgid "Size"
+msgstr ""
+
+#: templates/default/home.html:209
+msgid "Progress"
+msgstr ""
+
+#: templates/default/login.html:4
+msgid "Login"
+msgstr ""
+
+#: templates/default/login.html:15
+msgid "Username"
+msgstr ""
+
+#: templates/default/login.html:20
+msgid "Password"
+msgstr ""
+
+#: templates/default/login.html:30
+msgid "Your username and password didn't match. Please try again."
+msgstr ""
+
+#: templates/default/logout.html:9
+msgid "You were successfully logged out."
+msgstr ""
+
+#: templates/default/queue.html:105
+msgid "Folder:"
+msgstr ""
+
+#: templates/default/window.html:9 templates/default/window.html.py:26
+msgid "Add Package"
+msgstr ""
+
+#: templates/default/window.html:10
+msgid "Paste your links or upload a container."
+msgstr ""
+
+#: templates/default/window.html:12
+msgid "The name of the new package."
+msgstr ""
+
+#: templates/default/window.html:16
+msgid "Links"
+msgstr ""
+
+#: templates/default/window.html:17
+msgid "Paste your links here"
+msgstr ""
+
+#: templates/default/window.html:21
+msgid "File"
+msgstr ""
+
+#: templates/default/window.html:22
+msgid "Upload a container."
+msgstr ""
+
+#: templates/default/window.html:27
+msgid "Reset"
+msgstr ""
diff --git a/module/web/locale/en/LC_MESSAGES/django.mo b/module/web/locale/en/LC_MESSAGES/django.mo
new file mode 100644
index 000000000..3fb287c3d
--- /dev/null
+++ b/module/web/locale/en/LC_MESSAGES/django.mo
Binary files differ
diff --git a/module/web/locale/en/LC_MESSAGES/django.po b/module/web/locale/en/LC_MESSAGES/django.po
new file mode 100644
index 000000000..4f7f93de7
--- /dev/null
+++ b/module/web/locale/en/LC_MESSAGES/django.po
@@ -0,0 +1,186 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-02-03 15:16+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: pyload/views.py:26
+msgid ""
+"Can't connect to pyLoad. Please check your configuration and make sure "
+"pyLoad is running."
+msgstr ""
+
+#: pyload/views.py:47
+msgid "You don't have permission to view this page."
+msgstr ""
+
+#: pyload/views.py:88
+msgid "Download directory not found."
+msgstr ""
+
+#: templates/default/base.html:21 templates/default/base.html.py:184
+msgid "Webinterface"
+msgstr ""
+
+#: templates/default/base.html:126
+msgid "Logout"
+msgstr ""
+
+#: templates/default/base.html:128
+msgid "Administrate"
+msgstr ""
+
+#: templates/default/base.html:134
+msgid "Please Login!"
+msgstr ""
+
+#: templates/default/base.html:146 templates/default/queue.html:78
+msgid "Home"
+msgstr ""
+
+#: templates/default/base.html:149 templates/default/queue.html:75
+#: templates/default/queue.html.py:79
+msgid "Queue"
+msgstr ""
+
+#: templates/default/base.html:151 templates/default/downloads.html:20
+#: templates/default/queue.html:80
+msgid "Downloads"
+msgstr ""
+
+#: templates/default/base.html:153 templates/default/logs.html:4
+#: templates/default/queue.html:81
+msgid "Logs"
+msgstr ""
+
+#: templates/default/base.html:165
+msgid "Play"
+msgstr ""
+
+#: templates/default/base.html:166
+msgid "Cancel"
+msgstr ""
+
+#: templates/default/base.html:167
+msgid "Stop"
+msgstr ""
+
+#: templates/default/base.html:168
+msgid "Add"
+msgstr ""
+
+#: templates/default/base.html:174
+msgid "Speed:"
+msgstr ""
+
+#: templates/default/base.html:175
+msgid "Active:"
+msgstr ""
+
+#: templates/default/base.html:176
+msgid "Reload page"
+msgstr ""
+
+#: templates/default/base.html:204
+msgid "© 2008-2010 the pyLoad Team"
+msgstr ""
+
+#: templates/default/base.html:206
+msgid "Back to top"
+msgstr ""
+
+#: templates/default/downloads.html:25
+msgid "It's recommend not to download Files bigger than ~10MB from here."
+msgstr ""
+
+#: templates/default/home.html:198
+msgid "Active Downloads"
+msgstr ""
+
+#: templates/default/home.html:205 templates/default/window.html:11
+msgid "Name"
+msgstr ""
+
+#: templates/default/home.html:206
+msgid "Status"
+msgstr ""
+
+#: templates/default/home.html:207
+msgid "Infos"
+msgstr ""
+
+#: templates/default/home.html:208
+msgid "Size"
+msgstr ""
+
+#: templates/default/home.html:209
+msgid "Progress"
+msgstr ""
+
+#: templates/default/login.html:4
+msgid "Login"
+msgstr ""
+
+#: templates/default/login.html:15
+msgid "Username"
+msgstr ""
+
+#: templates/default/login.html:20
+msgid "Password"
+msgstr ""
+
+#: templates/default/login.html:30
+msgid "Your username and password didn't match. Please try again."
+msgstr ""
+
+#: templates/default/logout.html:9
+msgid "You were successfully logged out."
+msgstr ""
+
+#: templates/default/queue.html:105
+msgid "Folder:"
+msgstr ""
+
+#: templates/default/window.html:9 templates/default/window.html.py:26
+msgid "Add Package"
+msgstr ""
+
+#: templates/default/window.html:10
+msgid "Paste your links or upload a container."
+msgstr ""
+
+#: templates/default/window.html:12
+msgid "The name of the new package."
+msgstr ""
+
+#: templates/default/window.html:16
+msgid "Links"
+msgstr ""
+
+#: templates/default/window.html:17
+msgid "Paste your links here"
+msgstr ""
+
+#: templates/default/window.html:21
+msgid "File"
+msgstr ""
+
+#: templates/default/window.html:22
+msgid "Upload a container."
+msgstr ""
+
+#: templates/default/window.html:27
+msgid "Reset"
+msgstr ""
diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py
index ea9d5f1be..37470c98f 100644
--- a/module/web/pyload/views.py
+++ b/module/web/pyload/views.py
@@ -14,6 +14,7 @@ from django.http import HttpResponse
from django.http import HttpResponseNotFound
from django.shortcuts import render_to_response
from django.template import RequestContext
+from django.utils.translation import ugettext as _
def check_server(function):
@@ -22,7 +23,7 @@ def check_server(function):
try:
version = settings.PYLOAD.get_server_version()
except Exception, e:
- return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.', str(e)])
+ return base(request, messages=[_('Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.'), str(e)])
return view_func(request, * args, ** kwargs)
_view.__name__ = view_func.__name__
@@ -43,7 +44,7 @@ def permission(perm):
if request.user.has_perm(perm) and request.user.is_authenticated():
return view_func(request, * args, ** kwargs)
else:
- return base(request, messages=['You don\'t have permission to view this page.'])
+ return base(request, messages=[_('You don\'t have permission to view this page.')])
_view.__name__ = view_func.__name__
_view.__dict__ = view_func.__dict__
@@ -84,7 +85,7 @@ def queue(request):
@check_server
def downloads(request):
if not isdir(settings.DL_ROOT):
- return base(request, ['Download directory not found.'])
+ return base(request, [_('Download directory not found.')])
data = {
'folder': [],
'files': []
diff --git a/module/web/settings.py b/module/web/settings.py
index dff1dc29d..2199ab221 100644
--- a/module/web/settings.py
+++ b/module/web/settings.py
@@ -64,7 +64,7 @@ TIME_ZONE = 'Europe'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
+LANGUAGE_CODE = 'en'
SITE_ID = 1
@@ -106,8 +106,9 @@ TEMPLATE_LOADERS = (
MIDDLEWARE_CLASSES = (
'django.middleware.gzip.GZipMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- 'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
diff --git a/module/web/templates/default/add.html b/module/web/templates/default/add.html
deleted file mode 100644
index 525cb99bd..000000000
--- a/module/web/templates/default/add.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{% extends 'default/base.html' %}
-
-{% block subtitle %}
-Add Links / Container
-{% endblock %}
-
-
-
-{% block content %}
-<textarea rows="5" style=" width: 100%;"></textarea>
-<input type="file" />
-{% endblock %} \ No newline at end of file
diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html
index 2a2490088..720453a30 100644
--- a/module/web/templates/default/base.html
+++ b/module/web/templates/default/base.html
@@ -1,3 +1,4 @@
+{% load i18n %}
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -17,7 +18,7 @@
<!--<script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script>-->
<!--<script src="{{ MEDIA_URL }}js/jquery.form.js"></script>-->
-<title>{% block title %}pyLoad Webinterface{% endblock %}</title>
+<title>{% block title %}pyLoad {% trans "Webinterface" %}{% endblock %}</title>
<script type="text/javascript">
var add_bg,add_box
@@ -122,15 +123,15 @@ function AddBox()
{% if user.is_authenticated %}
<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span>
<ul id="user-actions">
- <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li>
+ <li><a href="/logout" class="action logout" rel="nofollow">{% trans "Logout" %}</a></li>
{% if user.is_staff %}
- <li><a href="/admin" class="action profile" rel="nofollow">Administrate</a></li>
+ <li><a href="/admin" class="action profile" rel="nofollow">{% trans "Administrate" %}</a></li>
{% endif %}
<li></li>
<li></li>
</ul>
{% else %}
- <span style="padding-right: 2px;">Please Login!</span>
+ <span style="padding-right: 2px;">{% trans "Please Login!" %}</span>
{% endif %}
</div>
@@ -142,14 +143,14 @@ function AddBox()
{% block menu %}
<li class="selected">
- <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a>
+ <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a>
</li>
<li>
- <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li>
+ <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> {% trans "Queue" %}</a></li>
<li>
- <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li>
+ <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a></li>
<li class="right">
- <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a>
+ <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a>
</li>
{% endblock %}
@@ -161,18 +162,18 @@ function AddBox()
{% if perms.pyload.can_change_status %}
<ul id="page-actions2">
- <li id="action_play"><a href="#" class="action play" accesskey="o" rel="nofollow">Play</a></li>
- <li id="action_cancel"><a href="#" class="action cancel" accesskey="o" rel="nofollow">Cancel</a></li>
- <li id="action_stop"><a href="#" class="action stop" accesskey="o" rel="nofollow">Stop</a></li>
- <li id="action_add"><a href="javascript:AddBox();" class="action stop" accesskey="o" rel="nofollow" >Add</a></li>
+ <li id="action_play"><a href="#" class="action play" accesskey="o" rel="nofollow">{% trans "Play" %}</a></li>
+ <li id="action_cancel"><a href="#" class="action cancel" accesskey="o" rel="nofollow">{% trans "Cancel" %}</a></li>
+ <li id="action_stop"><a href="#" class="action stop" accesskey="o" rel="nofollow">{% trans "Stop" %}</a></li>
+ <li id="action_add"><a href="javascript:AddBox();" class="action stop" accesskey="o" rel="nofollow" >{% trans "Add" %}</a></li>
</ul>
{% endif %}
{% if perms.pyload.can_see_dl %}
<ul id="page-actions">
- <li><a class="action backlink">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li>
- <li><a class="action cog">Active: <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li>
- <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li>
+ <li><a class="action backlink">{% trans "Speed:" %} <b id="speed">{{ status.speed }}</b> kb/s</a></li>
+ <li><a class="action cog">{% trans "Active:" %} <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li>
+ <li><a href="" class="action revisions" accesskey="o" rel="nofollow">{% trans "Reload page" %}</a></li>
</ul><br />
{% endif %}
@@ -180,7 +181,7 @@ function AddBox()
<div id="content" lang="en" dir="ltr">
-<h1>{% block subtitle %}pyLoad - Webinterface{% endblock %}</h1>
+<h1>{% block subtitle %}pyLoad - {% trans "Webinterface" %}{% endblock %}</h1>
{% block statusbar %}
{% endblock %}
@@ -200,9 +201,9 @@ function AddBox()
<hr style="clear: both;" />
-<div id="foot">© 2008-2010 the pyLoad Team
+<div id="foot">{% trans "© 2008-2010 the pyLoad Team" %}
- <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br />
+ <a href="#top" class="action top" accesskey="x"><span>{% trans "Back to top" %}</span></a><br />
<!--<div class="breadcrumbs"></div>-->
diff --git a/module/web/templates/default/downloads.html b/module/web/templates/default/downloads.html
index 3f07bec47..3c370aaa2 100644
--- a/module/web/templates/default/downloads.html
+++ b/module/web/templates/default/downloads.html
@@ -1,4 +1,5 @@
{% extends 'default/base.html' %}
+{% load i18n %}
{% block title %}Downloads - {{block.super}} {% endblock %}
@@ -16,12 +17,12 @@
{% endblock %}
{% block subtitle %}
-Downloads
+{% trans "Downloads" %}
{% endblock %}
{% block content %}
-It's recommend not to download Files bigger than ~10MB from here.
+{% trans "It's recommend not to download Files bigger than ~10MB from here." %}
<ul>
{% for folder in files.folder %}
diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html
index ab2135800..08a7a85e6 100644
--- a/module/web/templates/default/home.html
+++ b/module/web/templates/default/home.html
@@ -1,4 +1,5 @@
{% extends 'default/base.html' %}
+{% load i18n %}
{% block head %}
@@ -194,18 +195,18 @@ var LinkEntry = new Class({
{% endblock %}
{% block subtitle %}
-Active Downloads
+{% trans "Active Downloads" %}
{% endblock %}
{% block content %}
<table width="100%" class="queue">
<thead>
<tr class="header">
- <th>Name</th>
- <th>Status</th>
- <th>Infos</th>
- <th>Size</th>
- <th>Progress</th>
+ <th>{% trans "Name" %}</th>
+ <th>{% trans "Status" %}</th>
+ <th>{% trans "Infos" %}</th>
+ <th>{% trans "Size" %}</th>
+ <th>{% trans "Progress" %}</th>
</tr>
</thead>
<tbody id="LinksAktiv">
diff --git a/module/web/templates/default/login.html b/module/web/templates/default/login.html
index 851802c4f..185245f67 100644
--- a/module/web/templates/default/login.html
+++ b/module/web/templates/default/login.html
@@ -1,6 +1,7 @@
{% extends 'default/base.html' %}
+{% load i18n %}
-{% block title %}Login - {{block.super}} {% endblock %}
+{% block title %}{% trans "Login" %} - {{block.super}} {% endblock %}
{% block content %}
@@ -11,12 +12,12 @@
<fieldset>
<legend>Login</legend>
<label class="block" for="focus__this">
- <span>Username</span>
+ <span>{% trans "Username" %}</span>
{{ form.username }}
</label>
<br />
<label class="block">
- <span>Password</span>
+ <span>{% trans "Password" %}</span>
{{ form.password }}
</label>
<br />
@@ -26,7 +27,7 @@
</form>
{% if form.errors %}
-<p>Your username and password didn't match. Please try again.</p>
+<p{% trans "Your username and password didn't match. Please try again." %}</p>
{% endif %}
</div>
diff --git a/module/web/templates/default/logout.html b/module/web/templates/default/logout.html
index 4d00bf6d5..edc30392e 100644
--- a/module/web/templates/default/logout.html
+++ b/module/web/templates/default/logout.html
@@ -1,9 +1,10 @@
{% extends 'default/base.html' %}
+{% load i18n %}
{% block head %}
<meta http-equiv="refresh" content="3; url=/">
{% endblock %}
{% block content %}
-<p><b>You were successfully logged out.</b></p>
+<p><b>{% trans "You were successfully logged out." %}</b></p>
{% endblock %} \ No newline at end of file
diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html
index f9b0504d9..c35c68706 100644
--- a/module/web/templates/default/logs.html
+++ b/module/web/templates/default/logs.html
@@ -1,6 +1,7 @@
{% extends 'default/base.html' %}
+{% load i18n %}
-{% block title %}Logs - {{block.super}} {% endblock %}
+{% block title %}{% trans "Logs" %} - {{block.super}} {% endblock %}
{% block menu %}
<li>
diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html
index aa21390a0..a136e1213 100644
--- a/module/web/templates/default/queue.html
+++ b/module/web/templates/default/queue.html
@@ -1,4 +1,5 @@
{% extends 'default/base.html' %}
+{% load i18n %}
{% block head %}
<script type="text/javascript">
@@ -71,13 +72,13 @@ document.addEvent("domready", function(){
</script>
{% endblock %}
-{% block title %}Queue - {{block.super}} {% endblock %}
+{% block title %}{% trans "Queue" %} - {{block.super}} {% endblock %}
{% block menu %}
-<li> <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> </li>
-<li class="selected"> <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li>
-<li> <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li>
-<li class="right"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li>
+<li> <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> {% trans "Home" %}</a> </li>
+<li class="selected"> <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> {% trans "Queue" %}</a></li>
+<li> <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> {% trans "Downloads" %}</a></li>
+<li class="right"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />{% trans "Logs" %}</a> </li>
{% endblock %}
{% block content %}
@@ -101,7 +102,7 @@ document.addEvent("domready", function(){
<span class="child_status">{{ child.status_type }}</span>{{child.status_error}}&nbsp;
<span class="child_status">{{ child.size }} KB</span>
<span class="child_status">{{ child.plugin }}</span>
- <span class="child_status">Folder: {{child.folder}}</span>
+ <span class="child_status">{% trans "Folder:" %} {{child.folder}}</span>
&nbsp;&nbsp;
<img style="cursor: pointer;" width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" />
&nbsp;&nbsp;
diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html
index 7e5c249e6..11ac8056c 100644
--- a/module/web/templates/default/window.html
+++ b/module/web/templates/default/window.html
@@ -1,3 +1,4 @@
+{% load i18n %}
<iframe id="upload_target" name="upload_target" src="" style="display: none; width:0;height:0"></iframe>
<div id="add_bg" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:absolute; top:0px; left:0px; display:none;">&nbsp;</div>
<!--<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;">-->
@@ -5,25 +6,25 @@
<!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>-->
<div id="add_box" class="myform">
<form id="add_form" action="/json/add_package" method="POST" enctype="multipart/form-data">
-<h1>Add Package</h1>
-<p>Paste your links or upload a container.</p>
-<label>Name
-<span class="small">The name of the new package.</span>
+<h1>{% trans "Add Package" %}</h1>
+<p>{% trans "Paste your links or upload a container." %}</p>
+<label>{% trans "Name" %}
+<span class="small">{% trans "The name of the new package." %}</span>
</label>
<input name="add_name" type="text" size="20" />
-<label>Links
-<span class="small">Paste your links here</span>
+<label>{% trans "Links" %}
+<span class="small">{% trans "Paste your links here" %}</span>
</label>
<textarea rows="5" name="add_links" id="add_links"></textarea>
-<label>File
-<span class="small">Upload a container.</span>
+<label>{% trans "File" %}
+<span class="small">{% trans "Upload a container." %}</span>
</label>
<input type="file" name="add_file" id="add_file"/>
-<button type="submit">Add Package</button>
-<button id="add_reset" style="margin-left:0px;" type="reset">Reset</button>
+<button type="submit">{% trans "Add Package" %}</button>
+<button id="add_reset" style="margin-left:0px;" type="reset">{% trans "Reset" %}</button>
<div class="spacer"></div>
</form>
diff --git a/pyLoadCli.py b/pyLoadCli.py
index 18c3b98bc..1989163c2 100755
--- a/pyLoadCli.py
+++ b/pyLoadCli.py
@@ -19,6 +19,7 @@
###
import os
import os.path
+import gettext
from os.path import abspath
from os.path import dirname
from os.path import join
@@ -44,13 +45,13 @@ class pyLoadCli:
try:
self.core.get_server_version()
except:
- print "pyLoadCore not running"
+ print _("pyLoadCore not running")
exit()
self.links_added = 0
os.system("clear")
- self.println(1, blue("py") + yellow("Load") + white(" Command Line Interface"))
+ self.println(1, blue("py") + yellow("Load") + white(_(" Command Line Interface")))
self.println(2, "")
@@ -109,9 +110,9 @@ class pyLoadCli:
data = self.core.status_downloads()
#print updated information
print "\033[J" #clear screen
- self.println(1, blue("py") + yellow("Load") + white(" Command Line Interface"))
+ self.println(1, blue("py") + yellow("Load") + white(_(" Command Line Interface")))
self.println(2, "")
- self.println(3, white("%s Downloads:" % (len(data))))
+ self.println(3, white(_("%s Downloads:") % (len(data))))
line = 4
speed = 0
for download in data:
@@ -121,20 +122,20 @@ class pyLoadCli:
speed += download['speed']
self.println(line, cyan(download["name"]))
line += 1
- self.println(line, blue("[") + yellow(z * "#" + (25-z) * " ") + blue("] ") + green(str(percent) + "%") + " Speed: " + green(str(int(download['speed'])) + " kb/s") + " Size: " + green(self.format_size(download['size'])) + " Finished in: " + green(self.format_time(download['eta'])) + " ID: " + green(str(download['id'])))
+ self.println(line, blue("[") + yellow(z * "#" + (25-z) * " ") + blue("] ") + green(str(percent) + "%") + _(" Speed: ") + green(str(int(download['speed'])) + " kb/s") + _(" Size: ") + green(self.format_size(download['size'])) + _(" Finished in: ") + green(self.format_time(download['eta'])) + _(" ID: ") + green(str(download['id'])))
line += 1
if download["status"] == "waiting":
self.println(line, cyan(download["name"]))
line += 1
- self.println(line, "waiting: " + green(self.format_time(download["wait_until"]- time.time())))
+ self.println(line, _("waiting: ") + green(self.format_time(download["wait_until"]- time.time())))
line += 1
self.println(line, "")
line += 1
status = self.core.status_server()
if status['pause']:
- self.println(line, "Status: " + red("paused") + " total Speed: " + red(str(int(speed)) + " kb/s") + " Files in queue: " + red(str(status["queue"])))
+ self.println(line, _("Status: ") + red("paused") + _(" total Speed: ") + red(str(int(speed)) + " kb/s") + _(" Files in queue: ") + red(str(status["queue"])))
else:
- self.println(line, "Status: " + red("running") + " total Speed: " + red(str(int(speed)) + " kb/s") + " Files in queue: " + red(str(status["queue"])))
+ self.println(line, _("Status: ") + red("running") + _(" total Speed: ") + red(str(int(speed)) + " kb/s") + _(" Files in queue: ") + red(str(status["queue"])))
line += 1
self.println(line, "")
line += 1
@@ -146,20 +147,20 @@ class pyLoadCli:
def build_menu(self):
line = self.menuline
- self.println(line, white("Menu:"))
+ self.println(line, white(_("Menu:")))
line += 1
if self.pos[0] == 0:# main menu
self.println(line, "")
line += 1
- self.println(line, mag("1.") + " Add Links")
+ self.println(line, mag("1.") + _(" Add Links"))
line += 1
- self.println(line, mag("2.") + " Manage Links")
+ self.println(line, mag("2.") + _(" Manage Links"))
line += 1
- self.println(line, mag("3.") + " (Un)Pause Server")
+ self.println(line, mag("3.") + _(" (Un)Pause Server"))
line += 1
- self.println(line, mag("4.") + " Kill Server")
+ self.println(line, mag("4.") + _(" Kill Server"))
line += 1
- self.println(line, mag("5.") + " Quit")
+ self.println(line, mag("5.") + _(" Quit"))
line += 1
self.println(line, "")
line += 1
@@ -169,7 +170,7 @@ class pyLoadCli:
if self.pos[1] == 0:
self.println(line, "")
line += 1
- self.println(line, "Name your package.")
+ self.println(line, _("Name your package."))
line += 1
self.println(line, "")
line += 1
@@ -179,30 +180,30 @@ class pyLoadCli:
line += 1
self.println(line, "")
line += 1
- self.println(line, mag("0.") + " back to main menu")
+ self.println(line, mag("0.") + _(" back to main menu"))
line += 1
self.println(line, "")
else:
- self.println(line, "Package: %s" % self.new_package['name'])
+ self.println(line, _("Package: %s") % self.new_package['name'])
line += 1
- self.println(line, "Parse the links you want to add.")
+ self.println(line, _("Parse the links you want to add."))
line += 1
- self.println(line, "Type " + mag("END") + " when done.")
+ self.println(line, _("Type %s when done.") % mag("END"))
line += 1
- self.println(line, "Links added: " + mag(str(self.links_added)))
+ self.println(line, _("Links added: ") + mag(str(self.links_added)))
line += 1
self.println(line, "")
line += 1
self.println(line, "")
line += 1
- self.println(line, mag("0.") + " back to main menu")
+ self.println(line, mag("0.") + _(" back to main menu"))
line += 1
self.println(line, "")
elif self.pos[0] == 2:#remove links
if self.pos[1] == 0:
pack = self.core.get_queue()
- self.println(line, "Type d(number of package) to delete a package, r to restart, or w/o d,r to look into it.")
+ self.println(line, _("Type d(number of package) to delete a package, r to restart, or w/o d,r to look into it."))
line += 1
i = 0
for id in range(self.pos[2], self.pos[2] + 5):
@@ -218,7 +219,7 @@ class pyLoadCli:
else:
links = self.core.get_package_files(self.pos[1])
- self.println(line, "Type d(number) of the link you want to delete or r(number) to restart.")
+ self.println(line, _("Type d(number) of the link you want to delete or r(number) to restart."))
line += 1
i = 0
for id in range(self.pos[2], self.pos[2] + 5):
@@ -238,9 +239,9 @@ class pyLoadCli:
self.println(line, "")
line += 1
- self.println(line, mag("p") + " - previous" + " | " + mag("n") + " - next")
+ self.println(line, mag(_("p")) + _(" - previous") + " | " + mag(_("n")) + _(" - next"))
line += 1
- self.println(line, mag("0.") + " back to main menu")
+ self.println(line, mag("0.") + _(" back to main menu"))
self.inputline = line + 1
self.print_input()
@@ -426,6 +427,12 @@ def white(string):
if __name__ == "__main__":
+ xmlconfig = XMLConfigParser(join(abspath(dirname(__file__)), "module", "config", "core.xml"))
+ config = xmlconfig.getConfig()
+
+ translation = gettext.translation("pyLoad", join(abspath(dirname(__file__)), "locale"), languages=[config['general']['language']])
+ translation.install(unicode=True)
+
if len(sys.argv) > 1:
shortOptions = 'l'
@@ -435,8 +442,7 @@ if __name__ == "__main__":
for option, params in opts:
if option in ("-l", "--local"):
- xmlconfig = XMLConfigParser(join(abspath(dirname(__file__)), "module", "config", "core.xml"))
- config = xmlconfig.getConfig()
+
ssl = ""
if config['ssl']['activated'] == "True":
@@ -452,16 +458,16 @@ if __name__ == "__main__":
if len(extraparams) == 1:
server_url = sys.argv[1]
else:
- username = raw_input("Username: ")
- address = raw_input("Adress: ")
- ssl = raw_input("Use SSL? ([y]/n): ")
+ username = raw_input(_("Username: "))
+ address = raw_input(_("Adress: "))
+ ssl = raw_input(_("Use SSL? ([y]/n): "))
if ssl == "y" or ssl == "":
ssl = "s"
else:
ssl = ""
- port = raw_input("Port: ")
+ port = raw_input(_("Port: "))
from getpass import getpass
- password = getpass("Password: ")
+ password = getpass(_("Password: "))
server_url = "http%s://%s:%s@%s:%s/" % (ssl, username, password, address, port)
print server_url
diff --git a/systemCheck.py b/systemCheck.py
index 7227bc674..6477097b0 100644
--- a/systemCheck.py
+++ b/systemCheck.py
@@ -46,8 +46,8 @@ def main():
print "django:", "missing"
try:
- import PyQt4
- print "pyqt:", "4"
+ import PyQt4.QtCore
+ print "pyqt:", PyQt4.QtCore.PYQT_VERSION_STR
except:
print "pyqt:", "missing"