Administration > Customizing Spelling Checking > autocorrect.xlf File
  
autocorrect.xlf File
The autocorrect.xlf file supports the Arbortext Editor auto correct feature. The file is automatically loaded when Arbortext Editor starts. On initialization, the autocorrect.xlf file corresponds to the system locale language. If a document with a different language definition is subsequently loaded, Arbortext Editor will search for an autocorrect.xlf file that corresponds to that language, and load it if it exists.
A document’s language definition is assessed based on information from its stylesheet:
If based on a .style stylesheet
1. Arbortext Editor extracts the language attribute defined in the Language attribute name field of the Language definition in Stylesheet Properties. It then obtains the value of that attribute from the root element of the document being loaded, if it is present.
2. If the language attribute for the document can’t be analyzed, Arbortext Editor uses the value of the Default language field of the Language definition in Stylesheet Properties.
If based on a .fos
Arbortext Editor extracts the language attribute defined in the langAttribute element of the document type’s DCF file. It then obtains the value of that attribute from the root element of the document being loaded, if it is present.
If the language definition can’t be confirmed in this way, en is used as a fallback.
Once extracted, the language value is truncated at the hyphen (if any), for example es-MX becomes es (language-code).
Arbortext Editor then attempts to find an autocorrect.xlf file that matches the current language definition.
The default autocorrect.xlf file (en) is located in the Arbortext-path/lib directory. It is only used for the English locale.
If you want to maintain your own version of the English file, save it to Arbortext-path/custom/lib/locale/en as best practice.
You can create custom or other-language versions of autocorrect.xlf. As best practice, these files should be stored in:
Arbortext-path/custom/lib/locale/language-code.
Arbortext Editor searches every custom and application directory to find an autocorrect.xlf file that matches the current language definition.
It searches for the sub-directory custom or application directory/lib/locale/language-code, for example Arbortext-path/custom/lib/locale/es.
When it encounters an autocorrect.xlf, it analyzes the value of its source-language attribute to confirm a match with the language definition of the document being loaded. If the values are the same, Arbortext Editor loads the autocorrect.xlf.
If Arbortext Editor cannot locate an autocorrect.xlf that matches the language definition of the document, no autocorrect options will be available.
* 
Arbortext Editor does not check that the language code being used is a legal code.
The autocorrect.xlf file contains a list of incorrect words with corresponding correct replacement words. When you enter or change a word in a document, the auto correct feature checks that word against the list in the autocorrect.xlf file. If a misspelled word is included in the file, Arbortext Editor automatically replaces that word with the replacement word specified in the file.
The autocorrect.xlf file uses the XML Localization Interchange File Format (XLIFF) document type. See www.oasis-open.org/committees/xliff/documents/xliff-specification.htm for more information about XLIFF. The XLIFF document type specifies sets of source and target tags, where the source tag contains the incorrect word and the target tag contains the replacement word. The file has the following format:
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2005, v.4002-->
<xliff version="1.1" xmlns="urn:oasis:names:tc:xliff:document:1.1">
<file datatype="cstring" original="autocorrect.xlf" source-language="en" xml:space="default">
<body>
<trans-unit id="0">
<source>abbout</source>
<target>about</target>
</trans-unit>
<trans-unit id="0">
<source>abotu</source>
<target>about</target>
</trans-unit>
...
Limitations of support for multiple autocorrect.xlf files for languages
A document's language is determined at the time the document is initialized, based on either its stylesheet or the language attribute for its root tag. Changing the document language definition after document initialization will not adjust the autocorrect file in use. For example:
Documents that use multiple languages
Nested documents that define a different language from the parent document — only the language definition for the root tag of the parent document will be analyzed
Change of the document’s language attribute during editing
Change of the stylesheet’s language attribute during editing