#!/bin/bash

# This script checks and run the flash-player-properties 
# if it is installed
# Created by Paweł "pavroo' Pijanowski 2015/07/16
# Copyright 2015-2018 under the GNU GPL2 License
# Last update 2018/08/05

# get default's locale file
DEFLOCDIR="/usr/share/pearl/pearl-center-lxde"
if [ "`cat /etc/default/locale | grep es`" != "" ]; then
. $DEFLOCDIR/es
elif [ "`cat /etc/default/locale | grep fr`" != "" ]; then
. $DEFLOCDIR/fr
elif [ "`cat /etc/default/locale | grep id_ID`" != "" ]; then
. $DEFLOCDIR/id_ID
elif [ "`cat /etc/default/locale | grep it`" != "" ]; then
. $DEFLOCDIR/it
elif [ "`cat /etc/default/locale | grep ja`" != "" ]; then
. $DEFLOCDIR/ja
elif [ "`cat /etc/default/locale | grep pl`" != "" ]; then
. $DEFLOCDIR/pl
elif [ "`cat /etc/default/locale | grep pt`" != "" ]; then
. $DEFLOCDIR/pt_BR
elif [ "`cat /etc/default/locale | grep pt_PT`" != "" ]; then
. $DEFLOCDIR/pt_PT
elif [ "`cat /etc/default/locale | grep ru`" != "" ]; then
. $DEFLOCDIR/ru
else
. $DEFLOCDIR/en
fi

DIALOG="yad --window-icon=flash-player-properties --width=450 --height=200 --center"
TITLE="--always-print-result --dialog-sep --image=flash-player-properties --title="
TITLETEXT="$LOCAL17"
MSGBOX=" --button=Ok:0 "
TEXT="--text="

if [ -f /usr/share/applications/flash-player-properties.desktop ]; then
	flash-player-properties
	exit 0
else
	$DIALOG $TITLE"$TITLETEXT" $MSGBOX $TEXT"$LOCAL18"
	exit 0
fi

exit 0
