Skip to content
  1. Extras
  2. Localizator3
  3. Quick start

Quick start ​

Requirements ​

RequirementDescription
MODX Revolution3.0+
PHP8.2+
VueTools1.1.2-pl+
pdoTools2.11.3-pl or newer
Friendly URLsenabled

Step 1: Install ​

  1. Connect the modstore.pro provider.
  2. Install VueTools, then Localizator3.
  3. Manage → Clear Cache.

Step 2: Default language ​

In system settings, set localizator3_default_language to one of your language keys (for example en). An empty value falls back to the first active language by rank. Without the setting and without an active language, manager auto-translation and the translate_resources.php CLI stop with an error.

Step 3: Languages and localizations ​

  1. Open the Localizator3 menu (Localizations page) and create languages:
    • Localization key (ru, en)
    • Name
    • HTTP HOST
    • Language key
    • Active
  2. On the TV form, enable «TV available in localizations» for the fields you need.
  3. On a resource, open the Localization tab, pick a language, and save the localization. The Automatic translation button enables only for an already saved record. Then fill fields or run auto-translation.

URLs like site.example/en/: System settings.

Step 4: Front-end output ​

Resource fields are replaced with localized values. Field content goes to localizator3_content. In Fenom: {$_modx->resource.localizator3_content}.

Output resource lists with getLocalizedResources. The resolver sets pdotools_fetch_class = ModxPro\PdoTools\FetchLocalizator. The class is loaded by the namespace bootstrap, so localized selection via pdoTools works.

fenom
{'!getLocalizedResources' | snippet : [
  'snippet' => 'pdoMenu',
  'parents' => 0,
  'level' => 1,
]}
modx
[[!getLocalizedResources?
  &snippet=`pdoMenu`
  &parents=`0`
  &level=`1`
]]

Language switcher: Language switching. Snippet parameters: getLocalizedResources.

Next steps ​