Translating XLIFF Files

Last update:  December  2009 (for RC-WinTrans 9)


Localizing bilingual XLIFF files involves the translation of the files' <target> text elements and changing/updating their translation status attributes ("state").


As an extension of the GUI (graphical user interface), the support for XLIFF files includes a (HTML) display for the properties and actual XML data of a selected translation unit.  An additional view showing the source XLIFF file is available in the Project window's Source File tab.



Supported XLIFF Formats/Versions




NOTE:  XLIFF 1.0 files are not supported.  However, an XLIFF 1.0 file may be used by changing its version number (in the file) to 1.1.



Requirements for XLIFF Files

XLIFF Version 1.1 or 1.2.

Only ONE <file> section can exist in the file.

There should be a "target-language" <file> attribute so that the target language for a target XLIFF file can be set.

<target> elements should be present (empty or with a translation).

Namespace- the XLIFF file may (but is not required to) be included in the XLIFF namespace (XLIFF namespace declarations in the XLIFF file).



Elements and Attributes (Read/Write/Edit)






All translation units are read regardless of whether the "translate" attribute is "yes" or "no."  If the attribute's value is "no" the translation unit is set (internally) in RC-WinTrans as being "excluded from translation" (to prevent editing).



"source" element text read as the source text.



"target" element text read as the target text.  This element can be edited as long as the trans-unit attribute "translate" is not set to "no" (in the source XLIFF file).

NOTE 1:  This element is read when adding the XLIFF file to the RC-WinTrans project and in case the target language is the same as the project's active target language.

NOTE 2:  The target text can be imported for any target language at any time using the appropriate import command.


<file> target-language

"target-language" attribute set as the target language for which the target file is created.


<target> xml:lang

"xml:lang" attribute set to the target language when the target file is created.  An XLIFF <target> element does not usually have the "xml:lang" attribute but if it exists it will be set in the source XLIFF file.


<target> state

"state" attribute.

Reading:  The attribute value is read (and imported) when the <target> element text is imported.

Writing:  The attribute value is set for the attribute in the translated target XLIFF file that is created.

Editing:  The XLIFF state value is set by RC-WinTrans automatically whenever a target text is edited.  It is also possible to set a translation unit's  state manually (more information further on).




"maxwidth"  attribute.




File header "note" element.

The element is imported as a translatable text. Same as source text of a translation unit.




Trans-unit "note" element.

Reading:  The element text is imported into the project database when adding the XLIFF file to a translation project.

Writing:  The element text is set when the target file is created.

Editing:  The value is displayed in RC-WinTrans and can be edited (more information further on).




Editing Target Text  (<target> Element)

Target text is edited in the Target Text field of RC-WinTrans' Translation Edit bar, or via "inline editing" in the Text Table view.  In general, target text translation and other features such as the spell check are supported in the same way as for all other file types.



Importing Target Text  (<target> Element)

Target text can be imported from an XLIFF file at any time by using the import command
| Import from Existing Translated File.


See also: "Import from Translated Resource File."


Automatic Import When Adding a File to a Translation Project

When adding an XLIFF file to a translation project the target text is carried over to the project database (and shown in the Text Table view's "Target" column) only when the project's active target language is the same as the target language specified in the "target-language" XLIFF file attribute.  If the project's active target language is different then the target text column will remain empty (all elements must be translated).



Translation Status  ("state")

The XLIFF "state" attribute value is automatically set by RC-WinTrans whenever a target text is edited.  An item's state can be set manually in the Text Table view's "State" column (Figure 1) or by using the State Flag command from the Edit menu.


See also:  "Setting Item Attributes and State Flags."



RC-WinTrans calculates the translation status for a file or project ("translated" or "not translated") based on the state flags that have been set:


State = "final"; "translated"; or "signed-off."

Not translated...

State = any other state flag (except "changed source").


Translation calculation and indication in RC-WinTrans occurs in the following views/displays:

Status bar.

Project Data tab view.

Statistics page.


"Changed Source" State

In addition to the standard XLIFF state values, RC-WinTrans defines a "changed source" state used to indicate that a translation unit has already been translated but the original text in the source file has been modified.  The underlying attribute value used in the XLIFF file is "x-change."


Color-Coded State Indication

The colors used in the Text Table view to indicate a certain state can be determined in the Options dialog box.



Figure 1:  The "State" column in RC-WinTrans' Text Table view.  Select the state to activate a combo-box containing the various item state options.



Viewing Actual XLIFF Data

An "extended data view" showing the actual XML data of the currently selected translation unit is also available.  The view displays the <trans-unit> element in the source file and the <trans-unit> element in the target file.


Open the extended data view using the menu command provided by the XLIFF Files Add-On
(Add-On menu | XLIFF Files | Show TU Data).


Figure 2 shows the actual context of the <trans-unit> XML data as it appears in the XLIFF target file. A properties list, source file data display and changes history for the selected translation unit is provided by the menu bar located at the top of the view.  The Source File view showing the original XLIFF file's data can be seen on the bottom left with the selected source text highlighted.


NOTE:  The source data view shows the data as it actually appears in the source XLIFF file.  Likewise, the target data view shows the data as it actually appears in the target XLIFF file (for the active target language).  This means that a view of the source data is only available when the source XLIFF file exists (is available/accessible), and a view of the target data can only be generated when the translated target file exists.  If the translation data has been modified the target file must be newly created in order to display the target file's data.



Figure 2:  Various views of the source and target data for a selected XLIFF file in RC-WinTrans.  Top left: Text Table view; bottom left: Source File view; right: actual target data display in the extended view.











Displaying and Editing Notes  (<note>)



The <note> element text is displayed in the following RC-WinTrans views:

Translation Edit bar >> Note field (Figure 3).

Project window (Text Table view)  (Figure 4- Note symbol).



The <note> element text can be edited in the following RC-WinTrans views:

Translation Edit bar >> Note field (Figure 3).

Text Table view (Project window)  (Edit menu | Note command).



Figure 3:  The Note field in the Translation Edit bar.



Figure 4:  Notes indication in the  Text Table view.



Viewing Actual Content of Source File (Source File View)

The actual content of a source XML file can be displayed for the active source file (active translation unit) in the Source File tab view (Project window).



^ TOP ^