Hosting with 20% off when you buy through the link

Multi-language sites

Serve the site in several languages: one address prefix per language, a tab per language in every editor, and a screen to translate the theme's fixed texts.

A Velk site can answer in several languages. You choose a main language, the default, and add the others in the admin. Each extra language gets its own address prefix (/es, /pt), every editor in the admin gets one tab per language, and the theme's fixed texts — buttons, labels, “Read more” — get a translation screen of their own.

Use it when the same site serves people in more than one language: a hotel with foreign guests, a school with a Spanish program, a company selling across Latin America. It is part of the engine: there is nothing to install.

Ask the AI

Make the Harbor Inn site bilingual. English is the main language, labeled “English”. Spanish comes next, at /es. Prepare every fixed text of the theme (buttons, labels, footer, form messages) for translation and put a language switcher in the header. No need to translate the rooms or the blog posts: the owner will do that in the admin. Run schema:validate at the end and tell me what I need to fill in.

The AI turns languages on in site.json, prepares the theme's texts and builds the switcher. Spanish itself is added on the admin's Languages screen, and the translations are typed in the admin too.

How it is set up

  1. The main language lives in the theme

    The AI turns languages on in site.json with the main language's code and the name visitors see for it (default_label: “English”, “EN”). schema:validate refuses the block without that name. The admin can't change the main language: every untranslated field falls back to it.

  2. Other languages are added in the admin

    Under Settings, open Languages and click “+ New language”: the code (es, pt), the label shown in the switcher, the address prefix (/es), the display order, and whether the language is active on the public site.

  3. The theme's texts are prepared

    The AI wraps each fixed text of the templates in t(), the theme's translation function, written in the main language. i18n:scan registers them on the translation screen.

  4. Switcher and search tags

    Velk doesn't ship a language switcher: the AI builds one in the theme from the active languages. It also adds to every page the hreflang tags, which tell search engines which address is the translation of which.

What the AI runs
$ ./bin/velk schema:validate ✓ site.json is valid. # registers every t() text of the theme on the translation screen $ ./bin/velk i18n:scan
The Scan theme button on the UI translations screen runs the same scan.

Translating content

Once languages are on, every editor — pages, posts and other content, categories and tags, options pages — shows one tab per language at the top. The first tab is the main language; the others repeat the same fields, with the main text shown as a hint. One Save stores every language, and a green dot marks the tabs that already have content.

  • Each tab has its own title, address and fields. The translated address (slug) is typed by hand: Velk doesn't build it from the translated title.
  • A blank field means “not translated” and shows the main language's text. Since v3.9.0 this includes a formatted-text field left empty, which used to print an empty paragraph on the translated page.
  • Required means required once. A required field asks for a value in the main tab only (since v3.7.4).
  • Section addresses are translated with the Translations button of a content list or a category list: /blog can become /es/noticias.
  • New entries keep their tabs. Since v3.9.0, what you type in the other tabs of a new post is stored on its first save.

One address per language

SituationAddress
Main language/about, /blog/my-post — no prefix
Spanish, no Spanish address yet/es/about — the page opens at its main address under the prefix (since v3.9.0; before, a 404)
Spanish address filled in/es/nosotros — and /es/about stops answering, so each page keeps one address per language
Two entries want the same addressThe one whose address was translated keeps it, and a published entry always beats a draft. The admin warns on save and names the entry left without an address in that language (since v3.9.0).

On the site

The switcher takes the visitor to the same page in the other language. The sitemap.xml lists every language of every address. Since v3.9.0 the canonical and hreflang tags no longer repeat the prefix (/es/es/…), and the switcher works on posts and categories nested three levels deep or more. Options pages — footer texts, contact details — have language tabs too, and since v3.9.1 they follow the visitor's language however the theme reads them.

The theme's fixed texts

Texts written in the templates belong to the theme, not to the content. They are translated on the UI translations screen, opened from Languages: one row per text, edited in place, with a filter for what is still pending. The main language always shows the text as the theme wrote it, so you only translate into the extra languages. Since v3.7.8 this holds for English visitors too: before, a theme written in another language showed English visitors its original text, ignoring the registered translation.

The messages of forms and of the members area are words the theme gives to codes Velk sends back, and they can go through this same screen.

Ask the AI

On /es, the “Book now” button in the header and the “Follow us” label in the footer are still in English. Make them translatable and show me where to type the Spanish.

The AI wraps the two texts in t(), runs i18n:scan and points you to their rows on the UI translations screen. A text the theme prints without t() is never translated.

Questions

Does the site pick the visitor's language by itself?

No. Velk doesn't read the browser's language or redirect. The visitor chooses in the switcher, and the hreflang tags help search engines show each person the right version.

Can I take a language off the site?

Yes: untick “Active language” on its screen and it leaves the public site; what was translated stays stored. Deleting the language also keeps the translations in the database, but nothing reaches them anymore.

Do the e-mails follow the language?

Not yet. The e-mails Velk sends to members (password reset, login code) go out in one language, the admin's default, set by ADMIN_LOCALE.

Is the admin's language the same thing?

No. The panel itself speaks English, Portuguese or Spanish, chosen per user, with ADMIN_LOCALE in .env as the default. It changes the admin's buttons, never the site's languages.