getAvailableLanguage = (languageCode) => {
    if (!isString(languageCode))
        return null;

    if (languageCode in globalObj._state._allTranslations)
        return languageCode;

    /**
     * @type {string}
     */
    let language = languageCode.slice(0, 2);

    if (language in globalObj._state._allTranslations)
        return language;

    return null;
}
Detect the available language. The language autodetection process prioritizes finding translations
for the complete language code. If translations for the complete code are unavailable, the detection
mechanism then resorts to searching for the language-only version.
Works with 'en', 'en_US' and 'en-US'.

@param {string} languageCode - The language code to be detected.
@returns {?string} The detected language code, or null if not detected.