XML Scanner

Overview. XML scanner options allow the user to specify how to localize XML files. Multilizer allows to localize both single-language and multilingual XML files.

The most important settings are the following:

  • File; the XML file to localize
  • Output files (Output tab); choose if Multilizer writes out single-language or multi-language XML file.
  • XML Structure Sensitive (Elements tab); allows user to specify if the XML file is parsed by structure or by tag name.

Availability

This plug-in is available in Multilizer Enterprise and Multilizer Pro for Documents. To get an evaluation version for other Multilizer versions, contact sales(at)multilizer.com.


Tabs

Output

Output directory. Specifies the directory where the localized files will be created. This is the directory where Multilizer creates the localized output files and sub directories. You can control the name of the localized files and directories by setting Type and Coding.

Output files

Allows user to specify, whether to write localized files (one file per target language) or a multilingual file.

Localized file(s)

Create a separate file for each language in the project. For example if the original file is Sample.xml and the project contains German and French, Multilizer creates de\Sample.xml and fr\Sample.xml. These files equal to the original file except the selected tag contents have been translated.

Multilingual file

Create a one multilingual XML containing all the languages in the project. The output directory is multilanguage. For example if the original file is Sample.xml, Multilizer creates multilanguage\Sample.xml that contains resources in each language of the project.

The language of the tag is specified with xml:lang attribute.

Note! in order to correctly create localized files, the source XML must have xml:lang attribute.
Note! Multilingual files support localization of nodes (elements) only. Attributes are not supported.

Output file name

Type. Specifies how and where MULTILIZER creates the localized file version(s). Possible options are:

Subdirectory Create localized file(s) in sub directories named by language and locale.
Bundle name Append the language and locale information in the output file name.
File extension Replace the original file extension with language and locale information.

Coding. Selects file name initial coding style. Possible values are:

ISO ISO standard coding style.
.NET Microsoft .Net coding style.
Windows Windows coding style.

Line feed

Specifies the line feed (end-of-line character). It also affects what is written in the TAG content, if it's multi-line.

Encodings

Native language. Specifies the native language that is used in the target . Set this to match the language in the original document. If the original document contains two or more languages mixed, set the language to most widely used.

Default language. Specifies the default language. It is the language that is used in the build process, if there is no translation given in the the build language. The translation search order is following: first the build languages, then the default language.

Native encoding. Specifies the native encoding that is used in the target with each character set.

Encoding list. Contains the encodings to be used in the localized files. To change the value right click the line and select a new value.

Elements

Here you specify the elements and attributes that contain localizable information. Simply check the elements that you want to localize.

XML Structure Sensitive

This setting affects how Multilizer parses the XML.

  • If this is checked, Multilizer builds a parse tree based on the content. This format is good for XML that has a strict (and simple) structure. Typically Structure Sensitive mode is good for data that is organized like records in a database.
  • Structure insensitive mode parses the XML by tag name. So regardless the location in the XML structure the tag is handled in the same way. This mode is good for instance for parsing XHTML for example.

Tags

Tags are used for the following purposes:

Smart context

By default XML elements (nodes) with the same name are identified with a looping number. Thus, the context in Multilizer project consists of node names and index. This approach is useful in most situations. Problems arise however, if new nodes are inserted between old ones. In this case the context changes for all subsequent nodes, which might clear exsiting translations.

To customize the way that Multilizer forms the context, you can specify that attribute values are part of context. The additional information is declared as nodename - attributename pairs, like this:

row=id
row=id2
xml=mainid

The first value is the nodename and the second is the name of the attribute that is inside the node. In the context in Multilizer the context will contain the value of the specified attribute as seen in the examples below.

The user can specify multiple attribute names for the same node. In this case all attribute values are part of the context.

Using tags, the context becomes more static; the context doesn't change untile user changes an attribute value. This ensures that no translations are lost in localization.

To understand the importance of this feature, consider the following example:

XML file to localize:

<xml>
  <row id="first">My first row</row>
  <row id="second">My second row</row>
  <row id="third">My third row</row>
</xml>

Resulting Multilizer project:

Default context Context using attributes (as defined on Tags tab)
Context Native Translation (fi)
root[1].row[1] My first row 1. rivini
root[1].row[2] My second row 2. rivini
root[1].row[3] My third row 3. rivini
Context Native Translation (fi)
root[1].row[first] My first row 1. rivini
root[1].row[second] My second row 2. rivini
root[1].row[third] My third row 3. rivini

Next, XML a new tag is inserted in the XML file so that it becomes like this:

<xml>
  <row id="first">My first row</row>
  <row id="newsecond">My second row</row>
  <row id="second">My second row</row>
  <row id="third">My third row</row>
</xml>

Resulting Multilizer project:

Default context Context using attributes (as defined on Tags tab)
Context Native Translation (fi)
root[1].row[1] My first row 1. rivini
root[1].row[2] My new second row 2. rivini
root[1].row[3] My second row 3. rivini
root[1].row[4] My third row  

As seen, the contexts are the same, but native texts have changed for the context starting from the node that was changed. As translations keep their place according to context, they get displaced.

Context Native Translation (fi)
root[1].row[first] My first row 1. rivini
root[1].row[newsecond] My second row  
root[1].row[second] My second row 2. rivini
root[1].row[third] My third row 3. rivini

As seen, the translations are on correct places.

Reading of comments from attributes

Tags can be used for specifying that attribute values are read as row comments into Multilizer. For this purpose the following notation is used in tags:

!tagname=attributename

Example: With the following XML ...

<xml>
  <row id="first" comment="This comment is scanned by Multilizer">My first row</row>
  <row id="newsecond">My second row</row>
  <row id="second">My second row</row>
  <row id="third" comment="This comment is scanned by Multilizer">My third row</row>
</xml>

... the user can specify the following tag for reading the comments:
!row=comment

Note! Use this feature carefully to avoid that Multilizer overwrites your existing row comments.

Validation

On the validation tab you can specify whether to validate the source (native) xml document or not.