There are 4 aspects to the document wide translation
- Each document will have a new property called
__i18n_lang
(you can customize this by setting thefieldNames.lang
property in thei18n
settings object) which contains the name of the language of this document.
{
"_id": "document-id",
"_type": "document-type",
"__i18n_lang": "en_US"
}
- Each translated document will additionally have a new field called
__i18n_base
(this field name can also be customized) which contains a reference to the base language document.
{
"_id": "document-id__i18n_lang",
"_type": "document-type",
"__i18n_base": {
"_type": "reference",
"_weak": false,
"ref": "document-id"
}
}
-
Translated documents will have following ID structure:
{base-document-id}__i18n_{lang}
. These predictable IDs make it easier to find translated documents. -
The base language document will have a property called
__i18n_refs
(you can customize this by setting thefieldNames.references
property in thei18n
settings object) which contains references to the translated documents (per language).
{
"_id": "document-id",
"_type": "document-type",
"__i18n_lang": "en_US",
"__i18n_refs": [
{
"_key": "lang",
"_type": "reference",
"_ref": "document-id__i18n_nl_NL"
}
]
}