Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
TranslateEditAddons Class Reference

Various editing enhancements to the edit page interface. More...

Static Public Member Functions

static disallowLangTranslations (Title $title, User $user, $action, &$result)
 Prevent translations to non-translatable languages for the group Hook: getUserPermissionsErrorsExpensive.
 
static onSaveComplete (WikiPage $wikiPage, UserIdentity $userIdentity, string $summary, int $flags, RevisionRecord $revisionRecord, EditResult $editResult)
 Runs message checks, adds tp:transver tags and updates statistics.
 
static updateTransverTag (MessageHandle $handle, $revision, $text, User $user)
 Adds tag which identifies the revision of source message at that time.
 
static disablePreSaveTransform (WikiPage $wikiPage, ParserOptions $popts)
 Hook: ArticlePrepareTextForEdit.
 

Static Protected Member Functions

static checkNeedsFuzzy (MessageHandle $handle, $text)
 Returns true if message is fuzzy, OR fails checks OR fails validations (error OR warning).
 
static updateFuzzyTag (Title $title, $revision, $fuzzy)
 

Detailed Description

Various editing enhancements to the edit page interface.

Partly succeeded by the new ajax-enhanced editor but kept for compatibility. Also has code that is still relevant, like the hooks on save.

Definition at line 25 of file TranslateEditAddons.php.

Member Function Documentation

◆ checkNeedsFuzzy()

static TranslateEditAddons::checkNeedsFuzzy ( MessageHandle $handle,
$text )
staticprotected

Returns true if message is fuzzy, OR fails checks OR fails validations (error OR warning).

Parameters
MessageHandle$handle
string$text
Returns
bool

Definition at line 165 of file TranslateEditAddons.php.

◆ disablePreSaveTransform()

static TranslateEditAddons::disablePreSaveTransform ( WikiPage $wikiPage,
ParserOptions $popts )
static

Hook: ArticlePrepareTextForEdit.

Parameters
WikiPage$wikiPage
ParserOptions$popts
Returns
bool

Definition at line 284 of file TranslateEditAddons.php.

◆ disallowLangTranslations()

static TranslateEditAddons::disallowLangTranslations ( Title $title,
User $user,
$action,
& $result )
static

Prevent translations to non-translatable languages for the group Hook: getUserPermissionsErrorsExpensive.

Parameters
Title$title
User$user
string$action
mixed&$result
Returns
bool

Definition at line 36 of file TranslateEditAddons.php.

◆ onSaveComplete()

static TranslateEditAddons::onSaveComplete ( WikiPage $wikiPage,
UserIdentity $userIdentity,
string $summary,
int $flags,
RevisionRecord $revisionRecord,
EditResult $editResult )
static

Runs message checks, adds tp:transver tags and updates statistics.

Hook: PageSaveComplete

Parameters
WikiPage$wikiPage
UserIdentity$userIdentity
string$summary
int$flags
RevisionRecord$revisionRecord
EditResult$editResult
Returns
true

Definition at line 91 of file TranslateEditAddons.php.

◆ updateFuzzyTag()

static TranslateEditAddons::updateFuzzyTag ( Title $title,
$revision,
$fuzzy )
staticprotected
Parameters
Title$title
int$revision
bool$fuzzyWhether to fuzzy or not
Returns
bool Whether status changed

Definition at line 215 of file TranslateEditAddons.php.

◆ updateTransverTag()

static TranslateEditAddons::updateTransverTag ( MessageHandle $handle,
$revision,
$text,
User $user )
static

Adds tag which identifies the revision of source message at that time.

This is used to show diff against current version of source message when updating a translation. Hook: Translate:newTranslation

Parameters
MessageHandle$handle
int$revision
string$text
User$user
Returns
bool

Definition at line 246 of file TranslateEditAddons.php.


The documentation for this class was generated from the following file: