Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
MediaWiki\Extension\Translate\MessageLoading\MessageHandle Class Reference

Class for pointing to messages, like Title class is for titles. More...

Public Member Functions

 __construct (LinkTarget $title)
 
 isMessageNamespace ()
 Check if this handle is in a message namespace.
 
 figureMessage ()
 Recommended to use getCode and getKey instead.
 
 getKey ()
 Returns the identified or guessed message key.
 
 getCode ()
 Returns the language code.
 
 getEffectiveLanguage ()
 Return the Language object for the assumed language of the content, which might be different from the subpage code (qqq, no subpage).
 
 isDoc ()
 Determine whether the current handle is for message documentation.
 
 isPageTranslation ()
 Determine whether the current handle is for page translation feature.
 
 getGroupIds ()
 Returns all message group ids this message belongs to.
 
 getGroup ()
 Get the primary MessageGroup this message belongs to.
 
 isValid ()
 Checks if the handle corresponds to a known message.
 
 getTitle ()
 Get the original title.
 
 getTitleForLanguage (string $languageCode)
 Get the original title with the passed language code.
 
 getTitleForBase ()
 Get the title for the page base.
 
 isFuzzy ()
 Check if a title is marked as fuzzy.
 
 getInternalKey ()
 This returns the key that can be used for showMessage parameter for Special:Translate for regular message groups.
 
 needsFuzzy (string $text)
 Returns true if message is fuzzy, OR fails checks OR fails validations (error OR warning).
 

Static Public Member Functions

static hasFuzzyString (string $text)
 Check if a string contains the fuzzy string.
 
static makeFuzzyString (string $text)
 Check if a string has fuzzy string and if not, add it.
 

Detailed Description

Class for pointing to messages, like Title class is for titles.

Also enhances Title with stuff related to message groups

Author
Niklas Laxström

Definition at line 24 of file MessageHandle.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::__construct ( LinkTarget $title)

Definition at line 32 of file MessageHandle.php.

Member Function Documentation

◆ figureMessage()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::figureMessage ( )

Recommended to use getCode and getKey instead.

Returns
string[] Array of the message key and the language code

Definition at line 49 of file MessageHandle.php.

◆ getCode()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getCode ( )

Returns the language code.

For language codeless source messages will return empty string.

Definition at line 79 of file MessageHandle.php.

◆ getEffectiveLanguage()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getEffectiveLanguage ( )

Return the Language object for the assumed language of the content, which might be different from the subpage code (qqq, no subpage).

Definition at line 89 of file MessageHandle.php.

◆ getGroup()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getGroup ( )

Get the primary MessageGroup this message belongs to.

You should check first that the handle is valid.

Definition at line 135 of file MessageHandle.php.

◆ getGroupIds()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getGroupIds ( )

Returns all message group ids this message belongs to.

The primary message group id is always the first one. If the handle does not correspond to any message, the returned array is empty.

Returns
string[]

Definition at line 123 of file MessageHandle.php.

◆ getInternalKey()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getInternalKey ( )

This returns the key that can be used for showMessage parameter for Special:Translate for regular message groups.

It is not possible to automatically determine this key from the title alone.

Definition at line 244 of file MessageHandle.php.

◆ getKey()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getKey ( )

Returns the identified or guessed message key.

Definition at line 69 of file MessageHandle.php.

◆ getTitle()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getTitle ( )

Get the original title.

Definition at line 183 of file MessageHandle.php.

◆ getTitleForBase()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getTitleForBase ( )

Get the title for the page base.

Definition at line 196 of file MessageHandle.php.

◆ getTitleForLanguage()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::getTitleForLanguage ( string $languageCode)

Get the original title with the passed language code.

Definition at line 188 of file MessageHandle.php.

◆ hasFuzzyString()

static MediaWiki\Extension\Translate\MessageLoading\MessageHandle::hasFuzzyString ( string $text)
static

Check if a string contains the fuzzy string.

Parameters
string$textArbitrary text
Returns
bool If string contains fuzzy string.

Definition at line 208 of file MessageHandle.php.

◆ isDoc()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::isDoc ( )

Determine whether the current handle is for message documentation.

Definition at line 102 of file MessageHandle.php.

◆ isFuzzy()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::isFuzzy ( )

Check if a title is marked as fuzzy.

Definition at line 218 of file MessageHandle.php.

◆ isMessageNamespace()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::isMessageNamespace ( )

Check if this handle is in a message namespace.

Definition at line 38 of file MessageHandle.php.

◆ isPageTranslation()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::isPageTranslation ( )

Determine whether the current handle is for page translation feature.

This does not consider whether the handle corresponds to any message.

Definition at line 112 of file MessageHandle.php.

◆ isValid()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::isValid ( )

Checks if the handle corresponds to a known message.

Definition at line 144 of file MessageHandle.php.

◆ makeFuzzyString()

static MediaWiki\Extension\Translate\MessageLoading\MessageHandle::makeFuzzyString ( string $text)
static

Check if a string has fuzzy string and if not, add it.

Definition at line 213 of file MessageHandle.php.

◆ needsFuzzy()

MediaWiki\Extension\Translate\MessageLoading\MessageHandle::needsFuzzy ( string $text)

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

Definition at line 278 of file MessageHandle.php.


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