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
3f39074f
Commit
3f39074f
authored
Nov 14, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pyuca'
parents
e32cd7d9
4a234cc2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
33 deletions
+30
-33
.gitignore
.gitignore
+1
-0
.travis.yml
.travis.yml
+1
-4
ci/install
ci/install
+1
-0
docs/admin/install.rst
docs/admin/install.rst
+8
-8
requirements-optional.txt
requirements-optional.txt
+1
-1
weblate/accounts/forms.py
weblate/accounts/forms.py
+8
-10
weblate/requirements.py
weblate/requirements.py
+5
-5
weblate/trans/admin_views.py
weblate/trans/admin_views.py
+5
-5
No files found.
.gitignore
View file @
3f39074f
...
...
@@ -17,3 +17,4 @@ weblate-*.tar.*
*.sublime-*
/Weblate.egg-info/
/build/
/pyuca
.travis.yml
View file @
3f39074f
...
...
@@ -21,8 +21,6 @@ before_install:
-
git clone --depth 1 --branch v0.1.2 https://github.com/ruleant/buildtime-trend.git $HOME/buildtime-trend
-
source $HOME/buildtime-trend/init.sh
-
timestamp.sh packages
-
sudo apt-get update -qq
-
sudo apt-get install git libicu-dev
# commands to install dependencies
install
:
-
timestamp.sh install
...
...
@@ -32,8 +30,6 @@ install:
before_script
:
-
timestamp.sh before_script
-
./ci/setup-env
-
echo -e "[server]\nmax_allowed_packet=64M\nwait_timeout=28800" | sudo tee -a /etc/mysql/conf.d/weblate.cnf
-
sudo service mysql restart
# commands to run tests
script
:
-
timestamp.sh tests
...
...
@@ -48,6 +44,7 @@ cache:
apt
:
true
directories
:
-
$HOME/.pip-cache/
sudo
:
false
matrix
:
allow_failures
:
-
python
:
"
2.7"
...
...
ci/install
View file @
3f39074f
...
...
@@ -4,6 +4,7 @@ set -e
set
-x
pip
install
$CI_DJANGO
pip
install
https://github.com/SmileyChris/pyuca/archive/master.zip
pip
install
\
-r
requirements-optional.txt
\
-r
requirements-django-1.6.txt
\
...
...
docs/admin/install.rst
View file @
3f39074f
...
...
@@ -32,8 +32,8 @@ dateutil
http://labix.org/python-dateutil
libravatar (optional for federated avatar support)
https://pypi.python.org/pypi/pyLibravatar
PyICU
(optional for proper sorting of strings)
https://
pypi.python.org/pypi/PyICU
pyuca
(optional for proper sorting of strings)
https://
github.com/jtauber/pyuca
babel (optional for Android resources support)
http://babel.pocoo.org/
Database backend
...
...
@@ -49,7 +49,7 @@ you can use apt-get:
apt-get install python-django translate-toolkit \
python-whoosh python-pil python-django-south python-libravatar \
python-
pyicu python-
babel
python-babel
# Optional for database backend
...
...
@@ -80,7 +80,7 @@ All requirements are available either directly in openSUSE or in
.. code-block:: sh
zypper install python-Django
python-icu
translate-toolkit \
zypper install python-Django translate-toolkit \
python-Whoosh python-Pillow python-South python-python-social-auth \
python-babel
...
...
@@ -414,16 +414,16 @@ you install `pyLibavatar`_, you will get proper support for federated avatars.
.. _pyLibavatar: https://pypi.python.org/pypi/pyLibravatar
.. _production-py
icu
:
.. _production-py
uca
:
PyICU
library
pyuca
library
+++++++++++++
`
PyICU
`_ library is optionally used by Weblate to sort Unicode strings. This
`
pyuca
`_ 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
.. _
pyuca: https://github.com/jtauber/pyuca
.. _production-secret:
...
...
requirements-optional.txt
View file @
3f39074f
-r requirements.txt
PyICU
pyuca
pyLibravatar
pydns
babel
...
...
weblate/accounts/forms.py
View file @
3f39074f
...
...
@@ -34,10 +34,10 @@ import unicodedata
import
weblate
try
:
import
icu
# pylint: disable=import-error
HAS_
ICU
=
True
import
pyuca
# pylint: disable=import-error
HAS_
PYUCA
=
True
except
ImportError
:
HAS_
ICU
=
False
HAS_
PYUCA
=
False
def
remove_accents
(
input_str
):
...
...
@@ -53,20 +53,18 @@ def sort_choices(choices):
'''
Sorts choices alphabetically.
Either using cmp or
ICU
.
Either using cmp or
pyuca
.
'''
if
not
HAS_
ICU
:
if
not
HAS_
PYUCA
:
return
sorted
(
choices
,
key
=
lambda
tup
:
remove_accents
(
tup
[
1
])
key
=
lambda
tup
:
remove_accents
(
tup
[
1
])
.
lower
()
)
else
:
locale
=
icu
.
Locale
(
get_language
())
collator
=
icu
.
Collator
.
createInstance
(
locale
)
collator
=
pyuca
.
Collator
()
return
sorted
(
choices
,
key
=
lambda
tup
:
tup
[
1
],
cmp
=
collator
.
compare
key
=
lambda
tup
:
collator
.
sort_key
(
unicode
(
tup
[
1
]))
)
...
...
weblate/requirements.py
View file @
3f39074f
...
...
@@ -53,15 +53,15 @@ def get_optional_versions():
'''
result
=
[]
name
=
'
ICU
'
url
=
'https://
pypi.python.org/pypi/PyICU
'
mod
=
get_version_module
(
'
icu
'
,
name
,
url
,
True
)
name
=
'
pyuca
'
url
=
'https://
github.com/jtauber/pyuca
'
mod
=
get_version_module
(
'
pyuca
'
,
name
,
url
,
True
)
if
mod
is
not
None
:
result
.
append
((
name
,
url
,
mod
.
VERSION
,
'1.0'
,
'N/A'
,
None
,
))
name
=
'pyLibravatar'
...
...
weblate/trans/admin_views.py
View file @
3f39074f
...
...
@@ -28,7 +28,7 @@ from django.conf import settings
from
weblate
import
settings_example
from
weblate
import
appsettings
from
weblate.accounts.avatar
import
HAS_LIBRAVATAR
from
weblate.accounts.forms
import
HAS_
ICU
from
weblate.accounts.forms
import
HAS_
PYUCA
from
weblate.trans.util
import
get_configuration_errors
,
get_clean_env
import
weblate
import
django
...
...
@@ -138,11 +138,11 @@ def performance(request):
HAS_LIBRAVATAR
,
'production-avatar'
,
))
#
PyICU
library
#
pyuca
library
checks
.
append
((
_
(
'
PyICU
library'
),
HAS_
ICU
,
'production-py
icu
'
,
_
(
'
pyuca
library'
),
HAS_
PYUCA
,
'production-py
uca
'
,
))
# Cookie signing key
checks
.
append
((
...
...
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