code: public String getLanguageComponent(String language) {
          if (StringUtils.isNullOrEmpty(language)) {
              return "";
          }
  
          if (language.contains("-")) {
              return language.split("-")[0];
          } else if (language.contains("_")) {
              return language.split("_")[0];
          }
  
          return language;
      }
docs: Returns the language component of a language string.
  
  @param language
  @return the language component