Skip to content
  1. Extras
  2. Localizator3

Localizator3 ​

Multilingual sites for MODX Revolution 3 without separate contexts. For MODX 2.x use Localizator.

Features ​

  • Languages in the Localizator3 menu (page title «Localizations»)
  • Localization tab on resources and MiniShop3 products
  • Auto-translation: Yandex, Google, DeepL, LibreTranslate, MyMemory, or copy without translation
  • Selection via getLocalizedResources on top of pdoResources, pdoMenu, msProducts, and ms3Products
  • Fenom modifiers locfield, locoptioncaption, locproductoptionvalue
  • SEO: getLocalizedCanonical, getLocalizedSitemap
  • Indexing of localized fields in mSearch
  • OnBuildLocalizationTabs event for custom form fields

System requirements ​

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

Optional: MiniShop3, mSearch.

Hard transport requirements: PHP and MODX only.

  • If VueTools is missing, the resolver tries to download the first vuetools package from the provider. It does not upgrade an already installed VueTools below 1.1.2-pl.
  • The resolver downloads the first pdoTools package if none is installed or the installed version is older than 2.11.3-pl.
  • A failed VueTools or pdoTools download does not roll back the Localizator3 install.

The tab and the Localizations page show a warning if the vuetools service is down or the built languages.min.js / tab bundle is missing. Without pdoTools, getLocalizedResources cannot find pdoResources.

Dependencies ​

  • pdoTools: resource selection and output
  • VueTools: Vue UI for the tab and the Localizations page

Installation ​

Via ModStore ​

  1. Connect the modstore.pro provider.
  2. Install VueTools 1.1.2-pl+ if it is not installed yet.
  3. Find Localizator3 under Package Management, download and install.
  4. Clear the MODX cache.

Package: modstore.pro/packages/utilities/localizator3.

After install ​

  1. Create languages in the Localizator3 menu (Localizations page).
  2. Set localizator3_default_language.
  3. Enable required TVs with the «TV available in localizations» flag.
  4. Fill the Localization tab on resources.
  5. Output lists with getLocalizedResources.

Quick start and System settings.

Page language ​

The open page language comes from the language http_host, not from localizator3_default_language.

Внимание

An empty key falls back to the first active language by rank only in manager auto-translation and the translate_resources.php CLI. Without the setting and without an active language, auto-translation and CLI stop with an error. On the resource form an empty key stays empty.

Selection on the site ​

getLocalizedResources localizes resource fields itself, without the FetchLocalizator class. FetchLocalizator is for direct pdoResources and pdoMenu calls: the same fields, localized TVs, and the language prefix in links.

The resolver sets pdotools_fetch_class = ModxPro\PdoTools\FetchLocalizator (extends Fetch). Before OnMODXInit, MODX loads the namespace bootstrap.php. The file loads Composer PSR-4 (vendor/autoload.php). The plugin does the same on OnMODXInit.