Skip to main content

DITA

Extension

.dita

Smartling Identifier

dita

Example File

not available

Resources

Smartling supports DITA file format as defined by the DITA standards version 1.3. Smartling provides a default setup of DITA parsing which determines how tags are treated (inline, block/splits content), what constitutes a placeholder, etc. Customizations to DITA can override Smartling defaults. There are two options on how DITA files can be managed

  1. Smartling Managed: Smartling will create templates to manage any customizations or overrides from the defaults. This is best if the DITA structure and customizations do not change often.

  2. Customer Managed: Smartling can provide necessary directives to force customizations or overrides, but the customer would need to manage the directives themselves.

Excluding Content from Translation

Content inline in a DITA file can be marked as not translatable through attributes on tags. In the example below <a> tag is used for the example, but the attributes (class, translate, data-sl-notranslate) are supported for any tag.

<a href="" class="notranslate">

<a href="" translate="no"">

<a href="" translate="no"">

<a href="" data-sl-notranslate="no">

Directives

File directives are supported via our API. Directives are specified in comments within the files, in the following format:

API Parameter

smartling.[directive_name] = [value]

Here are examples of supported directives for DITA:

Force Inline Tags

Directive

force_inline_for_tags

Values

A comma-separated HTML tag list

Yes

Description

This parameter forces the HTML parser to treat the listed tags as inline. The difference between block and inline tags is that block tags are used to split HTML into strings, whereas inline tags are included in strings.

Examples

smartling.force_inline_for_tags = external_link,reference

Any <external_link> or <reference> tags will be parsed as inline tags. Smartling will not create separate strings for content in these tags.

Do not translate tags

Directive

no_translate_tags

Values

A comma-separated list of tag and attribute-based rules to exclude text blocks from translation. These rules determine which tags will bypass the translation process.
​
Rules:
1. tag1,tag2 - disable translation for tags tag1 and tag2
2. tag1@attribute1 - disable translation for tag tag1 if it has attribute attribute1
3. tag1@attribute1="value1" - disable translation for tag tag1 if it has attribute attribute1 with value value1
4. @attribute1 - disable translation for any tag which contains attribute attribute1
5. @attribute1="value1" - disable translation for any tag which contains attribute attribute1 with value value1
6. tag1!@attribute1 - disable translation for tag tag1 which doesn't have attribute attribute1
7. tag1!@attribute1="value1" - disable translation for tag tag1 which doesn't have attribute attribute1 with value value1

Yes

Description

Excludes specific text blocks from translation based on the tags and attributes they contain, as defined by a set of rules.

Rules:
1. Specific tags: Text within specific tags (e.g., tag1, tag2) will not be translated.
2. Tags with specific attributes: Exclude text in a tag (e.g., tag1) if it includes a certain attribute (e.g., attribute1).
3. Tags with Attribute-Value Match: Exclude text in a tag (e.g., tag1) if it has an attribute (e.g., attribute1) with a specific value (e.g., value1).
4. Any Tag with a Specific Attribute: Exclude text in any tag that contains a specific attribute (e.g., attribute1).
5. Any Tag with Attribute-Value Match: Exclude text in any tag if it contains an attribute (e.g., attribute1) with a specific value (e.g., value1).
6. Tags without Specific Attributes: Exclude text in a tag (e.g., tag1) if it does not have a certain attribute (e.g., attribute1).
7. Tags without Attribute-Value Match: Exclude text in a tag (e.g., tag1) if it lacks an attribute (e.g., attribute1) with a specific value (e.g., value1).

Examples

smartling.no_translate_tags=tag1, tag2

Tag1 and tag2 will not be ingested for translation. Smartling will not create strings for the content in these tags.

Trim Whitespace

Directive

whitespace_trim

Values

on|yes|true or off|no|false or leading|trailing

The default value is on.

Yes

Description

A whitespace is any character or series of characters that represent horizontal or vertical space in typography. When rendered, a whitespace character is not a visible mark, but does occupy an area or space on a page.

Although whitespaces are necessary within a string (typically to separate words), unnecessary whitespaces can be found at the start of a string (leading) and at the end of a string (trailing).

With this directive, you can trim whitespaces, as it enables or disables whitespace trim management for the ingested strings.

Whitespace is optionally trimmed from content then re-inserted on download for convenience so that translators do not have to manage the extra spaces. However, content owners may want to retain surrounding whitespace so that translators can
manipulate it during translation.

By default, the leading and trailing whitespaces are trimmed.

You can choose to disable trimming or specify trimming for leading or trailing whitespaces.

The directive can only be used as the API request parameter.

Examples

smartling.whitespace_trim=on

Smartling will trim leading and trailing whitespaces (default)

smartling.whitespace_trim=off

Smartling will not trim leading or trailing whitespaces

smartling.whitespace_trim=leading

Smartling will trim only leading whitespaces

smartling.whitespace_trim=trailing

Smartling will trim only trailing whitespaces

Did this answer your question?