Skip to content
  1. Extras
  2. Localizator3
  3. Events

Events ​

Resource localizations ​

EventWhenParameters
OnBeforeSaveLocalizationBefore create and updatemode, id, data, localizatorContent (object), object
OnSaveLocalizationAfter create and updatemode (new / upd), id, localizatorContent (object), object. No data or objectType keys
OnBeforeRemoveLocalizationBefore removeid, localizatorContent, object
OnRemoveLocalizationAfter removeid, localizatorContent, object

Languages ​

EventWhenParameters
OnBeforeSaveLocalizatorLanguageBefore create and update of a languagemode, id, data, localizatorLanguage (object), object
OnSaveLocalizatorLanguageAfter create and update of a languagemode (new / upd), id, localizatorLanguage (object), object. No data or objectType keys

Language and resource resolution ​

EventWhenParameters
OnBeforeFindLocalizationBefore language lookup by host and URLlanguage (by reference), http_host, request. A non-empty string from the plugin aborts the lookup. return false does not stop it. Nothing is printed to the page
OnFindLocalizationAfter a lookup attempt, including when no language was foundlanguage, http_host, request. Not fired when OnBeforeFindLocalization aborted or on auto-detect 302 redirect
OnToggleLocalizatorLanguageAfter the current language is appliedlanguage, language_key, http_host, request. On a full page and via the connector (Referer) it fires for every found language. Skip when key and cultureKey are unchanged only for a repeated set via the language parameter or cookie
OnFindLocalizatorResourceWhen resolving a resourceresource (by reference, starts false), request. If the plugin set resource, the built-in findResource() is not called
OnHasLocalizatorError404Before a 404 when localization is missingresource, language_key. Only when localizator3_404_if_no_localization is on, the language key is non-empty, and fields are not taken from the base-language resource

Внимание

Return false from an OnHasLocalizatorError404 handler to skip the error page. The core may still log that the plugin failed.

Localization form ​

EventWhenParameters
OnBuildLocalizationTabsBuilding form tabsDepends on the calling processor

Active Vue tab path (mgr/content/getformconfig). localizatorContent is always null, tabs (by reference), resource, user, customization (by reference with user_id, resource_id, context_key, class_key). You can add fields via tabs and customization if the change lands in $modx->event->returnedValues and the plugin output is empty.

Legacy processor mgr/fields. localizatorContent by reference. tabs and customization not by reference. customization only has user_id and resource_id. After the event the form reads only tabs (via $modx->event->returnedValues['tabs'] when plugin output is empty). customization is not applied to the form.