Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hyphenation warning with language variants and polyglossia #1381

Open
jspitz opened this issue Sep 10, 2024 · 1 comment
Open

hyphenation warning with language variants and polyglossia #1381

jspitz opened this issue Sep 10, 2024 · 1 comment

Comments

@jspitz
Copy link
Contributor

jspitz commented Sep 10, 2024

From reutenauer/polyglossia#663:

I have a issue with a document, using the austrian language.
Here is a minimal example file:

\documentclass{scrreprt}

\usepackage{polyglossia}
\setdefaultlanguage[variant=austrian]{german}
\usepackage[backend=biber]{biblatex}

\begin{document}
Hier steht Inhalt. Welcher jährlich mehr wird.
\end{document}

The run of lualatex gives the following warnings:

(/usr/share/texmf-dist/tex/latex/biblatex/lbx/german.lbx
Module polyglossia Warning: Language naustrian not found in language.dat.lua on
 input line 580

Package biblatex Warning: No hyphenation patterns for 'naustrian' on input line
 580.

) (/usr/share/texmf-dist/tex/latex/biblatex/lbx/german.lbx
Module polyglossia Warning: Language naustrian not found in language.dat.lua on
 input line 580

Package biblatex Warning: No hyphenation patterns for 'naustrian' on input line
 580.

)
Module polyglossia Warning: Language naustrian not found in language.dat.lua on
 input line 20

Package biblatex Warning: No hyphenation patterns for 'naustrian' on input line
 20.

)

The same file without austrian variant \setdefaultlanguage{german} gives no warnings.
Versions are LuaHBTeX 1.18.0, polyglossia 2024/03/07 v2.1, biblatex 2023/03/05 v 3.19


AFAICS this is due \DeclareHyphenationExceptions. Interestingly, replacing them with \DefineHyphenationExceptions{ngerman} does not seem to fix it.

(These exceptions themselves are disputable in the lbx files; but I think these go back to plehmann)

@jspitz
Copy link
Contributor Author

jspitz commented Nov 10, 2024

A fix for this would be to use polyglossia's own hyphenation exception macro which takes care for aliases:

diff --git a/tex/latex/biblatex/biblatex.sty b/tex/latex/biblatex/biblatex.sty
index 6495db6b..1e37447d 100644
--- a/tex/latex/biblatex/biblatex.sty
+++ b/tex/latex/biblatex/biblatex.sty
@@ -562,6 +562,9 @@
     {\ifundef\xpg@ifdefined
        {}
        {\def\blx@ifhyphenationundef#1#2#3{\xpg@ifdefined{#1}{#3}{#2}}}%
+     \ifundef\pghyphenation
+       {}
+       {\def\blx@hyphexcept#1#2{\pghyphenation{#1}{#2}}}%
      % This is required for languages which are never explicitly selected
      % \xpg@bloaded is not defined in polyglossia < v1.45
      \ifundef\xpg@bloaded

Also, duplicate \DeclareHyphenationExceptions in language variant *.ldf files can go if the files they inherit have the same exceptions (such as in the austrian case). The exceptions are already set from the inherited files.

I could take care about that once #1392 is resolved and I can make new PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant