summaryrefslogtreecommitdiffstats
path: root/import-translations
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2019-09-30 13:26:23 +0000
committersegfault <segfault@riseup.net>2019-10-03 11:23:54 +0200
commit281f91a4ccd4282f35fd2688c1569c08ad86699e (patch)
treec76c561402befd56829cd1b23f2611b00d1ef089 /import-translations
parent8be6abb391e27d4c601a014b98b11a6638d2b51a (diff)
import-translations: refactor to leave room for more checks.
Else, I'll need to start nesting if…then conditions, which leads to spaghetti code.
Diffstat (limited to 'import-translations')
-rwxr-xr-ximport-translations14
1 files changed, 6 insertions, 8 deletions
diff --git a/import-translations b/import-translations
index 6cbc5a2..7c95ac2 100755
--- a/import-translations
+++ b/import-translations
@@ -74,19 +74,17 @@ if [ "$LANG_DOT_PO_LAYOUT" = yes ] ; then
find "$TOR_TRANSLATION_DIR" -name '*.po' | while read po_file; do
lang=$(basename "$po_file" | tr - _ | sed 's/\.po$//')
- if ! lang_is_excluded "$lang"; then
- echo "Importing translation for $lang..."
- cp "$po_file" "$TAILS_PO_DIR"
- fi
+ ! lang_is_excluded "$lang" || continue
+ echo "Importing translation for $lang..."
+ cp "$po_file" "$TAILS_PO_DIR"
done
else
find "$TOR_TRANSLATION_DIR" -name '*.pot' | while read po_file; do
lang=$(basename $(dirname "$po_file" | tr - _ | sed 's/\.pot$//'))
- if ! lang_is_excluded "$lang"; then
- echo "Importing translation for $lang..."
- cp "$po_file" "$TAILS_PO_DIR/${lang}.po"
- fi
+ ! lang_is_excluded "$lang" || continue
+ echo "Importing translation for $lang..."
+ cp "$po_file" "$TAILS_PO_DIR/${lang}.po"
done
fi