package main

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue

class LanguageManager {
    var currentLanguage by mutableStateOf(Language.FRENCH)
        private set

    fun changeLanguage() {
        currentLanguage = if (currentLanguage == Language.FRENCH) Language.ENGLISH else Language.FRENCH
    }

    fun getGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Glossaire"
            Language.ENGLISH -> "Glossary"
        }
    }

    fun getCodeToVerifyText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Code à Vérifier"
            Language.ENGLISH -> "Code to Verify"
        }
    }

    fun getCompareText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Comparer"
            Language.ENGLISH -> "Compare"
        }
    }

    fun getAddWordText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Ajouter un mot"
            Language.ENGLISH -> "Add a word"
        }
    }

    fun getImportText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Importer un fichier"
            Language.ENGLISH -> "Import a file"
        }
    }

    fun getExportText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Exporter un fichier"
            Language.ENGLISH -> "Export a file"
        }
    }

    fun getSeeGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Voir le glossaire"
            Language.ENGLISH -> "See glossary"
        }
    }

    fun getGlossaryTitle(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Glossaire"
            Language.ENGLISH -> "Glossary"
        }
    }

    fun getLanguageChoiceTitle(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Choix du langage"
            Language.ENGLISH -> "Language choice"
        }
    }

    fun getBackButtonText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Retour"
            Language.ENGLISH -> "Back"
        }
    }

    fun getSelectProjectText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Sélectionnez un projet"
            Language.ENGLISH -> "Select a project"
        }
    }

    fun getNoProjectText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Aucun projet n'a été créé"
            Language.ENGLISH -> "There is no project"
        }
    }

    fun getNewProjectText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Créer un nouveau projet"
            Language.ENGLISH -> "Create a new project"
        }

    }

    fun getBackText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Retour"
            Language.ENGLISH -> "Back"
        }
    }

    fun getMenuText(): String {
        return "Menu"
    }

    fun getNameProjectText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Nom du projet"
            Language.ENGLISH -> "Project name"
        }

    }

    fun getEnterProjectNameText(): Any {
        return when (currentLanguage) {
            Language.FRENCH -> "Veuillez saisir un nom pour le projet"
            Language.ENGLISH -> "Please enter a name for the project"
        }

    }

    fun getNoSpaceInProjectNameText(): Any {
        return when (currentLanguage) {
            Language.FRENCH -> "Le nom du projet ne doit pas contenir d'espace"
            Language.ENGLISH -> "The project name cannot contain spaces"
        }

    }

    fun getGlossaryAlreadyExistsText(): Any {
        return when (currentLanguage) {
            Language.FRENCH -> "Le nom du projet existe déjà"
            Language.ENGLISH -> "The project name already exists"
        }

    }

    fun getInvalidCharacterText(): Any {
        return when (currentLanguage) {
            Language.FRENCH -> "Le nom du projet ne doit pas contenir les caractères suivants : / \\ : * ? \" < > |"
            Language.ENGLISH -> "The project name cannot contain the following characters: / \\ : * ? \" < > |"
        }

    }

    fun getCreateProjectText(): Any {
        return when (currentLanguage) {
            Language.FRENCH -> "Créer"
            Language.ENGLISH -> "Create"
        }

    }

    fun getNameGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Nom du glossaire"
            Language.ENGLISH -> "Glossary name"
        }

    }

    fun getNoGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Aucun glossaire n'a été créé"
            Language.ENGLISH -> "There is no glossary"
        }
    }

    fun getSelectGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Sélectionnez un glossaire"
            Language.ENGLISH -> "Select a glossary"
        }
    }

    fun getCreateGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Créer un nouveau glossaire"
            Language.ENGLISH -> "Create a new glossary"
        }

    }

    fun getAcceuil(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Accueil"
            Language.ENGLISH -> "Home"
        }

    }

    fun getNewGlossaryText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "Créer un nouveau glossaire"
            Language.ENGLISH -> "Create a new glossary"
        }

    }

    fun getOuText(): String {
        return when (currentLanguage) {
            Language.FRENCH -> "ou"
            Language.ENGLISH -> "or"
        }

    }
}
