Commit d1dc5257 authored by Weblate's avatar Weblate

Merge remote-tracking branch 'origin/master'

parents 8158733c c4915dca
......@@ -300,6 +300,18 @@ you install `pyLibavatar`_, you will get proper support for federated avatars.
.. _pyLibavatar: https://pypi.python.org/pypi/pyLibravatar
.. _production-pyicu:
PyICU library
+++++++++++++
`PyICU`_ library is optionally used by Weblate to sort unicode strings. This
way language names are properly sorted even in non-ascii languages like
Japanese, Chinese or Arabic or for languages with accented letters.
.. _PyICU: https://pypi.python.org/pypi/PyICU
.. _server:
Running server
......
......@@ -28,6 +28,7 @@ from django.contrib import messages
from django.conf import settings
from weblate import appsettings
from trans.util import HAS_LIBRAVATAR
from accounts.forms import HAS_ICU
import weblate
import os
......@@ -118,6 +119,11 @@ def performance(request):
HAS_LIBRAVATAR,
'production-avatar',
))
checks.append((
_('PyICU library'),
HAS_ICU,
'production-pyicu',
))
return render_to_response(
"admin/performance.html",
RequestContext(
......
......@@ -21,7 +21,7 @@
from distutils.version import LooseVersion
def get_version_module(module, name, url):
def get_version_module(module, name, url, optional=False):
'''
Returns module object, on error raises verbose
exception with name and URL.
......@@ -29,15 +29,18 @@ def get_version_module(module, name, url):
try:
mod = __import__(module)
except ImportError:
raise Exception('Failed to import %s, please install %s from %s' % (
if not optional:
raise Exception(
'Failed to import %s, please install %s from %s' % (
module,
name,
url,
))
)
)
return mod
def get_versions():
def get_versions(optional=False):
'''
Returns list of used versions.
'''
......@@ -137,6 +140,29 @@ def get_versions():
'0.7',
))
if optional:
name = 'ICU'
url = 'https://pypi.python.org/pypi/PyICU'
mod = get_version_module('icu', name, url)
if mod is not None:
result.append((
name,
url,
mod.VERSION,
'1.0',
))
name = 'pyLibravatar'
url = 'https://pypi.python.org/pypi/pyLibravatar'
mod = get_version_module('libravatar', name, url)
if mod is not None:
result.append((
name,
url,
'N/A',
'',
))
return result
......
......@@ -330,8 +330,10 @@ def not_found(request):
def about(request):
'''
Shows about page with version information.
'''
context = {}
versions = get_versions()
totals = Profile.objects.aggregate(Sum('translated'), Sum('suggested'))
total_strings = 0
for project in SubProject.objects.iterator():
......@@ -349,7 +351,7 @@ def about(request):
).distinct().count()
context['total_checks'] = Check.objects.count()
context['ignored_checks'] = Check.objects.filter(ignore=True).count()
context['versions'] = versions
context['versions'] = get_versions(True)
return render_to_response('about.html', RequestContext(request, context))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment