Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

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:

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

 

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

{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 contentRequires language
1

The source text or target text of a segment.

Yes
2Context of the segment.No
3Status of a text.Yes
4Origin of current text version: Human translation, pretranslation, etc.Yes
5Locked statusYes
6BookmarkYes
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.

Yes/No
8Label. Requires specification of "fqualifier" in the "fkey". This is the ID of the label.No
9CommentsYes
10Memory hits. NOT IMPLEMENTED.Yes
11A column that allows a user to add a new comment. For internal use only.Yes
12RevisionsYes
13Error. For example those set by a QA.Yes

 

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:

{ftype}~{loc}~{fqualifier}

 

Examples:

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:

{
  "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:

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

 

 

 

  • No labels