translateAndMap = async function (batchRequest, subscriptionKey, to_lang, src_lang, linesToTranslateCopy) {
    if (batchRequest.length === 0) return;
    let data;
    data = await translateHelpers.translateText(batchRequest, subscriptionKey, to_lang, src_lang);
    data.forEach((item, idx) => {
        // find the correponding item in linesToTranslate
        let itemInLine = linesToTranslateCopy.find(item => item.idx === idx);
        if (itemInLine) {
            itemInLine.text = item.translations[0].text;
            itemInLine.idx = -1;        
        }
    });
}
Helper function to call translate and update text with localized result
@param {object []} batchRequest Array of {'Text':'value'} objects
@param {string} subscriptionKey translate text API key
@param {string} to_lang language code to translate content to
@param {string} src_lang language code for source content
@param {translateLine []} linesToTranslateCopy Array of translateLine objects
@returns {void}