30 lines
537 B
Bash
Executable File
30 lines
537 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
DOMAIN="dynalab"
|
|
LOCALES_DIR="locales"
|
|
|
|
found_po=false
|
|
|
|
for po_file in "$LOCALES_DIR"/*/LC_MESSAGES/"$DOMAIN.po"; do
|
|
if [[ ! -f "$po_file" ]]; then
|
|
continue
|
|
fi
|
|
|
|
found_po=true
|
|
mo_file="${po_file%.po}.mo"
|
|
|
|
echo "Checking $po_file"
|
|
msgfmt --check "$po_file"
|
|
|
|
echo "Compiling $po_file -> $mo_file"
|
|
msgfmt "$po_file" -o "$mo_file"
|
|
done
|
|
|
|
if [[ "$found_po" == false ]]; then
|
|
echo "No .po files found in $LOCALES_DIR/*/LC_MESSAGES/$DOMAIN.po"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Compiled all locales"
|