Skip to content
Sign in

Languages

The application has English and Czech interface catalogs and translates site metadata, menu entries, and articles independently.

Interface text

Catalogs live in src/Locale/en.php and src/Locale/cs.php. Templates use {t 'key'}. The URL prefix selects Czech at /cs/; the default English URL has no prefix. Add a locale in the application settings and provide its catalog before linking to it.

Database content

Default-language fields remain in cms_sites, cms_menu, and cms_articles. Translation tables contain the other locale. Missing translated values fall back to the default field. Article translations also carry their own content_format, so English Markdown can coexist with Czech legacy HTML during a gradual migration.

After content changes, use the application's normal cache invalidation path. For public production URLs, set i18n.baseUrl to a trusted HTTPS origin so alternate-language links do not depend on an untrusted Host header.

Addresses, links and statistics

With urlPrefix on, a language has its own address prefix: /cs/blog/ is the Czech version of /blog/, and the default language has no prefix. The layout gets the variables lang, locale, alternates (the address of the current page in every language, for the language switcher) and hreflangs (the same as absolute addresses, with x-default). Every page also has one canonical link with the absolute address of the page in its own language. The sitemap lists each language of a page that has a translation, with links to the others. See Search engines.

Pages, menu entries and articles are translated independently, and a page without a translation shows the default language. The API lists the languages that each page, menu entry and article has (translation_locales) and takes translations per language. The assistant of the MCP server uses that to warn when a page, a menu entry or an article lacks a translation for a language of the site.

The statistics record the views of a page per language, and the totals are the sum of all languages (see Statistics).

Live on this request

The language of this request

Switch the language in the header or follow a link below and watch every value change, including the plural forms and the number and date formats.

Detected

Locale
en
Cookie wb_locale
-
Accept-Language
-

Order: URL prefix, cookie, Accept-Language, default.

EN: /docs/languages/CS: /cs/docs/languages/

Plural forms

  • 0 0 files
  • 1 1 file
  • 2 2 files
  • 5 5 files
  • 22 22 files
  • 100 100 files

Numbers, dates and links

{$price|number:2}
1,234,567.89
{$time|ldate:'long'}
November 14, 2026
{$time|ldate:'short'}
11/14/2026
{'/docs/'|lurl}
/docs/