#!/usr/bin/env bash
#
# Create .ts and .qm files from sources
# Copyright (C) 2017-2025 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Contact: dreibh@simula.no

# Bash options:
set -e

PROGRAM="fractgen"
SOURCES=`find . -mindepth 1 -maxdepth 1 -name "*.cc"`
LANGUAGES="de nb"

for program in $PROGRAM ; do
   for language in $LANGUAGES ; do
      tsFile=`echo "${PROGRAM}_${language}.ts" | tr "[:upper:]" "[:lower:]"`
      qtchooser -qt=5 -run-tool=lupdate -no-obsolete ${SOURCES} -ts $tsFile
      qtchooser -qt=5 -run-tool=lrelease $tsFile
   done
done
