///////////////////////////////////////////////////////////////////////////////////////////
// Authors: Eva Bunodiere, Yasmin Kossak
// translator.cpp
// Translator Class function definitions
// JPC36 Wx-View 
// July 25th 2000
// Technical Advisor : Carlos Moreno
///////////////////////////////////////////////////////////////////////////////////////////
#include "translator.h"

#include <fstream>
#include <algorithm>
#include <cctype>
using namespace std;

#include "settings.h"


/******************************************************************************************
	Function: lower_case
	Receives: string
	Returns: string
	Description:
		Converts all the characters in a string to lower case equivalent.
*******************************************************************************************/
string lower_case (const string & s)
{
	string result = s;

	for (int i = 0; i < result.length(); i++)
	{
		result[i] = tolower(result[i]);
	}
	return result;
}

/******************************************************************************************
	Function: Translator::Translator
	Receives: N/A (constructor)
	Returns: N/A (constructor)
	Description:
		Creates	only the new translation strings in the current language.
*******************************************************************************************/
Translator::Translator()
{
    get_language();

	// Application title
	translation ("Wx-View 1.0", "english") = "Wx-View 1.0";
	translation ("Wx-View 1.0", "french") = "Wx-View 1.0";
	translation ("Wx-View 1.0", "spanish") = "Wx-View 1.0";
	
	// File Menu Labels
	translation ("&File", "english") = "&File";
	translation ("&File", "french") = "&Fichier";
	translation ("&File", "spanish") = "&Archivo";

	translation ("&Select Files", "english") = "&Select Files";
	translation ("&Select Files", "french") = "&Selectionner fichiers";
	translation ("&Select Files", "spanish") = "&Seleccionar archivos";
	
	translation ("Select Files by &Filename...\tCtrl-F", "english") = "Select Files by File&name...\tCtrl-F";
	translation ("Select Files by &Filename...\tCtrl-F", "french") = "Selectionner fichiers par &nom...\tCtrl-F";
	translation ("Select Files by &Filename...\tCtrl-F", "spanish") = "Seleccionar archivos por &nombre...\tCtrl-F";

	translation ("&Select Files by &Category...\tCtrl-C", "english") = "Select Files by &Category...\tCtrl-C";
	translation ("&Select Files by &Category...\tCtrl-C", "french") = "Selectionner fichiers par &categorie...\tCtrl-C";
	translation ("&Select Files by &Category...\tCtrl-C", "spanish") = "Seleccionar archivos por &categoria...\tCtrl-C";

	translation ("&Print   \tCtrl-P", "english") = "&Print\tCtrl-P";
	translation ("&Print   \tCtrl-P", "french") = "&Imprimer\tCtrl-P";
	translation ("&Print   \tCtrl-P", "spanish") = "&Imprimir\tCtrl-P";

    translation ("Specify Category...\tF2", "english") = "Specify &Category...\tF2";
	translation ("Specify Category...\tF2", "french") = "Specifier &categorie...\tF2";
	translation ("Specify Category...\tF2", "spanish") = "Especificar &categoria...\tF2";
	
	translation ("P&roperties...\tF2", "english") = "P&roperties...\tF2";
	translation ("P&roperties...\tF2", "french") = "&Proprietes...\tF2";
	translation ("P&roperties...\tF2", "spanish") = "&Propiedades...\tF2";

	translation ("E&xit   \tAlt-X", "english") = "E&xit\tAlt-X";
	translation ("E&xit   \tAlt-X", "french") = "&Quitter\tAlt-X";
	translation ("E&xit   \tAlt-X", "spanish") = "S&alir\tAlt-X";
	
	// View Menu Labels
	translation ("&View", "english") = "&View";
	translation ("&View", "french") = "&Apercu";
	translation ("&View", "spanish") = "&Ver";

	translation ("&Horizontal Flip   \tCtrl-H", "english") = "&Horizontal Flip\tCtrl-H";
	translation ("&Horizontal Flip   \tCtrl-H", "french") = "Reflexion &horizontale\tCtrl-H";
	translation ("&Horizontal Flip   \tCtrl-H", "spanish") = "Imagen especular &horizontal\tCtrl-H";

	translation ("&Vertical Flip   \tCtrl-V", "english") = "&Vertical Flip\tCtrl-V";
	translation ("&Vertical Flip   \tCtrl-V", "french") = "Reflexion &verticale\tCtrl-V";
	translation ("&Vertical Flip   \tCtrl-V", "spanish") = "Imagen especular &vertical\tCtrl-V";

	translation ("Zoom &In\tPgUp", "english") = "Zoom &In                   PgUp";
	translation ("Zoom &In\tPgUp", "french") = "&Agrandir                  PgUp";
	translation ("Zoom &In\tPgUp", "spanish") = "&Acercarse                  PgUp";

	translation ("Zoom &Out\tPgDn", "english") = "Zoom &Out                 PgDn";
	translation ("Zoom &Out\tPgDn", "french") = "R&eduire                 PgDn";
	translation ("Zoom &Out\tPgDn", "spanish") = "Ale&jarse                 PgDn";

	translation ("Ori&ginal Image   \tCtrl-G", "english") = "Ori&ginal Image\tCtrl-G";
	translation ("Ori&ginal Image   \tCtrl-G", "french") = "Image ori&ginale\tCtrl-G";
	translation ("Ori&ginal Image   \tCtrl-G", "spanish") = "Imagen ori&ginal\tCtrl-G";

	translation ("&Rotate...\tCtrl-O", "english") = "&Rotate Image...\tCtrl-O";
	translation ("&Rotate...\tCtrl-O", "french") = "&Rotation de l'image...\tCtrl-O";
	translation ("&Rotate...\tCtrl-O", "spanish") = "&Rotar la imagen...\tCtrl-O";

	translation ("I&ncrease Contrast   \tCtrl-R", "english") = "I&ncrease Contrast\tCtrl-R";
	translation ("I&ncrease Contrast   \tCtrl-R", "french") = "A&ugmenter contraste\tCtrl-R";
	translation ("I&ncrease Contrast   \tCtrl-R", "spanish") = "A&umentar contraste\tCtrl-R";
	
	translation ("&Decrease Contrast   \tAlt-R", "english") = "&Decrease Contrast\tAlt-R";
	translation ("&Decrease Contrast   \tAlt-R", "french") = "&Diminuer contraste\tAlt-R";
	translation ("&Decrease Contrast   \tAlt-R", "spanish") = "Re&ducir contraste\tAlt-R";
	
	translation ("In&crease Brightness   \tCtrl-B", "english") = "In&crease Brightness\tCtrl-B";
	translation ("In&crease Brightness   \tCtrl-B", "french") = "Aug&menter luminosite\tCtrl-B";
	translation ("In&crease Brightness   \tCtrl-B", "spanish") = "Au&mentar luminisodad\tCtrl-B";
	
	translation ("Decrea&se Brightness   \tAlt-B", "english") = "Decrea&se Brightness\tAlt-B";
	translation ("Decrea&se Brightness   \tAlt-B", "french") = "Dimi&nuer &luminosite\tAlt-B";
	translation ("Decrea&se Brightness   \tAlt-B", "spanish") = "Redu&cir luminosidad\tAlt-B";
	
	// Slide Show Menu Labels
	
	translation ("&Slide Show", "english") = "&Slide Show";
	translation ("&Slide Show", "french") = "&Diaporama";
	translation ("&Slide Show", "spanish") = "Show de &diapositivas";
	
	translation ("&Set Interval...\tCtrl-I", "english") = "&Set Interval...\tCtrl-I";
	translation ("&Set Interval...\tCtrl-I", "french") = "Selectionner l'&interval...\tCtrl-I";
	translation ("&Set Interval...\tCtrl-I", "spanish") = "&Intervalo...\tCtrl-I";
	
	translation ("Show &Files...\tCtrl-S", "english") = "Show &Files...\tCtrl-S";
	translation ("Show &Files...\tCtrl-S", "french") = "Montrer &fichiers...\tCtrl-S";
	translation ("Show &Files...\tCtrl-S", "spanish") = "Ver &archivos seleccionados...\tCtrl-S";
	
	translation ("&Run   \tCtrl-U", "english") = "&Run\tCtrl-U";
	translation ("&Run   \tCtrl-U", "french") = "&Commencer diaporama\tCtrl-U";
	translation ("&Run   \tCtrl-U", "spanish") = "&Comenzar show de diapositivas\tCtrl-U";

	// Options Menu Labels
	translation ("&Options", "english") = "&Options";
	translation ("&Options", "french") = "&Options";
	translation ("&Options", "spanish") = "&Opciones";
	
	translation ("&Language...", "english") = "&Language...";
	translation ("&Language...", "french") = "&Langue...";
	translation ("&Language...", "spanish") = "I&dioma...";
	
	translation ("View &Toolbar", "english") = "View &Toolbar";
	translation ("View &Toolbar", "french") = "Voir barre d'&outils";
	translation ("View &Toolbar", "spanish") = "Ver &toolbar";
	
	translation ("&Zoom Settings...\tCtrl-Z", "english") = "&Zoom Settings...\tCtrl-Z";
	translation ("&Zoom Settings...\tCtrl-Z", "french") = "&Proprietes du zoom...\tCtrl-Z"; 		
	translation ("&Zoom Settings...\tCtrl-Z", "spanish") = "&Propiedades del zoom...\tCtrl-Z";

	translation ("&Directory...", "english") = "&Directory...";
	translation ("&Directory...", "french") = "&Repertoire...";
	translation ("&Directory...", "spanish") = "&Carpeta...";

    // Help Menu Labels
	translation ("&Help", "english") = "&Help";
	translation ("&Help", "french") = "&Aide"; 		
	translation ("&Help", "spanish") = "&Ayuda";
	
	translation ("&Contents...\tF1", "english") = "&Contents...\tF1";
	translation ("&Contents...\tF1", "french") = "&Contenu...\tF1"; 		
	translation ("&Contents...\tF1", "spanish") = "&Contenido...\tF1";

	translation ("&About...", "english") = "&About...";
	translation ("&About...", "french") = "&A propos..."; 		
	translation ("&About...", "spanish") = "&Acerca de...";
	

	//Tool bar Tool Tips

	translation ("Select Files by filename", "english") = "Select Files by filename";
	translation ("Select Files by filename", "french") = "Selectionner fichiers par nom";
	translation ("Select Files by filename", "spanish") = "Seleccionar archivos por nombre";
	
	translation ("Select Files by category", "english") = "Select Files by category";
	translation ("Select Files by category", "french") = "Selectionner fichiers par categorie";
	translation ("Select Files by category", "spanish") = "Seleccionar archivos por categoria";

	translation ("Original Image", "english") = "Original Image";
	translation ("Original Image", "french") = "Image originale";
	translation ("Original Image", "spanish") = "Imagen original";

	translation ("Print", "english") = "Print";
	translation ("Print", "french") = "Imprimer";
	translation ("Print", "spanish") = "Imprimir";

	translation ("Rotate Image", "english") = "Rotate Image";
	translation ("Rotate Image", "french") = "Rotation de l'image";
	translation ("Rotate Image", "spanish") = "Rotar la imagen";

	translation ("Horizontal Flip", "english") = "Horizontal Flip";
	translation ("Horizontal Flip", "french") = "Reflexion horizontale";
	translation ("Horizontal Flip", "spanish") = "Imagen especular horizontal";

	translation ("Vertical Flip", "english") = "Vertical Flip";
	translation ("Vertical Flip", "french") = "Reflexion verticale";
	translation ("Vertical Flip", "spanish") = "Imagen especular vertical";

	translation ("Zoom In", "english") = "Zoom In";
	translation ("Zoom In", "french") = "Agrandir";
	translation ("Zoom In", "spanish") = "Acercarse";

	translation ("Zoom Out", "english") = "Zoom Out";
	translation ("Zoom Out", "french") = "Reduire";
	translation ("Zoom Out", "spanish") = "Alejarse";
	
	translation ("Increase Contrast", "english") = "Increase Contrast";
	translation ("Increase Contrast", "french") = "Augmenter contraste";
	translation ("Increase Contrast", "spanish") = "Aumentar contraste";
	
	translation ("Decrease Contrast", "english") = "Decrease Contrast";
	translation ("Decrease Contrast", "french") = "Diminuer contraste";
	translation ("Decrease Contrast", "spanish") = "Reducir contraste";
	
	translation ("Increase Brightness", "english") = "Increase Brightness";
	translation ("Increase Brightness", "french") = "Augmenter luminosite";
	translation ("Increase Brightness", "spanish") = "Aumentar luminosidad";
	
	translation ("Decrease Brightness", "english") = "Decrease Brightness";
	translation ("Decrease Brightness", "french") = "Diminuer luminosite";
	translation ("Decrease Brightness", "spanish") = "Reducir luminosidad";

	translation ("Run Slide Show", "english") = "Run Slide Show";
	translation ("Run Slide Show", "french") = "Commencer diaporama";
	translation ("Run Slide Show", "spanish") = "Comenzar show de diapositivas";

	translation ("Help", "english") = "JPC36 Wx-View Help";
	translation ("Help", "french") = "Aide pour JPC36 Wx-View";
	translation ("Help", "spanish") = "Ayuda por JPC36 Wx-View";

	translation ("Help File", "english") = "help.txt";
	translation ("Help File", "french") = "aide.txt"; 		
	translation ("Help File", "spanish") = "ayuda.txt";

	// Rodio Box choices for Zoom Settings 

	translation ("Interpolation", "english") = "Interpolation";
	translation ("Interpolation", "french") = "Interpolation          "; 		
	translation ("Interpolation", "spanish") = "Interpolacion          ";

	translation ("Stretching", "english") = "Stretching";
	translation ("Stretching", "french") = "Etirement"; 		
	translation ("Stretching", "spanish") = "Estiramiento";

	translation ("Zoom Settings", "english") = "Zoom Settings";
	translation ("Zoom Settings", "french") = "Proprietes du zoom"; 		
	translation ("Zoom Settings", "spanish") = "Propiedades del zoom";
	
	translation ("Zoom Choices", "english") = "Zoom Choices";
	translation ("Zoom Choices", "french") = "Choix de magnification"; 		
	translation ("Zoom Choices", "spanish") = "Opciones de magnificacion";
	
	translation ("Zoom Factor", "english") = "Zoom Factor";
	translation ("Zoom Factor", "french") = "Facteur de magnification";
	translation ("Zoom Factor", "spanish") = "Factor de magnificacion";

	// OK, Cancel Button Labels, etc...
	translation ("OK", "english") = "OK";
	translation ("OK", "french") = "OK";
	translation ("OK", "spanish") = "Aceptar";

	translation ("Cancel", "english") = "Cancel";
	translation ("Cancel", "french") = "Annuler";
	translation ("Cancel", "spanish") = "Cancelar";

	// Non Menu items
	
	translation ("Search", "english") = "Search";
	translation ("Search", "french") = "Recherche";
	translation ("Search", "spanish") = "Busqueda";
	
	// for Canvas.cpp
	translation ("Enter the image rotation angle", "english") = "Enter the image rotation angle";
	translation ("Enter the image rotation angle", "french") = "Entrer l'angle de rotation de l'image";
	translation ("Enter the image rotation angle", "spanish") = "Entrar angulo de rotacion";

	translation ("Angle in degrees:", "english") = "Angle in degrees:";
	translation ("Angle in degrees:", "french") = "Degres de l'angle";
	translation ("Angle in degrees:", "spanish") = "Angulo en grados";

	translation ("Rotate", "english") = "Rotate";
	translation ("Rotate", "french") = "Commencer rotation";
	translation ("Rotate", "spanish") = "Rotar";
	
	translation ("Insufficient memory - operation cancelled", "english") = "Insufficient memory - operation cancelled";
	translation ("Insufficient memory - operation cancelled", "french") = "Espace memoire insuffisant - operation annulee";
	translation ("Insufficient memory - operation cancelled", "spanish") = "Operacion cancelada por falta de memoria";
	
	translation ("Cannot remagnify rotated images", "english") = "Cannot remagnify rotated images";
	translation ("Cannot remagnify rotated images", "french") = "Ne peut magnifier suite a une rotation d'une image";
	translation ("Cannot remagnify rotated images", "spanish") = "Imposible magnificar imagen previamente rotada";
	
	translation ("Cannot shift rotated images", "english") = "Cannot shift rotated images";
	translation ("Cannot shift rotated images", "french") = "Ne peut deplacer suite a une rotation d'une image";
//	translation ("Cannot shift rotated images", "spanish") = "Imposible             imagen previamente rotada";
	
	// for opening of files or categories
	translation ("Image Preview", "english") = "Image Preview";
	translation ("Image Preview", "french") = "Echantillon de l'image";
	translation ("Image Preview", "spanish") = "Muestra";

	translation ("Filter:", "english") = "Filter:";
	translation ("Filter:", "french") = "Filtre:";
	translation ("Filter:", "spanish") = "Filtro:";
	
	translation ("File:", "english") = "File:";
	translation ("File:", "french") = "Fichier:";
	translation ("File:", "spanish") = "Archivo:";
	
	translation ("All Image Files", "english") = "All Image Files";
	translation ("All Image Files", "french") = " Tous les fichiers d'image";
	translation ("All Image Files", "spanish") = "Archivos de imagen";

    translation ("All (*.*)", "english") = "All (*.*)";
	translation ("All (*.*)", "french") = " Tous (*.*)";
	translation ("All (*.*)", "spanish") = "Todos (*.*)";

    translation ("Pixels", "english") = "Pixels";
	translation ("Pixels", "french") = " Pixels";
	translation ("Pixels", "spanish") = "Pixels";
	
    translation ("Bytes", "english") = "Bytes";
	translation ("Bytes", "french") = "Octets";
	translation ("Bytes", "spanish") = "Bytes";
	
    translation ("Image Info:", "english") = "Image Info:";
	translation ("Image Info:", "french") = "Info sur l'image:";
	translation ("Image Info:", "spanish") = "Informacion:";

// About Dialog Text
	translation ("About Text", "english") =	"Created by JPC36 Students and their instructor \nCarlos Moreno as a Technical Advisor";
	translation ("About Text", "french") =	"Cree par les etudiants de JPC36 et leur professeur \nCarlos Moreno comme consultant techinique";
	translation ("About Text", "spanish") =	"Creado por los estudiantes de JPC36 y su instructor \nCarlos Moreno como consultor tecnico";

	translation ("About Wx-View 1.0", "english") = "About Wx-View 1.0";
	translation ("About Wx-View 1.0", "french") = "A propos de Wx-View 1.0";
	translation ("About Wx-View 1.0", "spanish") = "Acerca de Wx-View 1.0";
		
	// Language choices
	translation ("English", "english") = "English";
	translation ("English", "french") = "Anglais";
	translation ("English", "spanish") = "Ingles";

	translation ("French", "english") = "French";
	translation ("French", "french") = "Francais";
	translation ("French", "spanish") = "Frances";
		
	translation ("Spanish", "english") = "Spanish";
	translation ("Spanish", "french") = "Espagnol";
	translation ("Spanish", "spanish") = "Espa~nol";
	
	translation ("Select a Language", "english") = "Select a Language";
	translation ("Select a Language", "french") = "Choisir une langue";
	translation ("Select a Language", "spanish") = "Seleccionar idioma";

	translation ("Restart_Wx-View", "english") = "Please restart Wx-View \nto implement changes";
	translation ("Restart_Wx-View", "french") = "Vous devez redemarrer Wx-View \nafin d'effectuer le changement";
	translation ("Restart_Wx-View", "spanish") = "Wx-View debe ser re-ejecutado\npara tomar en cuenta los cambios";
	
	//Set Interval Dialog
	translation ("Enter_interval", "english") = "Enter interval in seconds";
	translation ("Enter_interval", "french") = "Entrez l'interval en secondes";
	translation ("Enter_interval", "spanish") = "Indique el intervalo en segundos";

	translation ("Set Interval", "english") = "Interval";
	translation ("Set Interval", "french") = "Interval";
	translation ("Set Interval", "spanish") = "Intervalo";
	
	//For file selection by category
	translation ("Categories", "english") = "Categories";
	translation ("Categories", "french") = "Categories";
	translation ("Categories", "spanish") = "Categorias";

    translation ("Add file ", "english") = "Add file ";
	translation ("Add file ", "french") = "Ajouter fichier ";
	translation ("Add file ", "spanish") = "A~nadir archivo ";

    translation (" to category:", "english") = " to category:";
	translation (" to category:", "french") = " a la categorie:";
	translation (" to category:", "spanish") = " en categoria:";
	
    translation ("Add file to category", "english") = "Add file to category";
	translation ("Add file to category", "french") = "Ajouter fichier a la categorie";
	translation ("Add file to category", "spanish") = "A~nadir archivo en categoria";

    translation ("Add Subcategory", "english") = "Add Subcategory";
	translation ("Add Subcategory", "french") = "Ajouter une sous-categorie";
	translation ("Add Subcategory", "spanish") = "A~nadir sub-categoria";

    translation ("Modify Category", "english") = "Modify Category";
	translation ("Modify Category", "french") = "Modifier categorie";
	translation ("Modify Category", "spanish") = "Modificar categoria";

    translation ("Remove Category", "english") = "Remove Category";
	translation ("Remove Category", "french") = "Supprimer categorie";
	translation ("Remove Category", "spanish") = "Eliminar categoria";

    translation ("Enter Category Name: ", "english") = "Enter Category Name: ";
	translation ("Enter Category Name: ", "french") = "Entrer le nom de la categorie: ";
	translation ("Enter Category Name: ", "spanish") = "Nombre de la categoria: ";

    translation ("Cannot delete '", "english") = "Cannot delete '";
	translation ("Cannot delete '", "french") = "Ne peut supprimer '";
	translation ("Cannot delete '", "spanish") = "No es possible eliminar '";

    translation ("Root Category", "english") = "Root Category";
	translation ("Root Category", "french") = "Categorie de base";
	translation ("Root Category", "spanish") = "Categoria de base";

    translation ("Delete: '", "english") = "Delete: '";
	translation ("Delete: '", "french") = "Effacer: '";
	translation ("Delete: '", "spanish") = "Eliminar: '";

    translation ("Remove: '", "english") = "Remove: '";
	translation ("Remove: '", "french") = "Supprimer: '";
	translation ("Remove: '", "spanish") = "Remover: '";

    translation ("Delete Category", "english") = "Delete Category";
	translation ("Delete Category", "french") = "Effacer categorie";
	translation ("Delete Category", "spanish") = "Eliminar categoria";

    translation (" Remove Image From Category ", "english") = " Remove Image from Category ";
	translation (" Remove Image From Category ", "french") = " Supprimer l'image de cette categorie ";
	translation (" Remove Image From Category ", "spanish") = " Remover la imagen de esta categoria ";

    translation ("Cannot add files to root category", "english") = "Cannot add files to root category";
	translation ("Remove Image From Category", "french") = "Impossible d'ajouter des fichiers a la categorie de base";
	translation ("Remove Image From Category", "spanish") = "Imposible a~nadir imagenes a la categoria de base";

    translation ("Delete File", "english") = "Delete File";
	translation ("Delete File", "french") = "Effacer fichier";
	translation ("Delete File", "spanish") = "Borrar archivo";

    translation ("&Delete File", "english") = "&Delete File";
	translation ("&Delete File", "french") = "&Effacer fichier";
	translation ("&Delete File", "spanish") = "&Borrar archivo";

	// icon size settings
	translation ("Iconized images size (pixels)", "english") = "Iconized images size (pixels)";
	translation ("Iconized images size (pixels)", "french") = "Grandeur des images iconisees (pixels)";
	translation ("Iconized images size (pixels)", "spanish") = "Tama~no de las imagenes iconizadas (pixels)";
}

/******************************************************************************************
	Function: Translator::translation
	Receives: string, string
	Returns: string
	Description:
		Reads and returns the equivalent translated string, returns an empty string if
		no equivalent is found (private function).
*******************************************************************************************/
string & Translator::translation (const string & item, const string & language)
{
	static string unused;

	if (lower_case(language) == lower_case(current_language))
	{
		return translations[item];
	}
	else
	{
		return unused;
	}
}

/******************************************************************************************
	Function: Translator::operator[]
	Receives: const string
	Returns: const char *
	Description:
		Returns the translation of the string litteral contained between the square brackets.
*******************************************************************************************/
const char * Translator::operator[](const string & str) const
{
	return const_cast<map<string, string> &>(translations)[str].c_str();
}

/******************************************************************************************
	Function: Translator::return_language
	Receives: N/A
	Returns: string
	Description:
		Returns the current language.
*******************************************************************************************/
string Translator::return_language() const
{
    return current_language.c_str();
}

/******************************************************************************************
	Function: Translator::get_language
	Receives: N/A
	Returns: N/A
	Description:
		Sets the language to English by default if no language has been selected. Writes the
		current language to the configuration file for UNIX or DOS.
*******************************************************************************************/
void Translator::get_language()
{
    if (current_language == "")
    {
        string fullpath = get_fullpath();

#ifdef __linux__    	
        ifstream config_file ((fullpath + "/" + LINUX_FILENAME).c_str());
#else
        ifstream config_file ((fullpath + "/" + MSW_FILENAME).c_str());
#endif

    	if(config_file)
    	{
    		getline(config_file, current_language);
    	}
    	else
    	{
    		current_language = "english";
    	}
    }
}
