Languages (PRO)
Multilingual without copies of the resource tree and without separate MODX contexts. A language is the context_key of a block, a table row or a resource.
PageBlocks → Constructor → Languages.
A language
| Setting | What it does |
|---|---|
| Key | What goes into context_key. de, for instance. Required |
| Name | How the language is labelled in lists. Required |
| Culture key | The folder in App/lang/ and the code for a translator. Same as the key by default |
| Locale | The system locale, de_DE.UTF-8 |
| URL prefix | The address segment. Empty means the key is used |
| Translator | Who machine-translates — see Translators |
| Settings | JSON, applied as MODX settings for the duration of the request |
| Default | The language with no prefix in the address. There can be only one |
| Active | An inactive language is invisible to the site |
Content is not duplicated
This is the main departure from the usual context-based approach. A row is not copied whole for every language — a translation has its own context_key, and that is all. What has not been translated stays as a single copy and needs no attention.
Per-language settings
The Settings field takes JSON and overrides MODX system settings for the request:
{"site_name": "Comstil", "emailsender": "info@example.com"}So the German version has its own site name and its own mail sender, without a single condition in a template.
The default language never has a prefix
There is one of it, and its addresses are bare: /about, not /en/about. The others live under their prefix. Which means switching the default language changes every canonical address on the site — decide it before launch, not after.