I am trying to capture punctuation marks and I have a number of macros, two of which are shown in the minimal below:
\documentclass{article}
\usepackage[english]{babel}
\def\isColon#1{%
\ifx:#1
colon!
\else
Not a colon!
\fi}
\def\isPeriod#1{%
\ifx.#1
Period!
\else
Not a period!
\fi}
\begin{document}
\isColon:
\isPeriod.
\end{document}
If the babel language is changed to [french,english] the colon is not captured, as babel makes it active. What modifications are required to the isColon macro to work in both cases?