This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
ckanext-ozwillo-theme/update-translations.sh

21 lines
652 B
Bash
Executable File

#! /bin/sh
CKAN_INSTALL_DIR=../venv/src/ckan/
python setup.py extract_messages --mapping-file babel.cfg --output i18n/ckanext.pot
for LANG in fr es ca it bg tr
do
if [ -e i18n/$LANG/LC_MESSAGES/ckanext.po ]
then
python setup.py update_catalog -l $LANG -i i18n/ckanext.pot -o i18n/$LANG/LC_MESSAGES/ckanext.po
else
python setup.py init_catalog -l $LANG -i i18n/ckanext.pot -o i18n/$LANG/LC_MESSAGES/ckanext.po
fi
test -d $CKAN_INSTALL_DIR && msgcat --use-first \
"i18n/$LANG/LC_MESSAGES/ckanext.po" \
"$CKAN_INSTALL_DIR/ckan/i18n/$LANG/LC_MESSAGES/ckan.po" \
| msgfmt - -o "$CKAN_INSTALL_DIR/ckan/i18n/$LANG/LC_MESSAGES/ckan.mo"
done