docs: public static String extract(String s, String language) {
          if (s == null || s.trim().isEmpty()) {
              return null;
          }
  
          String[] langNames = s.split("\r");
          if (language == null || language.trim().isEmpty()) {
              return langNames[0];
          }
  
          String fallback = null;
          for (int i = 1; i < langNames.length; i++) {
              String[] langName = langNames[i].split("\b");
              if (langName.length != 2) {
                  continue;
              }
  
              // Perfect match
              if (langName[0].equalsIgnoreCase(language)) {
                  return langName[1];
              }
  
              // Fall back to base, e.g. zh-min-lan -> zh
              if (fallback == null && !langName[0].contains("-") && (language.contains("-") || language.contains("_"))
                      && language.toLowerCase(Locale.ENGLISH).startsWith(langName[0].toLowerCase(Locale.ENGLISH))) {
                  fallback = langName[1];
              }
          }
          return (fallback != null) ? fallback : langNames[0];
      }