summaryrefslogtreecommitdiffstats
path: root/expand-translations
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:36:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:36:24 +0000
commit2d190fe39a843d10b121d8dcff234dd590e7fc0c (patch)
tree4489bd5d968f9696b1c807fec58839785f719962 /expand-translations
parentInitial commit. (diff)
downloadisa-support-upstream.tar.xz
isa-support-upstream.zip
Adding upstream version 15.1.upstream/15.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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