Pootle is used to allow translators to collaborate on both doing the initial translation & refining it once 'completed'.


Assuming a base Debian stable (10.x) - Python 2.7 as default:

apt-get update
apt-get upgrade -y
apt-get install -y exim4
dpkg-reconfigure exim4-config

apt-get install -y build-essential libxml2-dev libxslt-dev python-dev python-pip zlib1g-dev
apt-get install -y nginx python-certbot-nginx
certbot --nginx -n --agree-tos --email -d
# Copy to server: /etc/nginx/sites-available/default
cd /tmp
zxvf uwsgi-2.0.18.tar.gz
cd uwsgi-2.0.18
python --build pyonly
cp uwsgi /usr/local/bin
chmod 755 /usr/local/bin/uwsgi
# Copy to server: /etc/init.d/uwsgi-pootle
chmod 755 /etc/init.d/uwsgi-pootle
/etc/init.d/uwsgi-pootle defaults
apt-get -y install "postgresql-11" "pgtop"
cat << EOF >> "/etc/sysctl.conf"
## Increase Shared Memory available for PostgreSQL
# 1024Mb (may need more)
kernel.shmmax = 552992768
kernel.shmall = 2097152
sysctl -w kernel.shmmax=552992768 # For 1024 MB RAM
sysctl -w kernel.shmall=2097152
sed -i 's|#track_counts = on|track_counts = on|' /etc/postgresql/11/main/postgresql.conf
sed -i 's|#autovacuum = on|autovacuum = on|' /etc/postgresql/11/main/postgresql.conf
sed -i 's|max_connections = 100|max_connections = 20|' /etc/postgresql/11/main/postgresql.conf
# 1024Mb RAM: (e.g. t2.micro)
sed -i 's|#effective_cache_size = 4GB|effective_cache_size = 512MB|' /etc/postgresql/11/main/postgresql.conf
sed -i 's|#work_mem = 4MB|work_mem = 8MB|' /etc/postgresql/11/main/postgresql.conf
service postgresql restart

su postgres
createuser -P pootle
createdb --encoding='utf8' --locale=en_US.utf8 --template=template0 --owner=pootle pootledb
apt-get install -y redis-server
adduser pootle
# Copy to server: /home/pootle/uwsgi.ini
# Copy to server: /home/pootle/
pip install virtualenv
su pootle
virtualenv env
source env/bin/activate
pip install --upgrade pip setuptools
pip install psycopg2
pip install Pootle
pip install django-appconf==1.0.3
pip install redis==2.10.6
pootle init
# Copy to server: /home/pootle/env/pootle.conf
chown pootle /home/pootle/env/pootle.conf
mkdir -p /home/pootle/translations/eden
chown --recursive /home/pootle/translations
# Extract templates.pot using --pot in
# Copy to server: /home/pootle/translations/eden/templates.pot
pootle rqworker &
pootle migrate
pootle initdb
pootle createsuperuser
pootle verify_user admin
# Copy to server: /etc/init.d/rqworker
chmod 755 /etc/init.d/rqworker
/etc/init.d/rqworker defaults


See UserGuidelines/Localisation#A.UsingPootle


When adding languages, use this resource to configure them properly:

The script that Fran used to use to update files between Git & Pootle is:

If the script fails, check for the presence of a ` in a T("") - this causes the to reset the languages/* to default &/or stop web2py2po from working!


cat << EOF > "/usr/local/bin/backup"
NOW=\$(date +"%Y-%m-%d")
tar cvf /root/po-\$NOW.tar /home/pootle/translations
bzip2 -z9 /root/po-\$NOW.tar
su -c - postgres "pg_dump -c pootledb > /tmp/pootledb-\$NOW.sql"
bzip2 -z9 /tmp/pootledb-\$NOW.sql
mv /tmp/pootledb-\$NOW.sql.bz2 /root
OLD=\$(date --date='7 day ago' +"%Y-%m-%d")
rm -f /root/pootledb-\$OLD.sql.bz2
rm -f /root/po-\$OLD.tar.bz2
chmod +x /usr/local/bin/backup

# Schedule backups for 02:01 daily
echo "1 2   * * * * root    /usr/local/bin/backup" >> "/etc/crontab"


Last modified 11 months ago Last modified on 04/04/20 21:31:20

Attachments (6)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.