In many instances, localization data are stored in the database instead of property files. XLIFF as a tool-neutral specification for the interchange of localization information has been taking root in the industry; the gap between XLIFF and database table schema should be closed. We developed a tool that can manage the process of extracting localization data from the XLIFF formatted file to the database and vise versa.
The main difficulty in the designing and implementing of the tool lies in the different formats of the XLIFF file and database table’s schema. We extended the XLIFF format a little to accommodate the format difference. Below is a sample of XLIFF file that maps to a record of a database table.

Figure 6: A sample XLIFF file for database. Click on image to display full-size.
We use the <group> element to group together translatable units of one record of a database table. The <key> element is introduced to record the keys of the record. There are other possible ways of extending the XLIFF to map the database table schema besides this one, for example, using a specific <context-group> element to record its database context information of a translatable unit. After introducing the XLIFF content format for database tables, let’s check the tool’s internal conversion steps.

Figure 7: XLIFF and records in database table conversion. Click on image to display full-size.
It first uses the XSLT to transform the XLIFF format as above into another intermediate XML file format that is more suitable for direct use by an Import/Export tool. The Import/Export Tool could be a tool available in a specific DBMS such as DB2 XML Extender in the DB2, or it could be a third party tool which has the ability of importing and exporting xml files from the database tables. |