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 https://redmine.tails.boum.org/code/issues/16774#note-25.
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\"" ...@@ -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 # Ensure we only keep PO files that are still present in the Transifex
# branch we import from. # 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, # For each completely translated language, merge it,
# unless it is translated outside Transifex # unless it is translated outside Transifex
...@@ -100,6 +101,23 @@ else ...@@ -100,6 +101,23 @@ else
done done
fi fi
# 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"
fi
rm "$orig_po_file"
done
fi
# Update PO files # Update PO files
if [ -n "${AFTER_IMPORT:-}" ]; then if [ -n "${AFTER_IMPORT:-}" ]; then
eval "$AFTER_IMPORT" eval "$AFTER_IMPORT"
......
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