#!/bin/sh
# Released under GNU GPL v2 or later
# Es un script muy sencillo para Musix 0.39, dado que quitamos el soporte
# para estos idiomas: Francés, Portugués, Catalán y Vasco


# Comprobamos si estamos en inglés
#EN="no"
#if grep -w -q "lang=en" /proc/cmdline ; then
#EN="yes"
#fi


## Preguntamos en castellano
#if [ "$EN" = "no" ] 
#then
#pos="-nearmouse"
#echo -n "Este script instalará el soporte para los idiomas 
#Francés, Portugués, Catalán o Vasco los cuales
#estaban soportados en Musix 0.30 y 0.31 dentro del Live-CD

#Instalaremos, además de la internacionalización correspondiente
#a los programas del entorno de escritorio KDE,
#soporte para firefox y diccionario GNU Aspell.

#Puedes realizar esta instalación tanto desde Musix 
#instalado en disco duro como desde el modo Live-CD

#Si deseas instalar soporte para otros idiomas que no figuran en esta lista, 
#utiliza Synaptic.

#Nota: necesitas conexión a Internet

#Por favor, elige un idioma:
 #" | gmessage -title 'Choose-Type' -geometry 600x400 -file - $pos -buttons "Frances:0,Portugues-Eu:1,Portuguese-Br:5,Catalan:2,Vasco:3,Abortar:8,Usar-Synaptic:4"

#NL="$?"

#fi

# O preguntamos en inglés
#if [ "$EN" = "yes" ] 
#then

pos="-center"
echo -n "Language support for:
French, Portuguese, Catalan or Basque. 
These 4 languages were supported out of the box into Musix 0.30 and 0.31

We will install internationalized files for KDE, manual pages,
dictionary for GNU aspell, and firefox language/region packages

If you want to install another language and it isn't listed here, 
please use Synaptic

Note: you need an Internet connection!

Please, select a language:
 " | gmessage -title 'Choose-Type' -geometry 600x340 -file - $pos -buttons "French:0,Portuguese-Eu:1,Portuguese-Br:5,Catalan:2,Basque:3,Abortar:8,Use-Synaptic:4"

NL="$?"

#fi

# Salimos, pero antes creamos flag para scripts de xinitrc-*
if [ "$NL" = "8" ]; then cat /dev/null > /tmp/get-language-ok;exit 2; fi

# Synaptic
if [ "$NL" = "4" ]; then synaptic;exit;fi

# Pasamos a la variable ILANG el idioma elegido
if [ "$NL" = "0" ]; then ILANG="fr";fi
if [ "$NL" = "1" ]; then ILANG="pt";fi
if [ "$NL" = "2" ]; then ILANG="ca";fi
if [ "$NL" = "3" ]; then ILANG="eu";fi
if [ "$NL" = "5" ]; then ILANG="ptbr";fi


if [ "$EN" = "no" ] 
then
echo "
Actualizando base de datos sobre paquetes de software disponibles..."
fi

if [ "$EN" = "yes" ] 
then
echo "
Updating the available software package's database"
fi


apt-get update

if [ "$?" = "100" ]
then
	echo "

	It was impossible to update the software package's database, please: check the Internet connection!";read; exit
fi





if [ "$ILANG" = "fr" ] 
then
apt-get install kde-i18n-fr manpages-fr aspell-fr && kpersonalizer

# creando flag que sirve para scripts de inicio como xinitrc-fr, por ejemplo
cat /dev/null > /tmp/get-language-ok

read
exit
fi

if [ "$ILANG" = "pt" ] 
then
apt-get install kde-i18n-pt manpages-pt aspell-pt-common aspell-pt && kpersonalizer
#apt-get install kde-i18n-pt manpages-pt kde-i18n-ptbr aspell-pt-br aspell-pt-common aspell-pt && kpersonalizer

# creando flag que sirve para scripts de inicio como xinitrc-fr, por ejemplo
cat /dev/null > /tmp/get-language-ok

read
exit
fi

if [ "$ILANG" = "ptbr" ] 
then
apt-get install manpages-pt kde-i18n-ptbr aspell-pt-br aspell-pt-common && kpersonalizer

# creando flag que sirve para scripts de inicio como xinitrc-fr, por ejemplo
cat /dev/null > /tmp/get-language-ok

read
exit
fi


# sin manpages, porque no existen aún 5-2-06
if [ "$ILANG" = "ca" ] 
then
apt-get install kde-i18n-ca aspell-ca mozilla-locale-ca icatalan wcatalan myspell-ca && kpersonalizer

# creando flag que sirve para scripts de inicio como xinitrc-fr, por ejemplo
cat /dev/null > /tmp/get-language-ok


read
exit
fi

if [ "$ILANG" = "eu" ] 
then
apt-get install kde-i18n-eu mozilla-locale-eu && kpersonalizer
# creando flag que sirve para scripts de inicio como xinitrc-fr, por ejemplo
cat /dev/null > /tmp/get-language-ok
read
exit
fi


