opentag.com
\\ Technologies :: Formats :: OpenTag

OpenTag is a format developed for a task often encountered in localization: the extraction of translatable text with the capability of merging back the localized data in the original format.

Note: OpenTag is not maintained anymore and you might want to use XLIFF instead, the XML Localisation Interchange File Format, successor of OpenTag.

OpenTag was originally developed by the R&D group at ILE Corporation, in Boulder, Colorado. It was the evolution to XML of an original extraction format developed there in the late 80s and early 90s. People from various other companies also participated to the development of OpenTag, and several tool sets developed for in-house or commercial use have taken advantage of the format.

OpenTag works the following way:

A filter (an application that extract and merge text) extracts the localizable text from an input file in a given format, creating two output files: The OpenTag document and a reference file.

  • The OpenTag document (.OTF) contains the translatable text items in a common structure regardless what was the original format of the input file.
  • The reference file, usually called Skeleton file (.SKL) is a copy of the original file with a mechanism of placeholders to put back the text into its original format.

The way the reference file is built is not specify by the OpenTag specifications, it's up to the creator of the filter tool to create whatever is appropriated. For instance, extracting data from a compiled DLL will require a different approach than extracting the same text from an RC file.

Here is a simple RC example file, with the translatable text in bold:

#include "resource.h"
IDD_DIALOG1 DIALOG DISCARDABLE  0, 0, 186, 57
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Title"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "&Path:",IDC_STATIC,8,4,18,8
    EDITTEXT        IDC_EDIT1,8,16,100,14,ES_AUTOHSCROLL
    CONTROL         "&Validate",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | 
                    WS_GROUP | WS_TABSTOP,8,40,41,10
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14,WS_GROUP
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
END

A tool would generate the following OpenTag file from it:

<?xml version="1.0" encoding="windows-1252" ?>
<opentag version="1.2">
 <file lc="EN-US" ts="skl:964008261" datatype="winres" tool="WinRcFilter"
  original="C:\Hobbit\Sample1.rc" reference="c:\Hobbit\sample1.skl">
  <grp id="1" type="dialog" rid="IDD_DIALOG1">
   <p type="caption">Title</p>
   <p id="2" type="label" rid="IDC_STATIC">&amp;Path:</p>
   <p id="3" type="check" rid="IDC_CHECK1">&amp;Validate</p>
   <p id="4" type="button" rid="IDOK">OK</p>
   <p id="5" type="button" rid="IDCANCEL">Cancel</p>
  </grp>
 </file>
</opentag>

and the following Skeleton (reference) file:

<OKFSKL100:RES:964008261>
#include "resource.h"
IDD_DIALOG1 DIALOG DISCARDABLE  0, 0, 186, 57
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "<ref$T1>"
FONT 8, "MS Sans Serif"
BEGIN
    LTEXT           "<ref$T2>",IDC_STATIC,8,4,18,8
    EDITTEXT        IDC_EDIT1,8,16,100,14,ES_AUTOHSCROLL
    CONTROL         "<ref$T3>",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | 
                    WS_GROUP | WS_TABSTOP,8,40,41,10
    DEFPUSHBUTTON   "<ref$T4>",IDOK,129,7,50,14,WS_GROUP
    PUSHBUTTON      "<ref$T5>",IDCANCEL,129,24,50,14
END

After the extracted text has been processed for whatever purpose it was extracted (translation, spell-checking, etc.) you can use the filter to merge back the text items into the reference file.

The same principle applies to any type of files: documents, Web-related file, database tables, and so forth. You only need to have a filter to perform the extraction and the merging. All your other tools can work using OpenTag as input and output, making development much easier.