merge of '447d847eb838367672bc21cfb5b2ff6b9984922e'

and '88a9eef5dd75416a1ccd8dba36ff97bc1c852638'
This commit is contained in:
kytv
2013-09-04 12:12:35 +00:00
16 changed files with 53 additions and 39 deletions

View File

@@ -1,2 +1,5 @@
env env
pots pots
\.pyc$
\.pyo$
~$

View File

@@ -1,11 +1,13 @@
#!/bin/sh #!/bin/sh
. ./etc/translation.vars . ./etc/translation.vars
export TZ=UTC
if [ $# -ge 1 ] if [ $# -ge 1 ]
then then
TZ=UTC env/bin/pybabel compile -D $1 -d $TRANSDIR $PYBABEL compile -D $1 -d $TRANSDIR
else else
for domain in $(ls $BABELCFG); do for domain in $(ls $BABELCFG); do
TZ=UTC env/bin/pybabel compile -D $domain -d $TRANSDIR $PYBABEL compile -D $domain -d $TRANSDIR
done done
fi fi

View File

@@ -1,3 +1,4 @@
pytz>=2012
Flask==0.9 Flask==0.9
Flask-Babel==0.8 Flask-Babel==0.8
Flask-Cache==0.10.1 Flask-Cache==0.10.1

View File

@@ -4,3 +4,12 @@ BABELCFG=etc/babel.cfg
POTDIR=pots POTDIR=pots
PROJDIR=i2p2www PROJDIR=i2p2www
TRANSDIR=$PROJDIR/translations TRANSDIR=$PROJDIR/translations
if [ -x env/bin/pybabel ]; then
PYBABEL=env/bin/pybabel
elif [ $(which pybabel) ]; then
PYBABEL=$(which pybabel)
else
echo "ERROR: pybabel was not found. Please run setup_venv.sh" >&2
exit 1
fi

View File

@@ -1,13 +1,19 @@
#!/bin/sh #!/bin/sh
. ./etc/translation.vars . ./etc/translation.vars
export TZ=UTC
if [ ! -e $POTDIR ]; then if [ ! -e $POTDIR ]; then
mkdir $POTDIR mkdir $POTDIR
fi fi
# By setting the PYTHONPATH here we can help pybabel find 'our' highlighting
# extension and we can use any pybabel
export PYTHONPATH=i2p2www:$PYTHONPATH
if [ $# -ge 1 ] if [ $# -ge 1 ]
then then
TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \ $PYBABEL extract --msgid-bugs-address="http://trac.i2p2.de" \
--project=$PROJECT \ --project=$PROJECT \
--version=$VERSION \ --version=$VERSION \
-F $BABELCFG/$1 \ -F $BABELCFG/$1 \
@@ -17,7 +23,7 @@ else
if [ -e $POTDIR/$domain.pot ]; then if [ -e $POTDIR/$domain.pot ]; then
mv $POTDIR/$domain.pot $POTDIR/$domain.pot.old mv $POTDIR/$domain.pot $POTDIR/$domain.pot.old
fi fi
TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \ $PYBABEL extract --msgid-bugs-address="http://trac.i2p2.de" \
--project=$PROJECT \ --project=$PROJECT \
--version=$VERSION \ --version=$VERSION \
-F $BABELCFG/$domain \ -F $BABELCFG/$domain \

View File

@@ -1,6 +1,12 @@
from flask import Flask, request, g, redirect, url_for, abort, render_template, send_from_directory, safe_join from flask import Flask, request, g, redirect, url_for, abort, render_template, send_from_directory, safe_join
from flaskext.babel import Babel try:
from flask.ext.cache import Cache from flaskext.babel import Babel
except ImportError:
from flask_babel import Babel
try:
from flask.ext.cache import Cache
except ImportError:
from flask_cache import Cache
from docutils.core import publish_parts from docutils.core import publish_parts
import os.path import os.path
import os import os

View File

@@ -1210,8 +1210,7 @@ msgid ""
"<a href=\"%(german)s\">German translation</a>" "<a href=\"%(german)s\">German translation</a>"
msgstr "" msgstr ""
"<a href=\"%(link)s\">zzz entrevistado por gulli.com</a>\n" "<a href=\"%(link)s\">zzz entrevistado por gulli.com</a>\n"
"Marzo de 2009\n" "href=\"%(german)s\">traducción en alemán</a>"
"<a href=\"%(german)s\">Traducción al alemán</a>"
#: i2p2www/pages/site/about/media.html:202 #: i2p2www/pages/site/about/media.html:202
#, python-format #, python-format

View File

@@ -12854,7 +12854,7 @@ msgid ""
"It is hosted on <a href=\"%(pybit)s\">%(pybit)s</a> <!-- TODO: expand -->" "It is hosted on <a href=\"%(pybit)s\">%(pybit)s</a> <!-- TODO: expand -->"
msgstr "" msgstr ""
"PyBit es un cliente Bittorrent escrito en python. Se aloja en <a " "PyBit es un cliente Bittorrent escrito en python. Se aloja en <a "
"href=\"http://%(pebcache)s/\">http://%(pebcache)s/</a> <!-- TODO: " "href=\"http://%(pybit)s/\">http://%(pybit)s/</a> <!-- TODO: "
"desarrollar -->" "desarrollar -->"
#: i2p2www/pages/site/docs/how/tech-intro.html:1015 #: i2p2www/pages/site/docs/how/tech-intro.html:1015

View File

@@ -2316,7 +2316,7 @@ msgstr ""
"Si considera todas las eepsites que se han creado, si, la mayoría no " "Si considera todas las eepsites que se han creado, si, la mayoría no "
"funcionan. La gente y las eepsites van y vienen. Una buena forma de " "funcionan. La gente y las eepsites van y vienen. Una buena forma de "
"comenzar con I2P es mirar la lista de eepsites que funcionan actualmente." "comenzar con I2P es mirar la lista de eepsites que funcionan actualmente."
" <a href=\\\"http://%(perv)s/stats.cgi\\\">%(perv)s</a> informa qué " " <a href=\\\"http://%(eepstatus)s/\\\">%(eepstatus)s</a> informa qué "
"páginas están activas." "páginas están activas."
#: i2p2www/pages/site/faq.html:385 #: i2p2www/pages/site/faq.html:385

View File

@@ -2313,7 +2313,7 @@ msgstr ""
"Les gens et les eepsites vont et viennent.\n" "Les gens et les eepsites vont et viennent.\n"
"Une bonne façon de se lancer dans I2P est de vérifier une liste de " "Une bonne façon de se lancer dans I2P est de vérifier une liste de "
"eepsites qui sont actuellement en place.\n" "eepsites qui sont actuellement en place.\n"
"<a href=\"http://%(perv)s/stats.cgi\">%(perv)s</a> trace les eepsites " "<a href=\"http://%(eepstatus)s\">%(eepstatus)s</a> trace les eepsites "
"actifs." "actifs."
#: i2p2www/pages/site/faq.html:385 #: i2p2www/pages/site/faq.html:385

View File

@@ -1,10 +1,12 @@
#!/bin/sh #!/bin/sh
. ./etc/translation.vars . ./etc/translation.vars
export TZ=UTC
if [ $# -ge 1 ] if [ $# -ge 1 ]
then then
for domain in $(ls $BABELCFG); do for domain in $(ls $BABELCFG); do
TZ=UTC env/bin/pybabel init -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR -l $1 $PYBABEL init -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR -l $1
done done
else else
echo "Usage: ./init-new-po.sh lang" echo "Usage: ./init-new-po.sh lang"

10
pybabel
View File

@@ -1,10 +0,0 @@
#!env/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'Babel==0.9.6','console_scripts','pybabel'
__requires__ = 'Babel==0.9.6'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('Babel==0.9.6', 'console_scripts', 'pybabel')()
)

View File

@@ -4,6 +4,7 @@ set -e
if [ ! $venv ]; then if [ ! $venv ]; then
echo "ERROR: virtualenv not found!" >&2 echo "ERROR: virtualenv not found!" >&2
exit 1
else else
if [ ! -d $venv_dir ] ; then if [ ! -d $venv_dir ] ; then
$venv --distribute $venv_dir $venv --distribute $venv_dir
@@ -12,5 +13,5 @@ else
. $venv_dir/bin/activate . $venv_dir/bin/activate
pip install -r etc/reqs.txt pip install -r etc/reqs.txt
# Apply multi-domain patch to Flask-Babel # Apply multi-domain patch to Flask-Babel
patch -p0 <etc/multi-domain.patch patch -p0 -N -r - <etc/multi-domain.patch
fi fi

View File

@@ -1,18 +1,15 @@
#!/bin/sh #!/bin/sh
TMP=tmp TMP=$(mktemp XXXXXXXXXX)
trap 'rm -f $TMP;exit' 0 1 2 15
mtn update 2>&1 | tee $TMP mtn update 2>&1 | tee $TMP
cat $TMP | grep "^mtn: adding 'i2p2www/translations/\|^mtn: dropping 'i2p2www/translations/\|^mtn: updating 'i2p2www/translations/" >/dev/null if grep "^mtn: \(add\|dropp\|updat\)ing 'i2p2www/translations/" "$TMP" >/dev/null; then
if [ $? -eq 0 ]; then
echo "Translations updated, compiling messages" echo "Translations updated, compiling messages"
./compile-messages-i2hq.sh ./compile-messages-i2hq.sh
fi fi
cat $TMP | grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" >/dev/null if grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" >/dev/null; then
if [ $? -eq 0 ]; then
echo "Python files changed, restarting server" echo "Python files changed, restarting server"
touch /tmp/2fcd2f17-c293-4f77-b4c9-9b266ba70daa touch /tmp/2fcd2f17-c293-4f77-b4c9-9b266ba70daa
fi fi
rm $TMP

View File

@@ -1,18 +1,15 @@
#!/bin/sh #!/bin/sh
TMP=tmp TMP=$(mktemp XXXXXXXXXX)
trap 'rm -f $TMP;exit' 0 1 2 15
mtn update 2>&1 | tee $TMP mtn update 2>&1 | tee $TMP
cat $TMP | grep "^mtn: adding 'i2p2www/translations/\|^mtn: dropping 'i2p2www/translations/\|^mtn: updating 'i2p2www/translations/" >/dev/null if grep "^mtn: \(add\|dropp\|updat\)ing 'i2p2www/translations/" "$TMP" >/dev/null ; then
if [ $? -eq 0 ]; then
echo "Translations updated, compiling messages" echo "Translations updated, compiling messages"
./compile-messages.sh ./compile-messages.sh
fi fi
cat $TMP | grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" >/dev/null if grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" "$TMP" >/dev/null ; then
if [ $? -eq 0 ]; then
echo "Python files changed, restarting server" echo "Python files changed, restarting server"
touch /tmp/2fcd2f17-c293-4f77-b4c9-9b266ba70daa touch /tmp/2fcd2f17-c293-4f77-b4c9-9b266ba70daa
fi fi
rm $TMP

View File

@@ -1,11 +1,12 @@
#!/bin/sh #!/bin/sh
. ./etc/translation.vars . ./etc/translation.vars
export TZ=UTC
if [ $# -ge 1 ] if [ $# -ge 1 ]
then then
TZ=UTC env/bin/pybabel update -D $1 -i $POTDIR/$1.pot -d $TRANSDIR $PYBABEL update -D $1 -i $POTDIR/$1.pot -d $TRANSDIR
else else
for domain in $(ls $BABELCFG); do for domain in $(ls $BABELCFG); do
TZ=UTC env/bin/pybabel update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR $PYBABEL update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
done done
fi fi