package eu.gaudian.translator.model.communication

import android.content.Context
import eu.gaudian.translator.R

enum class ModelType(private val stringResId: Int) {
    TRANSLATION(R.string.label_translation),
    EXERCISE(R.string.label_exercise),
    VOCABULARY(R.string.label_vocabulary),
    DICTIONARY(R.string.label_dictionary);

    /**
     * Returns the localized name of the model type.
     *
     * This function should be used instead of the default `name` property
     * when displaying the model type to the user, as it provides a
     * localized string.
     *
     * @param context The context to use for string localization.
     * @return The localized name of the model type.
     */
    fun getLocalizedName(context: Context): String =
        context.getString(stringResId)
}