SHADE is young: 0.1.0-next.2 is a pre-release, and 0.1.0 isn't out yet.

SHADE
Content

Languages

SHADE has two separate kinds of language. Content languages are the languages of the client's website: a site has one default language and any number of other languages, every page exists in all of them, and the team translates the text while the layout stays the same. Admin languages are the languages of the admin screens themselves: Dutch and English, chosen by each editor. The two are independent: a Dutch-speaking editor can work in a Dutch admin on a site whose content is in Dutch, English and German.

Most of this page is about content languages. The admin languages are covered in their own section at the end.

What users can do

Admins (site settings):

  • Choose the site's default language when the site is set up. It is the language of the addresses without a prefix (/about). It is fixed once there is content, also when the first entry is being saved at the moment the default language is changed: the change waits for it and is then refused.
  • Add other languages (up to 20), each by code: nl, en, de, or with a region, nl-BE.
  • Keep a new language Being prepared (hidden): the team can translate, visitors do not see it. Switch it to Visible to put it on the website.
  • Remove a language.
  • The languages, and each language's own site name and SEO defaults, are saved whole. When another admin saved them after your Settings screen was loaded, the save is refused and nothing is lost: the form shows "Someone else changed this meanwhile" with Reload, which loads it as it is now (what was changed in the form goes). So a language added meanwhile is never dropped.

Editors:

  • Switch the page editor or the entry editor to another language and write the text in that language.
  • See which text is not translated yet: a warning with the count, and a "Not translated yet" hint per field.
  • With the editorial module: see which translated text is out of date, because its default-language text changed after the translation was saved. Update the translation, or mark it as done when it still fits.
  • Translate a page's texts, title, slug, SEO title and meta description, and the translatable fields of any collection entry (posts, navigation, footer, forms, module collections).
  • Write image alt text per language in the media library.
  • Preview a draft in any language, including one that is being prepared.
  • Open the version history in the language being edited; restoring a version restores every language.

Visitors:

  • Read every page in each visible language at its own address (/en/about-us).
  • Switch language in the site header, landing on the same page in the other language.
  • See the default language's text wherever a text is not translated yet.

Who may do it

ActionPermissionRoles
Change the site's languages (Settings)settings.updateadmin
Read the site's languages (language switches)content.readadmin, editor, ai
Read an entry or page in another languagecollections.<slug>.readadmin; editor unless the collection limits it
Save the text of another languagecollections.<slug>.update (pages: collections.website-pages.update)admin; editor unless the collection limits it (pages: also ai)
Mark an out-of-date translation as done (editorial module)collections.<slug>.updateadmin; editor unless the collection limits it
Publish (all languages together)collections.website-pages.publish / collections.<slug>.publishadmin, editor
Alt text per languagemedia.updateadmin, editor, ai (ai: alt text only)
Preview link in a languagecontent.read + collections.website-pages.readadmin, editor, ai
Admin language (user menu)none (personal, kept in the browser)everyone signed in

AI assistants read and translate a page's texts in another language and set an image's alt text in one; their tools for other collections work in the default language.

In the admin

Settings → Languages (sidebar Settings, admin only). The card explains: "Every page exists in every language. Text that is not translated yet shows in the default language."

  • Default language: a code field with the language's name next to it. Help text: "The language of the website without a prefix (/about). Fixed once there is content."
  • Other languages: one row per language with a Language code field, a switch labelled Visible or Being prepared, and a Remove language button. Add language adds a row that starts hidden. With no other languages the card says "Only the default language."
  • Language names ("Nederlands", "English (United Kingdom)") come from the browser, in the admin's own language.
  • After saving, every language switch in the admin shows the new list.
  • Each other language also has a card for its site name, SEO title template and default description; empty fields use the default language's. The default social image is the same in every language.

Website editor (pages). The structure of a page is the same in every language; each text holds its words per language, written in the editor in the language chosen, and a text without words in a language shows the default language's there (see Pages and posts). Page settings give the title, slug, item address (for an item template), SEO title and meta description per language, each marked "not translated" while it still shows the default text. The live preview and the Preview link show the draft in that language, and the version history loads versions in it.

Entry editor. For saved entries of collections with translatable fields, on a site with other languages, a Language select appears in the header. The chosen language is in the address bar (?language=en); switching with unsaved changes asks for confirmation first. The same warnings and locks apply: repeater items can't be added, moved or removed, and non-text fields are locked. Save draft saves only that language's text. Rich text is translated in its own field. The list screens always show the default language.

Out-of-date translations are the editorial module's. When the default language's text of a translated field changes, that field's translation is out of date in every language that has one. The editor's sidebar panel Out-of-date translations lists the fields out of date per language, each with Mark as done, which keeps the translation as it is. Changing the translation and saving clears the field too. A chip in the editor's status row counts the languages out of date, and the collection's list has a Translations column with a filter Out of date. There is no hint on the field itself. Fields the role may not see are left out, and a field it may only read can't be marked as done.

Media detail (media library). For images, one extra field per other language (hidden ones too): "Alt text (English)", with the help "Empty: the Dutch alt text is used." Documents (PDFs) have no alt text.

On the website

  • Addresses. The default language lives at /<slug> (home page /), each visible other language at /<code>/<slug> (home page /<code>). Item pages (posts) follow the same rule: /en/<item address>/<slug>.
  • Slugs. A page's slug in a language is its translated slug, or the default slug when there is none. If a fallback slug collides with another page's translated slug in that language, the translated one wins and the other page is left out of that language. Publishing refuses a translated slug that another published page already has in that language.
  • Text. Untranslated text and alt text show the default language.
  • Links. Links to pages and item pages in content, navigation and footer point to their address in the current language. A link to a page that is not public in that language is left out, and the site hides it.
  • Header. When the site has more than one visible language, the header shows a language switch with each language's own name ("English", "Deutsch"). Each item links to the current page in that language, or to that language's home page if the page is not public there.
  • Language switcher. The Language switcher starter component puts one anywhere on a page (the page's other languages by their code in capitals, NL, EN, each with its name in its own language on hover and for screen readers).
  • Search engines. Each page tells search engines its language and links to its versions in every visible language, with the default language's as the fallback. The sitemap has one part per visible language, each listing that language's indexable pages with links to their translations.
  • Site search only searches the visitor's language, both a static site's own search and the API's search.
  • Data sources and forms are read in the page's language: item text, item addresses and form labels.
  • The 404 and account pages exist per visible language (/en/404/, /en/account), and user account emails follow the language of the page the user came from.
  • Hidden languages are not on the site. Preview links can still show them, kept out of search engines.
  • Renamed translated slugs get automatic redirects in their language (/en/about-us → /en/about), see Redirects.

Texts SHADE writes for visitors

Most of what visitors read is your content. A few texts are SHADE's own: the messages around a form, a booking, the shop and the account pages, the line under a mailing list's email, and the page a link that no longer works opens. SHADE and its modules ship these in English and Dutch. On a site in another language, say German, we show them in the site's default language when it is one of those two, and in English when it is not, until someone adds a German translation. Nothing breaks and nothing shows a missing key, but a German visitor will read English in these places, so it is worth adding the translation before you rely on them.

Rules and limits

  • Codes: two or three lowercase letters, optionally a dash and two capital letters for the region (nl-BE). Each language at most once, including the default. At most 20 other languages. The code is also the address prefix.
  • Default language: it cannot be changed once any collection has an entry, because every stored text is in it. Adding, hiding and removing other languages is always allowed.
  • Which fields are translatable. Each field type has a default: text, textarea, rich text and slug are translatable; a tree keeps every language in its texts. Number, date, toggle, select, relation, image, file, link, url and email are not. A developer can change this per field. Groups and repeaters are structure: their members decide. A page's item template choice is not translatable. Buttons keep their label in a text field (translatable) and their target in a link field (shared).
  • Structure is the default language's. Saving another language changes only translatable text. Reordering repeater items in the default language keeps their translations; removing an item removes them.
  • Untouched fallbacks are not copied. Text that shows the default language keeps falling back instead of being saved as a copy. An empty value means "fall back".
  • Required fields apply to the default language only. Field rules (max length, slug format) apply to every language.
  • Unique fields: a translated slug is unique per language. A clash gives "Another page already uses this slug".
  • "Missing" means a translatable text that has a value in the default language but none in this one. Empty default text is not missing.
  • "Out of date" (editorial module) means a translated text whose default-language text changed after the translation was last saved or marked as done. Text that isn't translated is missing, never out of date. It is per field and per language; a repeater item's text keeps its state when the items are reordered, and loses it with the item. Restoring a version counts as a save: a default-language text that changes with it leaves its translation out of date, unless the translation changed too. Marking as done is audited as "Marked the en text of … as done". The state is kept while an entry is in the trash and goes when it is deleted forever. Only saves through SHADE count: a module that writes its collection's tables itself doesn't change it.
  • Versions. Every save, in any language, makes a version holding every language's text. Saving another language is noted "Translated (en)" and audited as "Saved the en text of …". Publishing publishes all languages together, and a restore brings back every language of that version.
  • Unknown or hidden codes. A code that is not one of the site's languages is refused; the site never shows hidden or unknown languages.
  • Alt text: max 300 characters per language. An empty value removes that language's alt text. Unknown codes are refused. Changing alt text in any language rebuilds the site when the image is used by published content.
  • Settings changes to languages rebuild the site, like other settings changes.
  • Lists use the default language. Filtering and sorting in the admin lists and on the site use the default language's text; search looks in the language asked for, the default one in the admin's lists. Missing alt text in the media library counts every language.
  • Removing a language keeps its text. Re-adding the language brings it back, also after the page was edited in the default language meanwhile.

For developers

The code and its tests: shade/features/entries/README.md in the shade repository.

Visitor texts are one <language>.json file per language: SHADE's in shade/locales and each module's in the locales folder of the module. A new language is one more file with the same keys, named by its code (de.json, nl-BE.json); no code names a language. A key missing from a file falls back to the site's default language, then to English.

Admin languages (Dutch and English)

The admin interface is available in English and Dutch. This is unrelated to the site's content languages.

  • Choosing: the admin uses the editor's saved choice (kept for a year), else the first browser language the admin has, else English.
  • Switching: the user menu has Language with English and Nederlands. The choice is per browser, not stored on the user account.
  • The admin's own texts, dates, language names and form messages follow the admin language. A field left empty says Required (Verplicht) and a value of the wrong kind Not a valid value. Forms check a field once it changes (and while typing after that) and on submit, never for only focusing and leaving it.
  • Messages that come from the server (validation and conflict errors) are shown in the admin's language too.