File indexing completed on 2024-04-28 16:29:37

0001 #!/bin/bash
0002 #
0003 # SPDX-FileCopyrightText: 2018 Thomas Baumgart <tbaumgart@kde.org>
0004 #
0005 # SPDX-License-Identifier: GPL-2.0-or-later
0006 #
0007 
0008 # the subdirectories containing the files
0009 PNG_DIR=../kmymoney/pics/l10n
0010 SVG_DIR=../kmymoney/pics/svg
0011 
0012 # check for inkscape being available
0013 export LANG=C
0014 INKSCAPE=`which inkscape 2>/dev/null`
0015 if [ -z "$INKSCAPE" ]; then
0016   echo "inkscape is not found in search path."
0017   exit 1
0018 fi
0019 
0020 # make sure we are started in the right directory
0021 if [ -e "conv_splash.sh" -a -d "$PNG_DIR" -a -d "$SVG_DIR" ]; then
0022   FILES=`find $PNG_DIR -name startlogo.png`
0023   for DST_FILE in $FILES; do
0024     DST_DIR=`dirname $DST_FILE`
0025     LANG=`basename $DST_DIR`
0026     SRC_FILE=$SVG_DIR/startlogo_$LANG.svg
0027     if [ -e $SRC_FILE ]; then
0028       echo Converting $SRC_FILE to $DST_FILE
0029       $INKSCAPE -a 32:740:432:1040 -e "$DST_FILE" "$SRC_FILE" 2>/dev/null
0030     fi
0031   done
0032 else
0033   echo "`basename $0` converts the svg splash screens into png"
0034   echo
0035   echo "Please make sure to start `basename $0` in the tools subdir of the"
0036   echo "KMyMoney source tree and that the relative directories"
0037   echo "'../kmymoney/pics/l10n' and '../kmymoney/pics/svg' exist"
0038   echo
0039   echo "Only existing pngs are converted. An empty file is enought to start with."
0040   exit 1
0041 fi