Help topics

A translation for the default language is rejected

Symptoms

Saving an entry fails with this message:

en is not one of the site languages

The code in the message is the default language. The API returns "code":"invalid", "field":"_i18n.en" and "reason":"language", with HTTP status 422.

Cause

The first row in Settings > Languages is the default language. Its text lives in the normal fields of the entry.

Morphic does not accept a translation for the default language, so the message names that code.

Fix

Use the fix that matches what you want to change.

If you want to change the text in the default language

  1. Open the entry.
  2. In the field you want to change, enter the new text.
  3. Select Save.

If you want text for another language

  1. Open Settings > Languages and check that the language is listed below the first row.
  2. Open the entry.
  3. Select the language name in the language switch. The language switch appears when the site has two or more languages and the model has at least one field with Translatable turned on.
  4. Enter the text in the fields that are shown.

Only Translatable fields appear for a language other than the default. The editor shows "Only translatable fields are shown." followed by the language it falls back to. A translation for a field that is not translatable fails with is not translatable.

Still not working?

Collect the full error text, the list of languages in Settings > Languages, and the request you sent if you use the API. Then see Error codes and messages.

Contact us through the contact form with your Morphic version and the exact error text.