For my custom class I use the cleveref package and define new custom reference styles:
crefformat{figure}{Meine tolle Abbildung ~#2#1#3}
Is there a way to make this command consider the language chosen with babel? Like:
crefformat[ngerman]{figure}{meine tolle Abbildung ~#2#1#3}
crefformat[english]{figure}{my fancy figure ~#2#1#3}
So I get the correct output for what I’ve chosen loading babel:
usepackage[english]{babel}
The manual states, that it is no problem with something like:
crefformat{equation}{#2cref@equation@name~(#1)#3}
But I can’t see how to apply that to my case.
Edit:
I found a cumbersome solution by myself, but I’d prefer one which wouldn’t require to load all languages with babel (though I don’t know if it’s necessarily a bad thing, I’d just guess its overkill).
MWE:
documentclass{article}
usepackage[demo]{graphicx}
usepackage[english]{babel}
usepackage{hyperref}
usepackage{cleveref}
crefformat{figure}{Abb.~#2#1#3}
begin{document}
cref{fig:one}
begin{figure}[h]
includegraphics[width=textwidth]{example-image-a}
caption{I am a figurelabel{fig:one}}
end{figure}
end{document}