3

I am creating a new multi-lingual site and the documentation does not explain the difference between the options in the translation method dropdown.

enter image description here

What is different for each of these and when is it recommended to choose the from the options?

1 Answer 1

6

Not translatable

The field will always have the same value for each site

Translate for each site

Easy: the field can have a different value for each of your sites. Create 10 sites, all can have different content

Translate for each site group

Every site group can have a different value, create 10 site that are all in the same group, all elements will have the same value, create a site in another group -> that one can have a different value than the other 10

Translate for each language

Create 10 sites, all in the same language, all will have the same content, no matter what group they are in. Create another site in another language -> this one can have different content

Custom

You can define custom behaviors
edit a few more words about this

There will appear an <input>below that option and Craft will actually do this

if ($field->getTranslationKey($siteElement) === $field->getTranslationKey($element)) {
    // Copy the master element's value over
    $siteElement->setFieldValue($field->handle, $element->getFieldValue($field->handle));
}

Which basically means: it will render both object templates (the original element, and the element for all other sites) and injects the element into the template..

For example if you have something like { title } in your template, Craft will render those templates, and will compare them. If the titles are the same, the field is translatable and may contain a different value for all sites, if the titles are equally, the content of your field will be equally as well.

1
  • 3
    Excellent - this should be in the documentation
    – CreateSean
    Commented Jul 23, 2018 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.