src/mcpHelpers.js
async function getPreferredMcpLanguages(accessToken) {
    const mcpSettings = await getMcpSettings(accessToken);
    const twoLetterArray = mcpSettings.language || [];

    return twoLetterArray.map((twoLetter) => {
        let language = countryLanguage.getLanguages().find((a) => a.iso639_1 === twoLetter);
        return {
            lang: twoLetter,
            iso639_1: language ? language.iso639_1 : twoLetter,
            iso639_2: language ? language.iso639_2 : undefined,
            iso639_3: language ? language.iso639_3 : undefined,
        };
    });
}
async function getPreferredMcpLanguages(accessToken) {
    const mcpSettings = await getMcpSettings(accessToken);
    const twoLetterArray = mcpSettings.language || [];

    return twoLetterArray.map((twoLetter) => {
        let language = countryLanguage.getLanguages().find((a) => a.iso639_1 === twoLetter);
        return {
            lang: twoLetter,
            iso639_1: language ? language.iso639_1 : twoLetter,
            iso639_2: language ? language.iso639_2 : undefined,
            iso639_3: language ? language.iso639_3 : undefined,
        };
    });
}
async function getPreferredMcpLanguages ( accessToken ) { const mcpSettings = await getMcpSettings ( accessToken ) ; const twoLetterArray = mcpSettings . language || [ ] ; return twoLetterArray . map ( ( twoLetter ) => { let language = countryLanguage . getLanguages ( ) . find ( ( a ) => a . iso639_1 === twoLetter ) ; return { lang : twoLetter , iso639_1 : language ? language . iso639_1 : twoLetter , iso639_2 : language ? language . iso639_2 : undefined , iso639_3 : language ? language . iso639_3 : undefined , } ; } ) ; }
Get the preferred language from Customizr
@param {string} accessToken
@return {Promise<*|Uint8Array|BigInt64Array|{lang: *, iso639_1: (string), iso639_2: *, iso639_3: *}[]|Float64Array|Int8Array|Float32Array|Int32Array|Uint32Array|Uint8ClampedArray|BigUint64Array|Int16Array|Uint16Array>}
Get the preferred language from Customizr