docs: def __get_language_match(self, languageCode, languageIds):
          """Compares ``languageCode`` to the provided ``languageIds`` to find
          the closest match and returns it, if a match is not found returns
          ``None``.
  
          e.g. if ``languageCode`` is ``en_CA`` and ``languageIds`` contains
          ``en``, the return value will be ``en``
          """
          # special case
          if languageCode == 'zh':
              return 'zh-Hans'
  
          # this will take care of cases such as mapping en_CA to en
          if '-' in languageCode:
              match = negotiate_locale([languageCode], languageIds, sep='-')
          else:
              match = negotiate_locale([languageCode], languageIds)
  
          if match:
              return match
  
          # handle other cases
          if '-' in languageCode:
              locale = Locale.parse(languageCode, sep='-')
          else:
              locale = Locale.parse(languageCode)
  
          for languageId in languageIds:
              if '-' not in languageId:
                  continue
  
              # normalize the languageId
              nLanguageId = Locale.parse(languageId, sep='-')
  
              # 1. lang subtag must match
              # 2. either script or territory subtag must match AND
              #    one of them must not be None, i.e. do not allow None == None
              if locale.language == nLanguageId.language and \
                  (((locale.script or nLanguageId.script) and
                   (locale.script == nLanguageId.script)) or \
                   (locale.territory or nLanguageId.territory) and
                   (locale.territory == nLanguageId.territory)):
                      return languageId
  
          return None