package de.assecutor.votianlt.model;

public enum Language {
    DE("Deutsch"),
    EN("English"),
    FR("Français"),
    ES("Español"),
    TR("Türkçe"),
    PL("Polski"),
    RU("Русский"),
    EE("Eesti"),
    LV("Latviešu"),
    LT("Lietuvių");

    private final String displayName;

    Language(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayName() {
        return displayName;
    }

    public static Language fromString(String text) {
        for (Language language : Language.values()) {
            if (language.name().equalsIgnoreCase(text)) {
                return language;
            }
        }
        return DE; // Default to German
    }
}