How to update .bbx file to use it in the recent version of biblatex?

I would like to use biblatex. I tried to set the language to hungarian. I've found a .bbx file, but I get strange errors if I try to use it.

The file:

\ProvidesFile{magyar.bbx}

\DeclareLanguageMapping{magyar}{magyar}
\RequireBibliographyStyle{authoryear}

\renewcommand*{\finalnamedelim}{%
%\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%

\newbibmacro{names:separator}{%
\ifthenelse{\value{listcount}<\value{liststop}}%
{}%
}

\newbibmacro*{names:andothers}{%
\ifboolexpr{%
test {\ifnumequal{\value{listcount}}{\value{liststop}}}%
and%
test \ifmorenames%
{}%
}

\def\@magyarbbx@hun{HUN}

\DeclareNameFormat{sortname}{%
\begingroup%
\edef\juniorpart{#7}%
\ifx\juniorpart\@magyarbbx@hun%
% Hungarian name
\usebibmacro{name:first-last}{#3}{#1}{#5}{\relax}%
\else%
% English name
\ifnum\value{listcount}=1\relax%
\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}%
\else%
\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
\fi%
\fi%
\endgroup%
}

%\DeclareNameFormat{sortname}{%
% \nameprint{#1}{#3}
% \usebibmacro{names:separator}%
% \usebibmacro{names:andothers}%
% }

\endinput


The error:

Illegal parameter number in definition of \blx@defformat@d


I am not an advanced latex user, and I have no idea how should I fix this issue. I was not able to find a newer version of this file on the internet

The files you are using (https://github.com/Botffy/texstuff/tree/master/tex/latex/biblatex) can be traced back to Biblatex customization: author name format defined by hyphenation (localization) (and http://r.snowl.net/harvard-style-citation-in-hungarian-language-hun/). So most of this dates back to 2011 and 2012.

There were some small and some not so small changes to biblatex in the meantime. The most problematic change here is the change to the name formatting macros in version 3.3, see Biblatex 3.3 name formatting.

Following Hungarian with LuaLaTex and biber there was some effort to get Hungarian support into the official package. The first version of Hungarian support was worked out in https://github.com/plk/biblatex/issues/717 and implemented in https://github.com/plk/biblatex/pull/780. Since version 3.12 biblatex has included Hungarian localisation files. That means that with a current biblatex version Hungarian is supported out of the box, so you probably won't need the .bbx file any more.

If you load csquotes you also need to set up a quotation style. This is also work in progress https://github.com/josephwright/csquotes/issues/19. See also quotation mark (quotation sign) xelatex + polyglossia + csquotes, you probably want (quote style as described on Wikipedia)

\DeclareQuoteStyle{magyar}
{\quotedblbase}
{\textquotedblright}
[.05em]
{\guillemotright}
{\guillemotleft}


The dev branch on https://github.com/plk/biblatex now has support for Hungarian.

• Just to note that this is not an official release yet and that you will net a dev version of Biber as well if you want to run the dev version of biblatex. I can offer no ETA on the next release version of biblatex, but I can warn you that it will very likely take some time if nothing urgent needs to be fixed. – moewe Aug 16 '18 at 7:12
• Version 3.12 with Hungarian support was released in late October 2018. – moewe Apr 28 at 8:11