Glossary Item Box

TechWriter 2009 for Websites Send comments on this topic.

Creating a Custom Language File

The Language File option under the Output Tab can be used to override values used for output headings and text in order to support languages other than English or to produce highly customized output.  This tutorial provides step-by-step instructions for creating your own custom language file — an advanced feature that is targeted towards technically-savvy users.

Generating Annotated Output

Sample language files that you can use to create your own custom file can be found in Samples\Language Files folder of your TechWriter installation (typically C:\Program Files\Adivo TechWriter 2009\Samples\Language Files).  The samples will include the following language files:

DefaultWebsiteAnnotated.xml

DefaultWebsiteText.xml

It is recommended that you generate a sample output of your document using the annotated language file.  The annotated version of the language file contains alternative text values that are numbered to allow them to be easily identified in the output.  You can then use this output as a cross-reference for creating your custom language file.

Starting with an Empty File

While the sample language files contain a complete set of all output text, only the text values that you want changed need to be present in your custom language file.  For this reason it is recommended that you start with an empty file and add only the text values that you need.  An empty language file contains the following text:

<table><tbody><tr><td><?xml version="1.0" encoding="utf-8" ?>
<LanguageText content="wb-reference" lang="en-us">
</LanguageText></td></tr></tbody></table>

Language files are represented using XML and can be edited using a plain text editor such as Notepad.

Specifying a Custom Text Value

Using the annotated output that you created, locate a text value that you wish to change.  Using the annotated number as a cross-reference, find the <Text> tag for that text value in the annotated language file and copy and paste the tag to your custom file.  All <Text> tags must be enclosed within the <LanguageText> tag.  Below is an example containing a single <Text> tag:

<table><tbody><tr><td><?xml version="1.0" encoding="utf-8" ?>
<LanguageText content="wb-reference" lang="en-us">
<Text id="ReferenceTitle">Programmer's Reference Guide</Text>
</LanguageText></td></tr></tbody></table>

In order to ensure that your custom language file will parse correctly, all text values must be properly encoded.  Any less than signs (<) must be replaced with the less than entity (&lt;) and any ampersand (&) characters must be replaced with the ampersand entity (&amp;).

 

 


© 2005-2009 Adivo Ltd. All rights reserved.