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.*
...
@@ -17,3 +17,4 @@ weblate-*.tar.*
*.sublime-*
*.sublime-*
/Weblate.egg-info/
/Weblate.egg-info/
/build/
/build/
/pyuca
.travis.yml
View file @
3f39074f
...
@@ -21,8 +21,6 @@ before_install:
...
@@ -21,8 +21,6 @@ before_install:
-
git clone --depth 1 --branch v0.1.2 https://github.com/ruleant/buildtime-trend.git $HOME/buildtime-trend
-
git clone --depth 1 --branch v0.1.2 https://github.com/ruleant/buildtime-trend.git $HOME/buildtime-trend
-
source $HOME/buildtime-trend/init.sh
-
source $HOME/buildtime-trend/init.sh
-
timestamp.sh packages
-
timestamp.sh packages
-
sudo apt-get update -qq
-
sudo apt-get install git libicu-dev
# commands to install dependencies
# commands to install dependencies
install
:
install
:
-
timestamp.sh install
-
timestamp.sh install
...
@@ -32,8 +30,6 @@ install:
...
@@ -32,8 +30,6 @@ install:
before_script
:
before_script
:
-
timestamp.sh before_script
-
timestamp.sh before_script
-
./ci/setup-env
-
./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
# commands to run tests
script
:
script
:
-
timestamp.sh tests
-
timestamp.sh tests
...
@@ -48,6 +44,7 @@ cache:
...
@@ -48,6 +44,7 @@ cache:
apt
:
true
apt
:
true
directories
:
directories
:
-
$HOME/.pip-cache/
-
$HOME/.pip-cache/
sudo
:
false
matrix
:
matrix
:
allow_failures
:
allow_failures
:
-
python
:
"
2.7"
-
python
:
"
2.7"
...
...
ci/install
View file @
3f39074f
...
@@ -4,6 +4,7 @@ set -e
...
@@ -4,6 +4,7 @@ set -e
set
-x
set
-x
pip
install
$CI_DJANGO
pip
install
$CI_DJANGO
pip
install
https://github.com/SmileyChris/pyuca/archive/master.zip
pip
install
\
pip
install
\
-r
requirements-optional.txt
\
-r
requirements-optional.txt
\
-r
requirements-django-1.6.txt
\
-r
requirements-django-1.6.txt
\
...
...
docs/admin/install.rst
View file @
3f39074f
...
@@ -32,8 +32,8 @@ dateutil
...
@@ -32,8 +32,8 @@ dateutil
http://labix.org/python-dateutil
http://labix.org/python-dateutil
libravatar (optional for federated avatar support)
libravatar (optional for federated avatar support)
https://pypi.python.org/pypi/pyLibravatar
https://pypi.python.org/pypi/pyLibravatar
PyICU
(optional for proper sorting of strings)
pyuca
(optional for proper sorting of strings)
https://
pypi.python.org/pypi/PyICU
https://
github.com/jtauber/pyuca
babel (optional for Android resources support)
babel (optional for Android resources support)
http://babel.pocoo.org/
http://babel.pocoo.org/
Database backend
Database backend
...
@@ -49,7 +49,7 @@ you can use apt-get:
...
@@ -49,7 +49,7 @@ you can use apt-get:
apt-get install python-django translate-toolkit \
apt-get install python-django translate-toolkit \
python-whoosh python-pil python-django-south python-libravatar \
python-whoosh python-pil python-django-south python-libravatar \
python-
pyicu python-
babel
python-babel
# Optional for database backend
# Optional for database backend
...
@@ -80,7 +80,7 @@ All requirements are available either directly in openSUSE or in
...
@@ -80,7 +80,7 @@ All requirements are available either directly in openSUSE or in
.. code-block:: sh
.. 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-Whoosh python-Pillow python-South python-python-social-auth \
python-babel
python-babel
...
@@ -414,16 +414,16 @@ you install `pyLibavatar`_, you will get proper support for federated avatars.
...
@@ -414,16 +414,16 @@ you install `pyLibavatar`_, you will get proper support for federated avatars.
.. _pyLibavatar: https://pypi.python.org/pypi/pyLibravatar
.. _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
way language names are properly sorted even in non-ASCII languages like
Japanese, Chinese or Arabic or for languages with accented letters.
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:
.. _production-secret:
...
...
requirements-optional.txt
View file @
3f39074f
-r requirements.txt
-r requirements.txt
PyICU
pyuca
pyLibravatar
pyLibravatar
pydns
pydns
babel
babel
...
...
weblate/accounts/forms.py
View file @
3f39074f
...
@@ -34,10 +34,10 @@ import unicodedata
...
@@ -34,10 +34,10 @@ import unicodedata
import
weblate
import
weblate
try
:
try
:
import
icu
# pylint: disable=import-error
import
pyuca
# pylint: disable=import-error
HAS_
ICU
=
True
HAS_
PYUCA
=
True
except
ImportError
:
except
ImportError
:
HAS_
ICU
=
False
HAS_
PYUCA
=
False
def
remove_accents
(
input_str
):
def
remove_accents
(
input_str
):
...
@@ -53,20 +53,18 @@ def sort_choices(choices):
...
@@ -53,20 +53,18 @@ def sort_choices(choices):
'''
'''
Sorts choices alphabetically.
Sorts choices alphabetically.
Either using cmp or
ICU
.
Either using cmp or
pyuca
.
'''
'''
if
not
HAS_
ICU
:
if
not
HAS_
PYUCA
:
return
sorted
(
return
sorted
(
choices
,
choices
,
key
=
lambda
tup
:
remove_accents
(
tup
[
1
])
key
=
lambda
tup
:
remove_accents
(
tup
[
1
])
.
lower
()
)
)
else
:
else
:
locale
=
icu
.
Locale
(
get_language
())
collator
=
pyuca
.
Collator
()
collator
=
icu
.
Collator
.
createInstance
(
locale
)
return
sorted
(
return
sorted
(
choices
,
choices
,
key
=
lambda
tup
:
tup
[
1
],
key
=
lambda
tup
:
collator
.
sort_key
(
unicode
(
tup
[
1
]))
cmp
=
collator
.
compare
)
)
...
...
weblate/requirements.py
View file @
3f39074f
...
@@ -53,15 +53,15 @@ def get_optional_versions():
...
@@ -53,15 +53,15 @@ def get_optional_versions():
'''
'''
result
=
[]
result
=
[]
name
=
'
ICU
'
name
=
'
pyuca
'
url
=
'https://
pypi.python.org/pypi/PyICU
'
url
=
'https://
github.com/jtauber/pyuca
'
mod
=
get_version_module
(
'
icu
'
,
name
,
url
,
True
)
mod
=
get_version_module
(
'
pyuca
'
,
name
,
url
,
True
)
if
mod
is
not
None
:
if
mod
is
not
None
:
result
.
append
((
result
.
append
((
name
,
name
,
url
,
url
,
mod
.
VERSION
,
'N/A'
,
'1.0'
,
None
,
))
))
name
=
'pyLibravatar'
name
=
'pyLibravatar'
...
...
weblate/trans/admin_views.py
View file @
3f39074f
...
@@ -28,7 +28,7 @@ from django.conf import settings
...
@@ -28,7 +28,7 @@ from django.conf import settings
from
weblate
import
settings_example
from
weblate
import
settings_example
from
weblate
import
appsettings
from
weblate
import
appsettings
from
weblate.accounts.avatar
import
HAS_LIBRAVATAR
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
from
weblate.trans.util
import
get_configuration_errors
,
get_clean_env
import
weblate
import
weblate
import
django
import
django
...
@@ -138,11 +138,11 @@ def performance(request):
...
@@ -138,11 +138,11 @@ def performance(request):
HAS_LIBRAVATAR
,
HAS_LIBRAVATAR
,
'production-avatar'
,
'production-avatar'
,
))
))
#
PyICU
library
#
pyuca
library
checks
.
append
((
checks
.
append
((
_
(
'
PyICU
library'
),
_
(
'
pyuca
library'
),
HAS_
ICU
,
HAS_
PYUCA
,
'production-py
icu
'
,
'production-py
uca
'
,
))
))
# Cookie signing key
# Cookie signing key
checks
.
append
((
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