Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New pot script #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ scripts:

Little shell shortcut for exporting a translation template from any addon(s). Usage:

pot my_addon,my_other_addon
pot my_addon,my_other_addon lang

### [`psql`](https://www.postgresql.org/docs/current/app-psql.html)

Expand Down
20 changes: 15 additions & 5 deletions bin/pot
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
set -e
addons=$1
shift
log INFO Executing Odoo in i18n export mode for addons $addons
# HACK Odoo needs a *.po file to guess the output format
ln -sf /dev/stdout /tmp/stdout.po
languages=$1
shift
log INFO Executing Odoo in i18n export mode with languages $languages for addons $addons
set -x
exec odoo --stop-after-init -d "$PGDATABASE" --i18n-export /tmp/stdout.po \
--modules "$addons" --update "$addons" --workers 0 "$@"
for l in $(echo $languages | tr "," "\n")
do
for i in $(echo $addons | tr "," "\n")
do
if [ -d /opt/odoo/auto/addons/$i ]
then
mkdir -p /opt/odoo/auto/addons/$i/i18n && odoo --stop-after-init -d "$PGDATABASE" \
--language $l --i18n-export /opt/odoo/auto/addons/$i/i18n/${l}.po \
--modules "$i" --update "$i" --workers 0 "$@"
fi
done
done