This is a follow-up question from Solution (2) of this answer. I wanted to have a : after the algorithm number and before the algorithm caption. To do that, I added : with the solution. It (somehow) works. However, the problem is that this : appears everytime I refer to the algorithm.
See this minimal working example with the corresponding output (highlighted):
\documentclass[11pt]{book}
\usepackage{algorithm}
\makeatletter
\renewcommand\thealgorithm{\thechapter.\arabic{algorithm}:}
@addtoreset{algorithm}{chapter}
\makeatother
\begin{document}
\chapter{chapter1}
\begin{algorithm}[H]
\centering
test
\caption{algo}
\label{algo1}
\end{algorithm}
This where we refer to Algorithm \ref{algo1}.
\end{document}
So, I appreciate your help to remove this unwanted : from the place I refer to the algorithm.

\counterwithin. – Bernard Jul 19 '20 at 11:23