Publish a post in more than one language

v0.0.1

A post can exist in several languages. Each translation is a post of its own, with its own slug and content, and all of them share one language group. Readers switch language in the header's language dropdown, which offers each published edition of the post, and search engines get the alternate addresses. This guide adds a translation to an existing post. Collections and tags work the same way.

Before you begin

  • Write the original post first. It can be in any language.
  • Sign in with an account that holds admin:dashboard:blog:post.
  • Add the new language code under Settings, then Languages. The language field warns that a code missing there makes its address answer 404.

Add the translation

  1. Open the Blog Posts Management page and click Add Post.
  2. In Language, enter the code of the new language, such as fa. The field suggests the codes your posts already use.
  3. In Language Group, search for the original post and choose it. Each option reads as the title followed by the language in parentheses. The default option, New Language Group (auto-generate), starts a separate group instead.
  4. Enter the translated Title and Content. Give the translation a slug that no other post on the site uses.
  5. Click Create.

The form refuses a second post in the same language and group with A blog post with this language already exists in this language group. It refuses a repeated slug with Blog post slug must be unique within a site. The group you pick must belong to the same site.

Move between editions

The Posts page lists one row for each document, which is the original. Under each card, a Languages row shows one chip per edition, such as EN and FA. Click a chip to open that edition in the edit form. When there are more editions than fit, a button such as +2 shows the rest.

a post card with a Languages row holding the EN and FA chips under its statistics

Each chip opens one edition.

A search lists every edition, not only originals, so you can find a translation by its own words. The Archived view also lists every edition.

What readers see

  • A post page answers only for a post written in the page's language. The address /fa/blog/<english-slug> finds nothing instead of showing the English article on a Persian page.
  • The header's language dropdown offers each published edition of the post at its own address and slug. Picking one swaps the page without a reload. See Changing language without a reload.
  • The dropdown leaves out an edition the reader cannot open, such as one locked to a permission the reader does not hold, so that reader never sees its address or title. It lists only languages the site publishes in, in the site's order, and it is hidden when fewer than two editions remain.
  • The page's head lists an alternate address for each of those editions, and marks the edition in the site's primary language as x-default when the post has one. Each edition other than the one being read also gets an og:locale:alternate tag.
  • Lists of posts show one edition of each document by default. Set the block's language to a code to list that language only, or to all to list every edition.

Bloggers and teams are one record in every language, so their pages offer each language the site publishes in at the same slug. Only posts, collections and tags have editions.

Archive an original

You cannot archive or delete forever an original whose translations are still live. The page shows an alert instead, with a button that archives, or deletes for good, those translations at once. Restoring a translation is refused while its original is archived.

Next steps