batchTranslateText = async function(linesToTranslate, subscriptionKey, to_lang, src_lang, log) {
    // responsible for breaking localizable text into chunks that are 
    // - not more than 5000 characters in combined length 
    // - not more than 25 segments in one chunk
    let retValue = '';
    if (!Array.isArray(linesToTranslate) || linesToTranslate.length === 0) return retValue;
    let charCountInChunk = 0;
    let batchTranslate = [];
    for (var idx in linesToTranslate) {
        let item = linesToTranslate[idx];
        if (item.text.length + charCountInChunk >= MAX_CHAR_IN_REQUEST) {
            await translateAndMap(batchTranslate, subscriptionKey, to_lang, src_lang, linesToTranslate);
            batchTranslate = [];
            charCountInChunk = 0;
        }
        let currentBatchSize = batchTranslate.length > 0 ? batchTranslate.length : 1;
        if (currentBatchSize % MAX_TRANSLATE_BATCH_SIZE === 0) {
            await translateAndMap(batchTranslate, subscriptionKey, to_lang, src_lang, linesToTranslate);
            batchTranslate = [];
            charCountInChunk = 0;
        }
        if (item.localize) {
            item.idx = batchTranslate.length; 
            batchTranslate.push({'Text': item.text});
            charCountInChunk += item.text.length;
        }
    }
    if (batchTranslate.length !== 0) {
        await translateAndMap(batchTranslate, subscriptionKey, to_lang, src_lang, linesToTranslate);
        batchTranslate = [];
        charCountInChunk = 0;
    }
    linesToTranslate.forEach(item => retValue += item.text);
    if(log) process.stdout.write(chalk.default.gray(retValue));
    return retValue;
}
Helper function to batch calls to translate API
@param {translateLine []} linesToTranslate Array of translateLine 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 {boolean} log indicates if this function should write verbose messages to process.stdout
@returns {string} translated content
@throws {exception} Throws on errors. exception object includes errCode and text.