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 «Localization»)
  • 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
  • Current language: getCurrentLanguage returns key, cultureKey, name, or http_host; format=json returns a JSON string
  • Fenom modifiers locfield, locoptioncaption, locproductoptionvalue
  • SEO: getLocalizedCanonical, getLocalizedSitemap
  • Indexing of localized fields in mSearch
  • OnBuildLocalizationTabs event for custom form fields
  • Translation overview in the tab: compact list of languages with the active state and the share of filled fields (with no translation — «No translation»)
  • Duplicate a localization from another language (mgr/content/duplicate); shared TVs are not copied
  • Unsaved changes dialog when switching languages (save and switch / discard and switch / stay) and a warning on tab close
  • Batch translation of several languages from the default language
  • Translation status: a badge «Enabled» / «Disabled»; toolbar actions are compact buttons with icons and accessible labels
  • Localizator3 confirmations (including the auto-translation confirmation) use their own dialog group localizator3

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.
  • An installed VueTools below 1.1.2-pl stops the Localizator3 installation: the resolver returns false and the install process is aborted. VueTools 1.1.2-pl or newer is required.
  • The resolver downloads the first pdoTools package if none is installed or the installed version is older than 2.11.3-pl.
  • If downloading VueTools fails, the resolver returns false and the Localizator3 install is aborted.
  • A failed pdoTools download does not abort the install: the resolver returns true anyway.

The tab and the Localization 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 Localization 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 (Localization page).
  2. Set localizator3_default_language.
  3. Enable required TVs with the «TV is 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 needed for direct pdoResources and pdoMenu calls. FetchLocalizator provides 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.