docs: public static Locale getLocaleForText(String text) {
  
          // try to detect locale by language detector
          if (isNotEmptyOrWhitespaceOnly(text)) {
              try {
                  Detector detector = DetectorFactory.create();
                  detector.append(text);
                  String lang = detector.detect();
                  Locale loc = new Locale(lang);
                  if (OpenCms.getLocaleManager().getAvailableLocales().contains(loc)) {
                      return loc;
                  }
              } catch (LangDetectException e) {
                  LOG.debug(e);
              }
          }
          return null;
      }