summaryrefslogtreecommitdiffstats
path: root/expand-translations
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:12:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:12:25 +0000
commit0013fdf36b7348479f57d989a014bdd9e8a656f1 (patch)
treecc90b6104296a98c953a704d6b0eab0ca5542010 /expand-translations
parentInitial commit. (diff)
downloadisa-support-0013fdf36b7348479f57d989a014bdd9e8a656f1.tar.xz
isa-support-0013fdf36b7348479f57d989a014bdd9e8a656f1.zip
Adding upstream version 21.upstream/21
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'expand-translations')
-rwxr-xr-xexpand-translations29
1 files changed, 29 insertions, 0 deletions
diff --git a/expand-translations b/expand-translations
new file mode 100755
index 0000000..0683507
--- /dev/null
+++ b/expand-translations
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+set -eu
+
+outdir="$1"
+
+mkdir -p "$outdir"
+
+isas=$(cat isa-list | grep ^Name | cut -d " " -f2)
+
+for po in debian/po/*.po ; do
+ po2="$outdir/$(basename "$po")"
+ truncate -s0 "$po2"
+
+ echo "Extending $po: s/&NAME&/\$isa > $po2"
+ csplit --quiet --suppress-matched -f "$po2." -b '%02d.sect' "$po" '/^$/' '{*}'
+ for sect in $(ls -1 $po2*.sect | sort -n) ; do
+ if grep -q '@NAME@' $sect ; then
+ for isa in $isas ; do
+ cat $sect | sed -e "s/@NAME@/$isa/g" >> "$po2"
+ echo >> "$po2"
+ done
+ else
+ cat $sect >> "$po2"
+ echo >> "$po2"
+ fi
+ rm $sect
+ done
+done