@file:Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE", "HardCodedStringLiteral")

package eu.gaudian.translator.utils

import android.content.Context
import androidx.annotation.Keep
import eu.gaudian.translator.R

//Just a dummy so they appear as used in the XML file and I don't get a few dozens errors
@Keep
val LANGUAGE_STRING_IDS: IntArray = intArrayOf(
    R.string.language_1,
    R.string.language_2,
    R.string.language_3,
    R.string.language_4,
    R.string.language_5,
    R.string.language_6,
    R.string.language_7,
    R.string.language_8,
    R.string.language_9,
    R.string.language_10,
    R.string.language_11,
    R.string.language_12,
    R.string.language_13,
    R.string.language_14,
    R.string.language_15,
    R.string.language_16,
    R.string.language_17,
    R.string.language_18,
    R.string.language_19,
    R.string.language_20,
    R.string.language_21,
    R.string.language_22,
    R.string.language_23,
    R.string.language_24,
    R.string.language_25,
    R.string.language_26,
    R.string.language_27,
    R.string.language_28,
    R.string.language_29,
    R.string.language_30,
    R.string.language_31,
    R.string.language_32,
    R.string.language_33,
    R.string.language_34,
    R.string.language_35,
    R.string.language_36,
    R.string.language_37,
    R.string.language_38,
    R.string.language_39,
    R.string.language_40,
    R.string.language_41,
    R.string.language_42,
    R.string.language_43,
    R.string.language_44,
    R.string.language_45,
    R.string.language_46,
    R.string.language_47,
    R.string.language_48,
    R.string.language_49,
    R.string.language_50,
    R.string.language_51,
    R.string.language_52,

    R.string.native_language_1,
    R.string.native_language_2,
    R.string.native_language_3,
    R.string.native_language_4,
    R.string.native_language_5,
    R.string.native_language_6,
    R.string.native_language_7,
    R.string.native_language_8,
    R.string.native_language_9,
    R.string.native_language_10,
    R.string.native_language_11,
    R.string.native_language_12,
    R.string.native_language_13,
    R.string.native_language_14,
    R.string.native_language_15,
    R.string.native_language_16,
    R.string.native_language_17,
    R.string.native_language_18,
    R.string.native_language_19,
    R.string.native_language_20,
    R.string.native_language_21,
    R.string.native_language_22,
    R.string.native_language_23,
    R.string.native_language_24,
    R.string.native_language_25,
    R.string.native_language_26,
    R.string.native_language_27,
    R.string.native_language_28,
    R.string.native_language_29,
    R.string.native_language_30,
    R.string.native_language_31,
    R.string.native_language_32,
    R.string.native_language_33,
    R.string.native_language_34,
    R.string.native_language_35,
    R.string.native_language_36,
    R.string.native_language_37,
    R.string.native_language_38,
    R.string.native_language_39,
    R.string.native_language_40,
    R.string.native_language_41,
    R.string.native_language_42,
    R.string.native_language_43,
    R.string.native_language_44,
    R.string.native_language_45,
    R.string.native_language_46,
    R.string.native_language_47,
    R.string.native_language_48,
    R.string.native_language_49,
    R.string.native_language_50,
    R.string.native_language_51,
    R.string.native_language_52,



)

fun useLanguageResources(context: Context?) {
    val codesId = R.array.language_codes
    val localContext = context ?: return

    val res = localContext.resources
    val codes: Array<String> = res.getStringArray(codesId)
    val text = buildString {
        for (id in LANGUAGE_STRING_IDS) {
            append(res.getString(id)).append('\n')
        }
        if (codes.isNotEmpty()) append(codes[0])
    }
}