static areLanguageCompatible(locale1, locale2) {
    const LanguageUtils = shaka.util.LanguageUtils;

    // Even through they SHOULD already be normalized, let's just be safe and
    // do it again.
    locale1 = LanguageUtils.normalize(locale1);
    locale2 = LanguageUtils.normalize(locale2);

    // Get all components. This should only be language and region
    // since we do not support dialect.
    /** @type {!Array<string>} */
    const locale1Components = LanguageUtils.disassembleLocale_(locale1);
    /** @type {!Array<string>} */
    const locale2Components = LanguageUtils.disassembleLocale_(locale2);

    // We are language compatible if we have the same language.
    return locale1Components[0] == locale2Components[0];
  }
Check if |locale1| and |locale2| are language-compatible.

Language compatible is when the language component of each locale matches.
This means that no matter what region they have (or don't have) as long as
the language components match, they are language-compatible.

Examples:
 Locale A | Locale B | Language-Compatible
 -----------------------------------------
 en-US    | en-US    | true
 en-US    | en       | true
 en-US    | en-CA    | true
 en-CA    | fr-CA    | false

@param {string} locale1
@param {string} locale2
@return {boolean}
@export