Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save JosephMillsAtWork/c5b7f8602fa44c96ba68653c82d77665 to your computer and use it in GitHub Desktop.

Select an option

Save JosephMillsAtWork/c5b7f8602fa44c96ba68653c82d77665 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
## debug
set -x
## where does the lupdate and all the other bins live ?
QTDIR=/home/joseph/Qt/5.8/gcc_64/bin
## run over the files and make the .po files
for i in $(ls $1/translations/ |grep .po);
do newFile=$(ls $1/translations/$i |grep .po |sed "s/.po/.ts/g")
$QTDIR/lconvert -locations relative \
$1/translations/$i \
-o $newFile
done
## loop over the new ts files and use lrelease
for ii in $(ls $1/translations/ |grep .ts);
do
newerFile=$(ls $1/translations/$ii |grep .ts |sed "s/.ts/.qm/g")
touch $newerFile
$QTDIR/lrelease \
$1/translations/$ii \
$newerFile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment