code: public String getLanguage (String text) {
      String language = null;
      TextObject textObject = textObjectFactory.forText(text);
      com.google.common.base.Optional<LdLocale> lang = languageDetector.detect(textObject);
      
      if (lang.isPresent()) {
        language = lang.get().toString();
      }
      
      return language;
    }
docs: Get language from string
  
  @param text Detect language from this String
  @return String Detected language