chore: set width variable to 120 for consistent msgmerge and xgettext formatting in localization scripts

This commit is contained in:
Andrey Petelin
2025-10-02 11:16:50 +05:00
parent 0cb5c2daae
commit 4d8e4c1c13
2 changed files with 5 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ set -euo pipefail
PODIR="po"
POTFILE="$PODIR/templates/podkop.pot"
WIDTH=120
if [ $# -ne 1 ]; then
echo "Usage: $0 <language_code> (e.g., ru, de, fr)"
@@ -19,11 +20,11 @@ fi
if [ -f "$POFILE" ]; then
echo "Updating $POFILE"
msgmerge --update "$POFILE" "$POTFILE"
msgmerge --update --width="$WIDTH" "$POFILE" "$POTFILE"
else
echo "Creating new $POFILE using msginit"
mkdir -p "$PODIR/$LANG"
msginit --no-translator --locale="$LANG" --width=120 --input="$POTFILE" --output-file="$POFILE"
msginit --no-translator --locale="$LANG" --width="$WIDTH" --input="$POTFILE" --output-file="$POFILE"
fi
echo "Translation file for $LANG updated."