/**
   * Translate the given code into some message from the application dictionary.
   *
   * @param conn Handler for the database connection.
   * @param strCode String with the code to search.
   * @param strLanguage String with the translation language.
   * @param escape Escape \n and " characters
   * @return String with the translated message.
   */
  public static String messageBD(
      ConnectionProvider conn, String strCode, String strLanguage, boolean escape) {
    String strMessage = "";
    if (strLanguage == null || strLanguage.equals("")) strLanguage = "en_US";

    try {
      log4j.debug("Utility.messageBD - Message Code: " + strCode);
      strMessage = MessageBDData.message(conn, strLanguage, strCode);
    } catch (final Exception ignore) {
      log4j.error("Error getting message", ignore);
    }
    log4j.debug("Utility.messageBD - Message description: " + strMessage);
    if (strMessage == null || strMessage.equals("")) {
      try {
        strMessage = MessageBDData.columnname(conn, strLanguage, strCode);
      } catch (final Exception e) {
        log4j.error("Error getting message", e);
        strMessage = strCode;
      }
    }
    if (strMessage == null || strMessage.equals("")) {
      strMessage = strCode;
    }
    if (escape) {
      strMessage = Replace.replace(Replace.replace(strMessage, "\n", "\\n"), "\"", """);
    }
    return strMessage;
  }