\documentclass{article}
%\usepackage[nil]{babel}
\usepackage{babel}
\babelprovide[import=fr]{french}
\babelprovide[import=de,main]{german}
\usepackage{glossaries-extra}

\begin{document}

\ForEachTrackedDialect\mylang{\show\mylang}
\languagename
\end{document}