Commit 7194227c authored by intrigeri's avatar intrigeri
Browse files

import-translations: work around the lack of usable branches in Tor's...

import-translations: work around the lack of usable branches in Tor's translation.git (refs: #17279)

For all our Transifex resources but tails-misc, Tor's translation.git currently
has no usable branch:

 - The _completed branches that we pull from only have languages which are fully
   translated and reviewed, i.e. very few translations.

 - The non-_completed branches have have non-reviewed translations, which we
   don't want to ship anymore.

The real fix will be
We've been waiting for it for 3 months now, and it's not sustainable
that the RM has to manually workaround the currently problematic situation
by hand during every release process.

So in the meantime, keep shipping the PO files we've already imported
when no suitable up-to-date one is available.
parent 22522410
......@@ -70,7 +70,8 @@ eval "$GIT_IN_TOR_TRANSLATION_DIR reset --hard \"origin/$BRANCH\""
# Ensure we only keep PO files that are still present in the Transifex
# branch we import from.
find "$TAILS_PO_DIR" -name '*.po' -delete
# XXX: once #16774 is resolved, -delete these files instead.
find "$TAILS_PO_DIR" -name '*.po' -exec rename 's/$/.orig/' '{}' \;
# For each completely translated language, merge it,
# unless it is translated outside Transifex
......@@ -100,6 +101,23 @@ else
# The _completed branches we still pull from (because the _release
# branches we need don't exist yet) are mostly empty, so avoid l10n
# regressions by keeping old PO files instead of deleting them.
# XXX: remove this hack once #16774 is resolved.
if echo "$BRANCH" | grep -qs -E '_completed$'; then
find "$TAILS_PO_DIR" -name '*.po.orig' -o -name '*.pot.orig' \
| while read orig_po_file; do
po_file=$(echo "$orig_po_file" | sed 's/\.orig$//')
if ! [ -e "$po_file" ]; then
echo "${po_file} was removed ⇒ restoring ${orig_po_file}"
cp "$orig_po_file" "$po_file"
rm "$orig_po_file"
# Update PO files
if [ -n "${AFTER_IMPORT:-}" ]; then
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment