From 19bf79095eb037cbde14932b38d5d60241e02af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 23 Jun 2015 17:01:22 +0200 Subject: [PATCH] Feature #3748: Update .po generators for new dirs and hbs files --- src/sunstone/locale/generate_messages_pot.sh | 19 ++++++++++++++++--- .../locale/upgrade_po_translations.sh | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/sunstone/locale/generate_messages_pot.sh b/src/sunstone/locale/generate_messages_pot.sh index 3500fb47d8..fae8c1a9e6 100755 --- a/src/sunstone/locale/generate_messages_pot.sh +++ b/src/sunstone/locale/generate_messages_pot.sh @@ -19,7 +19,20 @@ COPYRIGHT_HOLDER="2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs" PACKAGE_NAME="OpenNebula" -find ../public/js -name \*.js > file_list.txt -xgettext --from-code=utf-8 --copyright-holder="$COPYRIGHT_HOLDER" --package-name="$PACKAGE_NAME" --no-wrap --keyword=tr -L python -f file_list.txt -p . +find ../public/app -name \*.js > file_list.txt +xgettext --from-code=utf-8 --copyright-holder="$COPYRIGHT_HOLDER" --package-name="$PACKAGE_NAME" --no-wrap --keyword= --keyword=tr -L JavaScript -f file_list.txt -p . + +# xgettext-template project: https://github.com/gmarty/xgettext +# tail removes the first configuration lines for msgid "" + +find ../public/app -name \*.hbs -exec sh -c "xgettext-template -L Handlebars --from-code utf-8 --force-po --keyword tr {}| tail -n +3 >> messages.po" \; + mv messages.po messages.pot -rm file_list.txt \ No newline at end of file + +# Because hbs files are done individually, we have duplicated entries +msguniq messages.pot -o messages.pot --no-wrap + +rm file_list.txt + +# TODO hbs tr helper as a parameter to other helpers: +# {{#advancedSection (tr "Advanced Options") }} \ No newline at end of file diff --git a/src/sunstone/locale/upgrade_po_translations.sh b/src/sunstone/locale/upgrade_po_translations.sh index dbb80f8006..a3277be2fc 100755 --- a/src/sunstone/locale/upgrade_po_translations.sh +++ b/src/sunstone/locale/upgrade_po_translations.sh @@ -20,4 +20,5 @@ for lang in $(ls languages/*.po); do msgmerge --backup=off --no-wrap --update $lang messages.pot + echo done \ No newline at end of file