Translations inherit parent-language hyphenation dictionary
Closed this issue · 1 comments
At the moment, if a translation uses its parent language's stylesheet (which is always preferable), it inherits that parent language's hyphenation settings. If the parent language specifies a custom hyphenation dictionary, this is a problem. For instance, a French translation would inherit a custom hyphenation dictionary for English.
The workaround is to override the hyphenation dictionary in custom CSS:
:lang(fr) {
p, ul, ol, dl {
prince-hyphenate-patterns: url("hyph-fr.pat");
}
}
In the above snippet, we've overridden any custom dictionary defined in the sass partials.
(You can find the dictionary itself by following PrinceXML guidance, and downloading the pattern file from tug.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/txt/. Save the pattern file in styles
alongside your book's print-pdf.scss
etc.)
We shouldn't have to do an workaround for every translation. It would be better to be able to specify a variable or setting, or even have language selection done automatically based on the page language somehow.
Resolved in #298