For a guide to PHP hooks, navigate to your root MediaWiki
directory, and then find docs/Hooks.md.
The documentation is part of the hook interfaces.
=== JavaScript hooks ===
JavaScript hooks for the Translate extension use the standard mw.hook API provided
by MediaWiki.
Hooks are prefixed with mw.translate as a convention.
== Events and parameters ==
This is a list of known events and parameters; please add to it if you're going
to add events to the Translate extension.
<!--
Post processing step to format in wiki
^;([^ ]+): >>> ;<nowiki>\1</nowiki>:
-->
=== JavaScript events ===
;mw.translate.editor.afterSubmit: Provides an opportunity to modify a Translate translation form immediately after it is submitted
jQuery form: The form that has just been submitted
;mw.translate.editor.afterEditorShown: Provides an opportunity to manipulate the editing interface once it's shown
jQuery translateEditor.$editor: The current translation-editing form
;mw.translate.editor.beforeSubmit: Provides an opportunity to modify a Translate translation form immediately before it is submitted
jQuery form: The form being submitted
;mw.translate.messagetable.formatMessageBeforeTable: Provides an opportunity to manipulate the display of translation strings (messages) in the main table
object message: The message object, with a range of useful (and manipulable) properties
;mw.translate.editor.showTranslationHelpers: Provides an opportunity to handle custom translation helpers
object result.helpers: JSON subset focusing on the helpers returned e.g. result.helpers.definition
jQuery translateEditor.$editor: The current translation-editing form
;mw.translate.translationView.stateChange: Returns the new state of the group after the state changes (i.e. after the message group or target language changes)
object stateInfo: The new state object, with info on message group, language and message list
;wikipage.content: See this hook in MediaWiki core. Fired for message documentation in the translation editor.