xles / hyphenator

Automatically exported from code.google.com/p/hyphenator
GNU General Public License v3.0
0 stars 0 forks source link

Multi language document? #190

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Can You please suggest a way to have a hyphenation in a multi-language document?

For example I'm interesed in russian-english documents.

Original issue reported on code.google.com by kheyfbo...@gmail.com on 3 Aug 2013 at 9:41

GoogleCodeExporter commented 9 years ago
Just set the lang attributes in your HTML.

See 
http://hyphenator.googlecode.com/svn/tags/Version%204.2.0/testsuite/test35.html 
as an example.
Child elements inherit the language from their parent element if it is not 
overwritten by a new lang attribute.

Original comment by mathiasn...@gmail.com on 12 Aug 2013 at 6:21

GoogleCodeExporter commented 9 years ago
Needs documentation

Original comment by mathiasn...@gmail.com on 12 Aug 2013 at 6:22

GoogleCodeExporter commented 9 years ago
I'd rather set

    <body lang="ru" lang="en-us" ...

or

    <body lang="ru en-us" ...

then setting lang for each paragraph. Can this be achieved?

Original comment by kheyfbo...@gmail.com on 30 Dec 2013 at 9:04

GoogleCodeExporter commented 9 years ago
No!

Each element can only have one lang-attribute and the value of this attribute 
"must be a valid BCP 47 language tag" or an empty string 
(http://www.w3.org/TR/html5/dom.html#attr-lang).
Semantically it makes no sense to give an element more than one language.

So if for example your page has to columns, one in english and the other in 
russian, you'll have to define two divs one with lang="en" and the other with 
lang="ru".
Or you have a text in russian with english words in it: just surround the 
english words with <span lang="en"> (or the other way round).

Original comment by mathiasn...@gmail.com on 8 Jan 2014 at 1:29

GoogleCodeExporter commented 9 years ago

Original comment by mathiasn...@gmail.com on 14 Mar 2014 at 7:32