I have problems getting fancyref to properly work for German together with the fontspec/polyglossia set-up.
This is the bare set-up without any language settings:
\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{fancyref}
\begin{document}
Das ist ein deutscher Text
\begin{figure}
\centering
Das soll eine Abbildung sein
\label{fig:sample}
\caption{Beispiel-Abbildung}
\end{figure}
\pagebreak
Das ist die zweite Seite mit einem Verweis auf \fref{fig:sample}.
\end{document}
The interesting thing is and will be the result of the fref which refers to the figure "on the preceding page".
In this initial stage the figure is numbered as "Figure 1" and the reference reads "figure on the preceding page".
Adding
\usepackage{polyglossia}
\setmainlanguage{german}
will change the caption to "Abbildung 1" (which is correct) and the reference to "abbildung on the preceding page". Note the lowercase "a" in "abbildung", which is not correct, although it's notable that the reference uses the German word at all.
According to the fancyref manual this should be set to German with
\usepackage{german}
\usepackage[german]{fancyref}
However, this results a) in the error message "! You haven't defined the language [ yet." and b) the text "]german" to be included at the beginning of the document.
If I remove \setmainlanguage{german} the reference reads "figure auf der vorherigen Seite".
If I remove \usepackage{german} it reads "Abbildung on the preceding page"
I am completely confused about all this. What do I need for a German document with LuaLaTeX and fontspec and German fancyref references?

germanis obsolete and should not be used in newer documents. – egreg Mar 01 '19 at 15:25fancyref's manual is from 1999. However, without it (at least with my attempts so far)fancyrefwill not use the German labels. It will translate "figure" with "Abbildung" but not "on the preceding page" (and all other reference texts). – uli_1973 Mar 01 '19 at 15:29\usepackage[german]{babel}\usepackage[german]{fancyref}works (I would prefer babel anyway), but the problem is that fancyref doesn't have declarations for ngerman, so you would have to add them. Using some newer package as egreg suggested is certainly better. – Ulrike Fischer Mar 01 '19 at 15:49babeltogether withfontspecwas obsolete? That's obviously not true? However, I'll have a look at the newer package(s), even if that means to review >150 pages of an existing document. – uli_1973 Mar 01 '19 at 15:54babeltogether withfontspecis obsolete. Several years ago (5, maybe, and probably more), there was a phase whenbabelandluatexdidn't get along. However, unless your TeX distribution is positively ancient, this should be no longer be of any concern. – Mico Mar 01 '19 at 16:07babelvs.polyglossianowadays. Usingluatexandfontspecis a prerequisite but the others not. I'm using not the latest TeXLive but that from my distro, which isLuaTeX, Version 1.0.4 (TeX Live 2017/Debian), so rather current. – uli_1973 Mar 01 '19 at 16:43polyglossiadevelopment has stalled recently (https://github.com/reutenauer/polyglossia/issues) there was a maintenance release for TeX live 2018 that included outstanding pull requests, but there has not been any real activity by the maintainer to fix other bugs or enhance features since 2016.babeldevelopment picked up speed again a while ago and even if the current maintainer has to leave it, the package is so important that it will probably have to be maintained by some emergency committee if that happens. Many packages that need localisation features work together well withbabel– moewe Mar 02 '19 at 06:15polyglossia(especially the variant detection withpolyglossiais tricky). If you stick to Western European languages (certainly German, English, French, ...)babelis IMHO certainly preferable topolyglossia. If you need complicated RTL scriptspolyglossiamight have a bit of an advantage still, butbabelis trying to bridge that gap. Unfortunately our standard answer https://tex.stackexchange.com/q/88481/35864 might be a bit behind current developments. – moewe Mar 02 '19 at 06:19babelregarding UTF-8 input that are mentioned in the "standard answer" and comments in 2012 and 2015 have become obsolete by now? I'm reviewing the infrastructure (originally put together in 2013 when I was starting with LaTeX) for a thesis and want to do things right now (to the extent this is possible ;-) ). – uli_1973 Mar 03 '19 at 08:58