XMetaL Tips and Tricks

XMetaL Community Forum XMetaL Tips and Tricks DITA: Editing "generated text" strings for output

  • Su-Laine Yeo

    DITA: Editing "generated text" strings for output

    Participants 1
    Replies 0
    Last Activity 12 years, 7 months ago

    This article describes how to edit the “generated text” in output, for users of the DITA Open Toolkit (DITA OT). The DITA OT is installed with XMetaL Author Enterprise

    Generated text is text that is inserted during the process of creating output, and does not come from source files. For example, “Note: ” appears at the beginning of elements in English.
    The DITA OT will use generated text for the appropriate locale (language and region), depending on the “xml:lang” attribute that is set in your DITA source files. For example, if the xml:lang attribute indicates that your source files are in Spanish, “Nota: ” will appear at the beginning of
    elements instead of “Note: “.

    Prerequisites

    • Before you begin, [url=http://forums.XMetaL.com/index.php/topic,939.0.html]locate your active copy of the DITA OT folder[/url].
    • Make sure the root element of each DITA topic and map is tagged with an appropriate xml:lang attribute. See [url=http://forums.xmetal.com/index.php/topic,953.msg2983.html#msg2983]DITA: Indicating the language of content for DITA processing[/url] for details.
    • You do not need to know XSL or any programming language to work with the files mentioned in this article. However, make sure you know how to open configuration files using an [url=http://forums.xmetal.com/index.php/topic,955.0.html]appropriate multilingual text editor[/url].

    Strings Files for non-PDF Output
    Most output formats from the DITA Open Toolkit use strings that are defined in the following folder: DITA_OTxslcommon. The exceptions to this rule are PDF output (see below), and Eclipse Content which does not contain any formatting information.

    The DITA_OTxslcommon folder contains 47 files with the name “strings-.xml” The locale codes used in the file names are described here: http://dita-ot.sourceforge.net/doc/ot-userguide/xhtml/localizing/aboutlocalizing.html .

    To edit the strings for a particular locale, open the strings file for that locale in a [url=http://forums.XMetaL.com/index.php/topic,955.0.html]suitable text editor[/url].

    Strings Files for PDF Output
    It is helpful to know the following quirks of how the DITA OT is designed:

    • The strings files that are used in most output formats are not used in PDF output at all. PDF output uses an entirely different set of files.
    • By default, only 7 locales are supported in PDF output: English, French, German, Italian, Japanese, Spanish, and Simplified Chinese.
    • The names of strings files use underscores instead of hyphens, e.g. fr_FR.xml instead of fr-fr.xml. However, in the xml:lang attribute in your content, you must use hyphens in locale codes.
    • The names of strings files use capital letters for country codes, e.g. zh_CN instead of zh_cn. In the xml:lang attribute in your content, case does not seem to matter. E.g. zh-cn works just as well as zh-CN.
    • Ignore all warnings in the files that tell you to not edit the files.

    If you are using the “XMetaL Enhanced PDF via RenderX XEP ” deliverable type that comes with XMetaL, the strings files are in the following folder: DITA_OTdemoxmfocfgcommonvars . They are overridden by any files in the following folder: demoxmfoCustomizationcommonvars.

    If you are are generating PDF output using a separate installation of the DITA Open Toolkit, the strings files are in the following folder: DITA_OTdemofocfgcommonvars . They are overridden by any files in the following folder: demofoCustomizationcommonvars.

    Note that the zh_CN.xml file that is installed with the DITA OT contains many English strings. This is a known issue in the DITA OT.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support