Fix Czech characters in Sahana and SAMBRO PDF exports, closes #8

This commit is contained in:
Disassembler 2017-09-18 22:29:17 +02:00
parent 684f57de8c
commit f3fd928977
4 changed files with 25 additions and 4 deletions

View File

@ -31,11 +31,19 @@ mkdir -p /srv/sahana/applications/eden/static/cache/chart
mkdir -p /srv/sahana/applications/eden/uploads/{gis_cache,images,tracks} mkdir -p /srv/sahana/applications/eden/uploads/{gis_cache,images,tracks}
export SAHANA_HMAC=$(head -c 18 /dev/urandom | base64) export SAHANA_HMAC=$(head -c 18 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/sahana/srv/sahana/applications/eden/models/000_config.py >/srv/sahana/applications/eden/models/000_config.py envsubst <${SOURCE_DIR}/sahana/srv/sahana/applications/eden/models/000_config.py >/srv/sahana/applications/eden/models/000_config.py
cp ${SOURCE_DIR}/sahana/srv/sahana/applications/eden/modules/templates/default/config.py /srv/sahana/applications/eden/modules/templates/default/config.py
# Copy Czech language file
cp ${SOURCE_DIR}/sahana/srv/sahana/applications/eden/languages/cs.py /srv/sahana/applications/eden/languages/cs.py
# Symlink fonts with Czech glyphs
ln -s /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf /srv/sahana/applications/eden/static/fonts/DejaVuSerif-Bold.ttf
ln -s /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf /srv/sahana/applications/eden/static/fonts/DejaVuSerif.ttf
# Prepare template
export SAHANA_ADMIN_USER=admin@example.com export SAHANA_ADMIN_USER=admin@example.com
export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export SAHANA_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
cp ${SOURCE_DIR}/sahana/srv/sahana/applications/eden/modules/templates/default/config.py /srv/sahana/applications/eden/modules/templates/default/config.py
envsubst <${SOURCE_DIR}/sahana/srv/sahana/applications/eden/modules/templates/default/users/masterUsers.csv >/srv/sahana/applications/eden/modules/templates/default/users/masterUsers.csv envsubst <${SOURCE_DIR}/sahana/srv/sahana/applications/eden/modules/templates/default/users/masterUsers.csv >/srv/sahana/applications/eden/modules/templates/default/users/masterUsers.csv
cp ${SOURCE_DIR}/sahana/srv/sahana/applications/eden/languages/cs.py /srv/sahana/applications/eden/languages/cs.py
# Create OS user # Create OS user
adduser --system --group --home /srv/sahana --shell /bin/false sahana adduser --system --group --home /srv/sahana --shell /bin/false sahana

View File

@ -31,11 +31,19 @@ mkdir -p /srv/sambro/applications/eden/static/cache/chart
mkdir -p /srv/sambro/applications/eden/uploads/{gis_cache,images,tracks} mkdir -p /srv/sambro/applications/eden/uploads/{gis_cache,images,tracks}
export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64) export SAMBRO_HMAC=$(head -c 18 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/sambro/srv/sambro/applications/eden/models/000_config.py >/srv/sambro/applications/eden/models/000_config.py envsubst <${SOURCE_DIR}/sambro/srv/sambro/applications/eden/models/000_config.py >/srv/sambro/applications/eden/models/000_config.py
cp ${SOURCE_DIR}/sambro/srv/sambro/applications/eden/modules/templates/SAMBRO/config.py /srv/sambro/applications/eden/modules/templates/SAMBRO/config.py
# Copy Czech language file
cp ${SOURCE_DIR}/sambro/srv/sambro/applications/eden/languages/cs.py /srv/sambro/applications/eden/languages/cs.py
# Symlink fonts with Czech glyphs
ln -s /usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf /srv/sambro/applications/eden/static/fonts/DejaVuSerif-Bold.ttf
ln -s /usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf /srv/sambro/applications/eden/static/fonts/DejaVuSerif.ttf
# Prepare template
export SAMBRO_ADMIN_USER=admin@example.com export SAMBRO_ADMIN_USER=admin@example.com
export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64) export SAMBRO_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
cp ${SOURCE_DIR}/sambro/srv/sambro/applications/eden/modules/templates/SAMBRO/config.py /srv/sambro/applications/eden/modules/templates/SAMBRO/config.py
envsubst <${SOURCE_DIR}/sambro/srv/sambro/applications/eden/modules/templates/default/users/masterUsers.csv >/srv/sambro/applications/eden/modules/templates/default/users/masterUsers.csv envsubst <${SOURCE_DIR}/sambro/srv/sambro/applications/eden/modules/templates/default/users/masterUsers.csv >/srv/sambro/applications/eden/modules/templates/default/users/masterUsers.csv
cp ${SOURCE_DIR}/sambro/srv/sambro/applications/eden/languages/cs.py /srv/sambro/applications/eden/languages/cs.py
# Create OS user # Create OS user
adduser --system --group --home /srv/sambro --shell /bin/false sambro adduser --system --group --home /srv/sambro --shell /bin/false sambro

View File

@ -171,6 +171,8 @@ def config(settings):
#settings.L10n.translate_org_organisation = True #settings.L10n.translate_org_organisation = True
# Uncomment this to Translate Site Names # Uncomment this to Translate Site Names
#settings.L10n.translate_org_site = True #settings.L10n.translate_org_site = True
# PDF font
settings.L10n.pdf_export_font = ['DejaVuSerif', 'DejaVuSerif-Bold']
# Finance settings # Finance settings
settings.fin.currencies = { settings.fin.currencies = {

View File

@ -127,6 +127,9 @@ def config(settings):
# Time Format # Time Format
settings.L10n.time_format = "%H:%M:%S" settings.L10n.time_format = "%H:%M:%S"
# PDF font
settings.L10n.pdf_export_font = ['DejaVuSerif', 'DejaVuSerif-Bold']
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Messaging # Messaging
# Parser # Parser