Administration > Language Support > Supporting Multiple Hyphenation Schemes in One Document
Supporting Multiple Hyphenation Schemes in One Document
To support more than one language hyphenation pattern within a document type, define the individual Hyphenation Rules. Then set up a test value as an attribute, and apply it to the text as needed.
Apply the hyphenation to an element-in-context that is appropriate for your needs. In the example below, parallel chapters are set up, one containing Czech, the other French.
Your documents may require that hyphenation be set at a section or paragraph level.
To define hyphenation schemes using attributes:
1. If you are responsible for developing or maintaining the DTD to be used for this document type, add an attribute for the chapter element to the DTD, name the attribute (for example, “lang”) and include a list of all the languages whose hyphenation scheme will be needed.
<!ATTLIST chapter lang (czech | french) |"czech" >
The language in quotation marks at the end of the line is the default hyphenation scheme.
If you are implementing an existing DTD in a FOSI, examine the DTD to determine what attributes can be used to control hyphenation.
2. Open the All Hyphenation Rules panel by choosing FormatEdit FOSI Components All Hyphenation Rules. Define a Hyphenation Rule for each language to be used.
If no hyphenation scheme is enabled in the Document Default, any document created using your FOSI will be hyphenated according to English (US) conventions.
3. Open the Style panel for the element to which the test attribute will be applied. Add a conditional Attribute Rule by following these steps:
Position the cursor on the attribute rules line, click the right mouse button, and choose Add Attribute Rule.
Position your cursor on the Attribute Rule, click the right mouse button and choose Add Test Value. Enter the name of the test attribute in the attribute name space, and add the name of the language as it is defined in Hyphenation Rule.
Double-click on Attribute Rule to open a Style panel. Define hyphenation as you would in any element-in-context.
4. Inside the initial tag for each chapter, press CTRL+D to open the Modify Attributes dialog box. Enter the name of the hyphenation scheme to be used in the individual chapter exactly as it appears in the All Hyphenation Rules panel.
Even if there is a default hyphenation scheme defined for your document type, it may be good practice to always identify the hyphenation scheme in use through the attribute, as this will simplify document maintenance.
The only limit to the number of default hyphenation schemes that can be used in this manner is the number of default schemes available.