Upload files to "utils"
This commit is contained in:
24
utils/update-translations.sh
Normal file
24
utils/update-translations.sh
Normal 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!"
|
||||
Reference in New Issue
Block a user