static getLocaleForVariant(variant) {
    const LanguageUtils = shaka.util.LanguageUtils;

    // Our preference order is:
    //  1. Variant
    //  2. Audio Stream
    //  3. Video Stream
    //
    // We are going to consider all falsy strings to be invalid locales, this
    // will include empty strings.
    if (variant.language) {
      return LanguageUtils.normalize(variant.language);
    }

    if (variant.audio && variant.audio.language) {
      return LanguageUtils.normalize(variant.audio.language);
    }

    if (variant.video && variant.video.language) {
      return LanguageUtils.normalize(variant.video.language);
    }

    // No language was found, but we still want to return a valid string.
    return 'und';
  }
Get the normalized locale for the given variant. This will look through
the variant to find the locale that represents the content in the variant.
This will return 'und' if no language can be found.

This should always be used to get the locale from a variant.

@param {shaka.extern.Variant} variant
@return {string}
@export