Since search definitions and results are already in XML format with name attributes on the elements that require translation, the translation can be performed automatically by supplying appropriate dictionaries (see below).
The format of the dictionary xml files is illustrated in the following example. An XLIFF file consists of one or more 'file' elements. Each 'file' element contains a 'body' element, and can contain a 'header' element with project data. The 'body' element contains 'trans-unit' elements. A 'trans-unit' element contains 'source' and 'target' elements, and can contain 'alt-trans' elements.
Within these elements are the terms to be translated and correspond to attributes of the search definition parameters. This generally only involves label, description and tooltip attributes, and option elements for list parameters. Since element names cannot contain spaces or other special characters these need to be expanded into a hexadecimal format, as illustrated by the element for the 'Standard Search'.
<?xml version="1.0" encoding="utf-8"?> <xliff version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2- strict.xsd" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3c.org/2001/XMLSchema-instance"> <file original="default.xml" source-language="en" target-language="fr" datatype="xml" xmlns=""> <body> <group resname="Standard_x0020_Search"> <trans-unit id="ID0AYRAI04RAI" resname="label"> <source>Standard Search</source> <target>Recherche Standard</target> </trans-unit> <trans-unit id="ID0AYRAI05RAI" resname="description"> <source>iConsole Standard Search for general purpose searching for all event types.</source> <target>La Recherche de Norme d'iConsole pour chercher tous les types d'événement.</target> </trans-unit> ..... </group> </body> </file> </xliff>
To simplify the production of dictionary files, there is an XSL transform available which will take a search definition xml file as input and produce a dictionary file as output. This transform is called SD-to-i18n-dict.xsl and can be found in the Webservice/transformations folder.
The iConsole looks for several dictionary files to perform the translation and applies these in order of precedence:
In this way the number of translation strings is minimized, with common terms in the general string files, generic French terms for the specific search in one file, and only Belgian variations in the Belgian French file.
Note: Not all of these files need to exist, the iConsole will use whichever dictionaries it finds, in the order above.
Note: The tilde (~) prefix in the global dictionary files ensures that these files are accessed after all other dictionary files.
Copyright © 2014 CA.
All rights reserved.
|
|