-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_translations.sh
More file actions
executable file
·38 lines (32 loc) · 982 Bytes
/
update_translations.sh
File metadata and controls
executable file
·38 lines (32 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Script to update and compile translations
echo "[*] Updating translation files..."
# Extract translatable strings from source files
pylupdate6 -noobsolete \
main.py \
gui/notebook_list.py \
gui/note_list.py \
gui/editor_widget.py \
-ts i18n/en.ts i18n/it.ts
echo "[OK] Translation files updated"
echo ""
echo "[INFO] Edit translation files with Qt Linguist if needed:"
echo " linguist i18n/en.ts"
echo " linguist i18n/it.ts"
echo ""
echo "[*] Compiling translations..."
# Compile .ts files to .qm (try lrelease-qt6 first, fallback to lrelease)
if command -v lrelease-qt6 &> /dev/null; then
LRELEASE="lrelease-qt6"
elif command -v lrelease &> /dev/null; then
LRELEASE="lrelease"
else
echo "[ERROR] lrelease not found. Install qt6-qttools"
exit 1
fi
$LRELEASE i18n/en.ts -qm i18n/en.qm
$LRELEASE i18n/it.ts -qm i18n/it.qm
echo "[OK] Translation compilation completed"
echo ""
echo "Available translations:"
ls -lh i18n/*.qm