Skip to main content

Spreadsheet Layout (Object)

The layout enumerates the segment fields to return when retrieving segments. In the translation editor, the layout specifies the editor columns. Fields may be source text, translation(s), comments, etc.

CREATING LAYOUTS

Columns

A layout is an ordered list of columns. Each column contains specific data from a segment.

Note that all the core properties of a segment such as its ID are always returned by queries independently from the columns.

A sample layout to retrieve English and French texts would be:

CODE
"layout" : {
  "columns": [
    { "fkey": "1~en~0" },
    { "fkey": "1~fr~0" }
  ]
}


The "fkey" uniquely identifies a data column. It is composed as follows:

CODE
{ftype}#{loc}#{fqualifier}


  • "ftype" is the type of the column (a number)
  • "loc" is the language of the column (if the column is specific for a language)
  • "fqualifier" is used with custom field and label columns only and corresponds to the CF/label id.


Column types

Available column types are:


Field type (ftype)Description of column contentSegment or Language
1

The source text or target text of a segment.

Language
2Context of the segment.Segment
3Status of a text.Language
4Origin of current text version: Human translation, pretranslation, etc.Language
5Locked statusLanguage
6BookmarkLanguage
7

Custom field. Requires specification of "fqualifier" in the "fkey". This is the ID of the custom field.

If the language is specified then the column contains the language specific CF. Otherwise it contains the CF that refers to the segment as a whole.

Both

8Label. Requires specification of "fqualifier" in the "fkey". This is the ID of the label.Both
9CommentsLanguage
10Memory hits. NOT IMPLEMENTED.Language
11A column that allows a user to add a new comment. For internal use only.Language
12RevisionsLanguage
13Error information. For example those set by a QA.Language
14TMX or extended properties.Segment

PROPERTIES

The JSON object has these properties:


nameInternal name of the layout. Can be disregarded.string
columns

An array of ordered columns.

Each column is a JSON object and contains the "fkey" property. This property uniquely identifies the data of the column (such as a translation in a specific language).

For all properties see below.

object[]

Each column has these properties:

fkey

Uniquely identifies the content of the column. When querying data you only need to include this property. All other properties below are for information purposes only.

The format is:

CODE
{ftype}~{loc}~{fqualifier}


Examples:

CODE
1~en~0   // The English text
8~~12   // The label with ID 12 (no language required)
3~fr~0   // The status of the French translation
1~#1~0   // The text in the 2nd language of the scope



string




Properties for information only:
ftypeThe type of the column. It is embedded inside "fkey".int
loc

The language code for the column. Some columns do not require a language and others do.

There are two means to specific languages:

a) Explicit language codes: "en", "fr-FR" ...

b) Language indexes: "#0", "#1", .... The system then replaces "#0" with the first language in the scope, "#1" with the second one ...


Language indexes can be used to work with generic layouts that can dynamically "adapt" to scopes. For example you could use a job layout that specifies two columns. One with the first language (source language) and another with the second language (first target language).

string
canEditIf false then this column is not editable by the user. Note that this is a general access right. You need to look at the access rights details sent back with each segment.bool
fqualifier

Used with certain data columns such as custom fields and labels. This then describes the CF or label ID.

0 if not applicable to field type.

int


EXAMPLES

A layout for querying data. Note that you only need to specify the "fkey" properties:

CODE
{
  "columns": [
    {
      "fkey": "1~en~0"
    },
    {
      "fkey": "1~fr~0"
    },
    {
      "fkey": "1~es~0"
    },
    {
      "fkey": "6~fr~0"
    },
    {
      "fkey": "13~fr~0"
    },
    {
      "fkey": "12~es~0"
    }
  ]
}


A layout using language indexes instead of codes:

CODE
{
  "columns": [
    {
      "fkey": "1~#0~0"
    },
    {
      "fkey": "1~#1~0"
    }
  ]
}




JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.