Forum How do I...?

Auto-hyphenation doesn't work with Russian source if xml:lang="ru" is missing from source file

SamD
Please take a look at attached file.
Tag <html> with xml:lang="ru-RU" is commented out.
text-align: justify; and hyphens: auto; are present in test.css.
Processing this file with Prince does not produce any hyphenation.
If tag with xml:lang is uncommented then hyphenation works.
My question is:
How to make Prince understand that text is in Russian using css file even if xml:lang is missing from source?
Please advise how and where (if applicable) to place lang(ru) selector into attached test.css.
  1. Gogol_MertvyeDushy-8.html7.7 kB
  2. test.css1.4 kB
mikeday
The :lang selector will only apply if there is a lang or xml:lang attribute on the document. However, you can always force a particular hyphenation dictionary to be used, like this:
body { prince-hyphenate-patterns: url("/usr/lib/prince/hyph/hyph-ru.pat") }

You may need to change the URL if Prince is installed in a different location.
SamD
Thank you, this works perfectly well.