Upload files to "utils"

This commit is contained in:
2025-09-14 17:45:45 +02:00
parent 06de78d309
commit 1d7752fb66

View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Update translations for ThunderPing
# Paths
SRC_DIR="../src"
LOCALE_DIR="../locale"
POT_FILE="../translations/thunderping.pot"
# 1. Extract strings from Python code
xgettext --language=Python --keyword=_ --output="$POT_FILE" $SRC_DIR/*.py
# 2. Update .po files with new strings
for lang_dir in "$LOCALE_DIR"/*; do
LANG=$(basename "$lang_dir")
PO_FILE="$lang_dir/LC_MESSAGES/thunderping.po"
MO_FILE="$lang_dir/LC_MESSAGES/thunderping.mo"
if [ -f "$PO_FILE" ]; then
msgmerge --update "$PO_FILE" "$POT_FILE"
msgfmt "$PO_FILE" -o "$MO_FILE"
echo "Updated and compiled: $PO_FILE -> $MO_FILE"
fi
done
echo "ThunderPing translations updated!"