Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
d1dc5257
Commit
d1dc5257
authored
Apr 15, 2013
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8158733c
c4915dca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
9 deletions
+55
-9
docs/install.rst
docs/install.rst
+12
-0
trans/admin_views.py
trans/admin_views.py
+6
-0
trans/requirements.py
trans/requirements.py
+33
-7
trans/views/basic.py
trans/views/basic.py
+4
-2
No files found.
docs/install.rst
View file @
d1dc5257
...
...
@@ -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
...
...
trans/admin_views.py
View file @
d1dc5257
...
...
@@ -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
(
...
...
trans/requirements.py
View file @
d1dc5257
...
...
@@ -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'
%
(
module
,
name
,
url
,
))
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
...
...
trans/views/basic.py
View file @
d1dc5257
...
...
@@ -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
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment