Closed splitbrain closed 1 year ago
First reaction, DokuPDF is initialized with $ID of the page at that time. This works for single pages exported with dw2pdf plugin I guess, but for the Bookcreator I expect it uses the language of the page we're the book manager is. Also exporting namespaces is probably not yet covered? (not checked)
You're right, bookcreator and namespace exports are not covered here. However they weren't covered before either - $conf['lang']
was simply always used.
I'm not sure how to cover them at all since theoretically at least for bookcreator each page could have a different language...
@Klap-in any objections to merging this?
Sorry, bit busy, so not yet time for details.
Is it doable to use, for example, the language of the first page added to the selection of a book, or the first page of an exported namespace? If I see it right, this DokuPdf
is initiated in generatePDF()
where you have already $this->list
available.
The language of the bookmanager page is quite useless. The replacement function has that issue as well if i remember it right. If this works, we might consider this approach there as well.
Okay, I moved document language detection out of the DokuPDF class. I'm not super happy about the whole state of the action.php
- too much going on all over the place (eg. it's not immeadiately apparant where $this->list
even comes from). But that's definitely out of scope for this little fix.
@Klap-in is this good to merge or are there any further objections?
This uses the globally defined language or the language reported by the translation plugin.
As suggested here: https://forum.dokuwiki.org/d/20915-dw2pdf-with-language-dependent-hyphenation