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
| Property | Returns | Description |
|---|---|---|
| createdDate | Date | When this translation was first created. Never null. |
| editor | 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. |
| id | long | Unique database identifier for this translation. |
| langCode | 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. |
| modifiedDate | Date | When this translation was last edited. It is the same as the created date until the translated text is changed. |
| sourceField | 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. |
| sourceHash | 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. |
| sourceId | String | Identifies the particular record being translated, held as text. For a product this is the internal id of the Product record. Never null. |
| sourceType | 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. |
| translated | 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. |
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.
| Parameter | Description |
|---|---|
id | the primary key to use |
setOrganisation(Organisation organisation)
Returns: void
Sets the admin organisation which owns this translation.
| Parameter | Description |
|---|---|
organisation | the 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.
| Parameter | Description |
|---|---|
editor | the 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.
| Parameter | Description |
|---|---|
createdDate | when 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.
| Parameter | Description |
|---|---|
modifiedDate | when 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.
| Parameter | Description |
|---|---|
sourceHash | the 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.
| Parameter | Description |
|---|---|
translation | the 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.
| Parameter | Description |
|---|---|
sourceType | the 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.
| Parameter | Description |
|---|---|
sourceId | the 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.
| Parameter | Description |
|---|---|
sourceField | the 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.
| Parameter | Description |
|---|---|
langCode | the language code, for example "en" or "fr" |