Languages settings
The Languages tab in Settings sets the languages that Morphic stores for the site. Only administrators can open Settings.
Languages tab
| Setting | What it does | Options | Default |
|---|---|---|---|
| Language code (first box) | Sets the key for the language, such as fr or pt-br. Morphic trims it and lowercases it on save. | Two or three letters, optionally followed by - and two to eight letters or digits | Empty for a new row. When nothing is stored, the first language is the site locale's first two letters, lowercased, or en |
| Name (second box) | Sets the label for the language. Morphic cuts it to 60 characters. | Any text | The uppercase code, such as FR |
| Default | Marks the first row as the default language. The default holds the normal field values. | First row only | First row |
| Remove | Removes a row. It does not appear on the first row. | Not available on the first row | Not applicable |
Morphic keeps the first of any rows that share a code and drops the later rows without an error. Rows with an empty code are not saved.
The list needs at least one language and accepts at most 100 languages. Morphic counts languages after it drops duplicates.
Add, change and save languages
The Add language button adds an empty row. Each row has a code box and a name box, and you can edit both. The Save languages button stores the list. Morphic then shows the toast "Languages saved" and redraws the tab with the saved list.
Errors
| Message | Cause | Fix |
|---|---|---|
| language codes look like en, fr or pt-br | A code does not match the code format | Enter a code with two or three letters, optionally followed by - and two to eight letters or digits |
| keep at least one language | The list is empty after empty rows are dropped | Add at least one row with a code |
| at most 100 languages | The list has more than 100 languages after duplicates are dropped | Remove languages until 100 or fewer remain |
Stored values
Morphic stores the list in the morphic_languages option. If nothing is stored, or the stored value is not a list of rows with a text code and name, Morphic uses one language. That language is the first two letters of the site locale, lowercased, with the uppercase code as its name. If the locale gives no letters, the code is en.
After you save the list, Morphic updates the web addresses of its pages on the next page load.