---
agentTools:
  projectIndex: https://opencontent.readme.io/v3.5/llms.txt
---

# Multi language

Each field can be defined as a multi language field by using a specific field type in the options layout file.

Multi language fields are marked with the flag image.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/Yng8DebKTNGcvBxqcSV7_oc-multi-language.JPG",
        "oc-multi-language.JPG",
        "592",
        "46",
        "#6e3951",
        ""
      ],
      "caption": "Edit form"
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Available field types"
}
[/block]

* Multi lingual Text : mltext
* Multi lingual CKeditor : mlckeditor
* Multi lingual wysihtml : mlwysihtml
* Multi lingual url : mlurl
* Multi lingual Image : mlimage
* Multi lingual File : mlfile

[block:api-header]
{
  "type": "basic",
  "title": "Example"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "\"Title\": {\n\t\"type\":\"mltext\"\n},\n\"Summary\": {\n\t\"type\":\"mlwysihtml\"\n},",
      "language": "json",
      "name": "options.json"
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Localization of templates"
}
[/block]

1. Add your translations in localization files (Edit Template Files)

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"key1\":\"texte 1 in french\",\n  \"key2\":\"texte 2 in french\"\n}",
      "language": "json",
      "name": "localization.fr-FR.json"
    },
    {
      "code": "{\n\t\"key1\":\"texte 1 in dutch\",\n  \"key2\":\"texte 2 in dutch\"\n}",
      "language": "text",
      "name": "localization.nl-NL.json"
    }
  ]
}
[/block]

2. Add the texts to your template

[block:code]
{
  "codes": [
    {
      "code": "\n{{Localization.key1}}\n",
      "language": "html",
      "name": "template.hbs"
    },
    {
      "code": "\n@Model.Localization.key1\n",
      "language": "text",
      "name": "template.cshtml"
    }
  ]
}
[/block]

[block:callout]
{
  "type": "warning",
  "title": "Handlebars",
  "body": "The localization variable is on the root. So if you localize text in a each. \nDon't forget to get the variable of the parent context {{..//Localization.key1}}"
}
[/block]