Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It seems that lualatex does not known the Brazilian dialect of the Portuguese language with the babel package.

When compiling the simple document:

\documentclass{article}
\usepackage[brazil]{babel}

\begin{document}

Documento de teste.

\end{document}

lualatex gives the following error message:

! LuaTeX error ...re/texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua:50: luat
ex-hyphen: no entry in language.dat.lua for this language: brazil
stack traceback:
    [C]: in function 'error'
    ...re/texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua:22: in function 'err'
    ...re/texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua:50: in function 'loadl
anguage'
    <\directlua >:1: in main chunk.
\bbl@patterns ...pestring {#1}", \the \language )}
                                                  \fi \fi \fi 
l.165 \ldf@finish\CurrentOption

Is this a known bug? Is there any fix for it?

share|improve this question
2  
Interesting. I made an attempt with \usepackage[portuges,brazilian]{babel} and \selectlanguage{brazilian}, and the error is gone. Just don't ask me why, it was purely trial and error. :) I'm also intrigued with this question. –  Paulo Cereda Mar 11 '12 at 13:43
3  
This does seem to be a bug; there should be a synonym set for brazil in the hyphenation pattern database (since there is only on Portuguese hyphenation file). The reason Paulo's solution works is that loading portuges is sufficient to load the hyphenation patterns; loading babel with brazil as the last language sets it as the main language (so no \selectlanguage is needed.) –  Alan Munn Mar 11 '12 at 14:20
1  
The same bug will affect Austrian users, since there's no synonim set for german and ngerman, while babel allows the options austrian and naustrian. –  egreg Mar 11 '12 at 16:49

2 Answers 2

Khaled Honsy wrote a patch and I submitted a new version of hyph-utf8 to CTAN, so it should end up in TeX Live pretty soon.

If anyone wants to test, try replacing texmf-dist/tex/luatex/hyph-utf8/hyphen.cfg and texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua in your distribution and running

sudo fmtutil-sys --byfmt lualatex

or simply fmtutil --byfmt lualatex. In MikTeX you can rebuild formats somewhere in GUI.

The only language synonyms influenced by the change are currently:

canadian               => english   
australian, newzealand => british   
austrian               => german    
naustrian              => ngerman   
brazilian, brazil      => portuguese

Claudio Beccari found out that many synonyms fail to work in Polyglossia as well. We might change the way synonyms are treated in future, but this should hopefully get the problem fixed for now.

share|improve this answer

A quick workaround is to locate language.dat.lua on your computer (watch out, there might be two of them, you need the one in TEXMFVAR if you are using TeX Live; mine is at /usr/local/texlive/2011/texmf-var/tex/generic/config/language.dat.lua) and change the synonyms for portuguese to

synonyms = { 'portuges', 'brazil', 'brazilian' },

For a proper fix I'll talk to the author of luatex-specific code for loading hyphenation patterns (Manuel). If he or somebody else can provide a fix quickly, we'll apply it, else I will do a temporary workaround in TeX Live and add the two extra synonyms to hyphen-portuguese.tlpsrc. How serious is the issue with Austrian - do people actually use \usepackage[austrian]{babel}?

share|improve this answer
2  
I guess so: there are notable differences between the austrian and german options. –  egreg Mar 11 '12 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.