I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit f9c88aa7 authored by str4d's avatar str4d
Browse files

Split translation strings between multiple domains

This breaks translation processing; multi-domain support needs to be added to
Flask-Babel. The changes made here put the "important" strings that are used
most often into the priority domain, and split the content from different
sub-urls into separate domains. Multi-domain support will be implemented such
that translations for a specific request are pulled both from the domain which
corresponds to the request url and the priority domain.

This does mean that there may be duplication of translation strings between
domains, but that is unavoidable (and the translators prefer working with
smaller resource files).
parent 177aecb5
No related branches found
No related tags found
No related merge requests found
env
.*\.pot
pots
[python: **.py]
[jinja2: **/pages/**.html]
[jinja2: **/pages/site/about/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/global/macros]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
[jinja2: **/blog/**.rst]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
[jinja2: **/blog/**.rst]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
[jinja2: **/pages/site/comparison/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/site/docs/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/site/get-involved/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/site/misc/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/blog/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/download/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/global/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/global/macros]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
[jinja2: **/pages/meetings/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/site/*.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
[jinja2: **/pages/site/research/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension
#!/bin/sh
. ./babel/translation.vars
. ./translation.vars
TZ=UTC env/bin/pybabel compile -d $TRANSDIR
for domain in $(ls $BABELCFG); do
TZ=UTC env/bin/pybabel compile -D $domain -d $TRANSDIR
done
#!/bin/sh
. ./babel/translation.vars
. ./translation.vars
TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \
if [ ! -e $POTDIR ]; then
mkdir $POTDIR
fi
for domain in $(ls $BABELCFG); do
TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \
--project=$PROJECT \
--version=$VERSION \
-F $BABELCFG \
-o $POTFILE $PROJDIR
-F $BABELCFG/$domain \
-o $POTDIR/$domain.pot $PROJDIR
done
#!/bin/sh
. ./babel/translation.vars
. ./translation.vars
if [ $# -ge 1 ]
then
TZ=UTC env/bin/pybabel init -i $POTFILE -d $TRANSDIR -l $1
for domain in $(ls $BABELCFG); do
TZ=UTC env/bin/pybabel init -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR -l $1
done
else
echo "Usage: ./init-new-po.sh lang"
fi
PROJECT=I2P
VERSION=website
CONFDIR=babel
BABELCFG=babel.cfg
POTDIR=pots
PROJDIR=i2p2www
BABELCFG=$CONFDIR/babel.cfg
POTFILE=messages.pot
TRANSDIR=$PROJDIR/translations
#!/bin/sh
. ./babel/translation.vars
. ./translation.vars
TZ=UTC env/bin/pybabel update -i $POTFILE -d $TRANSDIR
for domain in $(ls $BABELCFG); do
TZ=UTC env/bin/pybabel update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment