Holds the translated text for one field of one source record in one language. Translations are looked up by the source type (a name such as "Product"), the identity of the source record, the field within it and the language code, all within one admin organisation. The source hash records a digest of the original text, so a reader can tell whether the source has changed since it was translated. A record with a title and a description translated into two languages therefore has four rows, one per field per language.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
createdDateDateWhen this translation was first created. Never null.
editorProfileThe profile which last edited this translation. It is set when the translation is created and updated on each edit, so it records the most recent editor rather than the original author.
idlongUnique database identifier for this translation.
langCodeStringThe language this row is translated into, as a language code such as "en" or "fr". Together with the source type, source id and source field it identifies the translation uniquely within the organisation.
modifiedDateDateWhen this translation was last edited. It is the same as the created date until the translated text is changed.
sourceFieldStringThe field of the source record this row translates, for example the title or the description of a product. A record with several translatable fields has one translation row per field per language.
sourceHashStringHash of the source text this translation was made from, which lets a reader detect that the original has since changed and the translation is stale. It is also the key used when looking a translation up by hash and language code.
sourceIdStringIdentifies the particular record being translated, held as text. For a product this is the internal id of the Product record. Never null.
sourceTypeStringNames the kind of record being translated, for example "Product". It is a plain string chosen by the code which created the translation, not a class name the platform validates. Never null.
translatedStringThe translated text itself, in the language given by the language code. It holds up to 200,000 characters, so it suits long fields such as a description as well as short labels.

Methods

getId() · setId(long id) · setOrganisation(Organisation organisation) · getEditor() · setEditor(Profile editor) · getCreatedDate() · setCreatedDate(Date createdDate) · getModifiedDate() · setModifiedDate(Date modifiedDate) · getSourceHash() · setSourceHash(String sourceHash) · getTranslated() · setTranslated(String translation) · getSourceType() · setSourceType(String sourceType) · getSourceId() · setSourceId(String sourceId) · getSourceField() · setSourceField(String sourceField) · getLangCode() · setLangCode(String langCode)

getId()

Returns: long

Unique database identifier for this translation.

setId(long id)

Returns: void

Sets the database identifier. The database assigns this when the translation is first saved, so it is not normally set by hand.

ParameterDescription
idthe primary key to use

setOrganisation(Organisation organisation)

Returns: void

Sets the admin organisation which owns this translation.

ParameterDescription
organisationthe owning admin organisation

getEditor()

Returns: Profile

The profile which last edited this translation. It is set when the translation is created and updated on each edit, so it records the most recent editor rather than the original author.

setEditor(Profile editor)

Returns: void

Sets the profile recorded as the last editor of this translation.

ParameterDescription
editorthe profile which edited the translation

getCreatedDate()

Returns: Date

When this translation was first created. Never null.

setCreatedDate(Date createdDate)

Returns: void

Sets the creation timestamp.

ParameterDescription
createdDatewhen the translation was created

getModifiedDate()

Returns: Date

When this translation was last edited. It is the same as the created date until the translated text is changed.

setModifiedDate(Date modifiedDate)

Returns: void

Sets the last modified timestamp.

ParameterDescription
modifiedDatewhen the translation was last edited

getSourceHash()

Returns: String

Hash of the source text this translation was made from, which lets a reader detect that the original has since changed and the translation is stale. It is also the key used when looking a translation up by hash and language code.

setSourceHash(String sourceHash)

Returns: void

Sets the hash of the source text this translation was made from.

ParameterDescription
sourceHashthe hash of the source text

getTranslated()

Returns: String

The translated text itself, in the language given by the language code. It holds up to 200,000 characters, so it suits long fields such as a description as well as short labels.

setTranslated(String translation)

Returns: void

Sets the translated text.

ParameterDescription
translationthe translated text

getSourceType()

Returns: String

Names the kind of record being translated, for example "Product". It is a plain string chosen by the code which created the translation, not a class name the platform validates. Never null.

setSourceType(String sourceType)

Returns: void

Sets the kind of record being translated.

ParameterDescription
sourceTypethe source object type, for example "Product"

getSourceId()

Returns: String

Identifies the particular record being translated, held as text. For a product this is the internal id of the Product record. Never null.

setSourceId(String sourceId)

Returns: void

Sets the identity of the record being translated.

ParameterDescription
sourceIdthe identity of the source record, as text

getSourceField()

Returns: String

The field of the source record this row translates, for example the title or the description of a product. A record with several translatable fields has one translation row per field per language.

setSourceField(String sourceField)

Returns: void

Sets the field of the source record this row translates.

ParameterDescription
sourceFieldthe name of the translated field

getLangCode()

Returns: String

The language this row is translated into, as a language code such as "en" or "fr". Together with the source type, source id and source field it identifies the translation uniquely within the organisation.

setLangCode(String langCode)

Returns: void

Sets the language code of the translation.

ParameterDescription
langCodethe language code, for example "en" or "fr"
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.