loadTranslationData = async (desiredLanguageCode) => {
    const state = globalObj._state;

    /**
     * @type {string}
     */
    let currentLanguageCode = getAvailableLanguage(desiredLanguageCode)
        ? desiredLanguageCode
        : getCurrentLanguageCode();

    let translationData = state._allTranslations[currentLanguageCode];

    /**
     * Fetch translation if a string or function is provided
     */
    if (isString(translationData)) {
        translationData = await fetchJson(translationData);
    } else if (isFunction(translationData)) {
        translationData = await translationData();
    }

    if (!translationData) {
        throw `Could not load translation for the '${currentLanguageCode}' language`;
    }

    state._currentTranslation = translationData;
    setCurrentLanguageCode(currentLanguageCode);

    debug('CookieConsent [LANG]: set language: "' + currentLanguageCode + '"');

    return true;
}
Load translation
@param {string | null} [desiredLanguageCode]