MediaWikiMessageChecker Class Reference
[Message Checkers]

MediaWiki specific message checks. More...

Inheritance diagram for MediaWikiMessageChecker:
Inheritance graph
[legend]
Collaboration diagram for MediaWikiMessageChecker:
Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static getPluralFormCount ($code)
 Returns the number of plural forms MediaWiki supports for a language.
static getPluralForms ($translation)
 Ugly home made probably awfully slow looping parser that parses {{PLURAL}} instances from message and returns array of invokations having array of forms.
static removeExplicitPluralForms (array $forms)
 Imitiates the core plural form handling by removing plural forms that start with 0= or 1=.

Protected Member Functions

 wikiParameterCheck ($messages, $code, &$warnings)
 Checks if the translation uses all variables $[1-9] that the definition uses and vice versa.
 wikiLinksCheck ($messages, $code, &$warnings)
 Checks if the translation uses links that are discouraged.
 XhtmlCheck ($messages, $code, &$warnings)
 Checks if the <br /> and <hr /> tags are using the correct syntax.
 pluralCheck ($messages, $code, &$warnings)
 Checks if the translation doesn't use plural while the definition has one.
 pluralFormsCheck ($messages, $code, &$warnings)
 Checks if the translation uses too many plural forms.
 pagenameMessagesCheck ($messages, $code, &$warnings)
 Checks for page names that they have an untranslated namespace.
 miscMWChecks ($messages, $code, &$warnings)
 Checks for some miscellaneous messages with special syntax.

Detailed Description

MediaWiki specific message checks.

Definition at line 16 of file MediaWikiMessageChecker.php.


Member Function Documentation

static MediaWikiMessageChecker::getPluralFormCount ( code  )  [static]

Returns the number of plural forms MediaWiki supports for a language.

Since:
2012-09-19
Parameters:
string $code Language code
Returns:
int

Definition at line 220 of file MediaWikiMessageChecker.php.

Referenced by pluralFormsCheck().

static MediaWikiMessageChecker::getPluralForms ( translation  )  [static]

Ugly home made probably awfully slow looping parser that parses {{PLURAL}} instances from message and returns array of invokations having array of forms.

Since:
2012-09-19
Parameters:
string $translation
Returns:
array[array]

Definition at line 235 of file MediaWikiMessageChecker.php.

Referenced by pluralFormsCheck(), and MediaWikiMessageCheckerTest::testGetPluralForms().

MediaWikiMessageChecker::miscMWChecks ( messages,
code,
&$  warnings 
) [protected]

Checks for some miscellaneous messages with special syntax.

Parameters:
TMessage[] $messages Iterable list of TMessage objects.
string $code Language code of the translations.
array $warnings Array where warnings are appended to.

Definition at line 330 of file MediaWikiMessageChecker.php.

MediaWikiMessageChecker::pagenameMessagesCheck ( messages,
code,
&$  warnings 
) [protected]

Checks for page names that they have an untranslated namespace.

Parameters:
TMessage[] $messages Iterable list of TMessage objects.
string $code Language code of the translations.
array $warnings Array where warnings are appended to.

Definition at line 303 of file MediaWikiMessageChecker.php.

MediaWikiMessageChecker::pluralCheck ( messages,
code,
&$  warnings 
) [protected]

Checks if the translation doesn't use plural while the definition has one.

Parameters:
TMessage[] $messages Iterable list of TMessage objects.
string $code Language code of the translations.
array $warnings Array where warnings are appended to.

Definition at line 147 of file MediaWikiMessageChecker.php.

MediaWikiMessageChecker::pluralFormsCheck ( messages,
code,
&$  warnings 
) [protected]

Checks if the translation uses too many plural forms.

Parameters:
TMessage[] $messages
string $code
array $warnings
Since:
2012-09-19

Definition at line 173 of file MediaWikiMessageChecker.php.

Here is the call graph for this function:

static MediaWikiMessageChecker::removeExplicitPluralForms ( array $  forms  )  [static]

Imitiates the core plural form handling by removing plural forms that start with 0= or 1=.

Since:
2012-09-19
Parameters:
array $forms
Returns:
array

Definition at line 285 of file MediaWikiMessageChecker.php.

Referenced by pluralFormsCheck(), and MediaWikiMessageCheckerTest::testRemoveExplicitPluralForms().

MediaWikiMessageChecker::wikiLinksCheck ( messages,
code,
&$  warnings 
) [protected]

Checks if the translation uses links that are discouraged.

Valid links are those that link to Special: or {{ns:special}}: or project pages trough MediaWiki messages like {{MediaWiki:helppage-url}}:. Also links in the definition are allowed.

Parameters:
TMessage[] $messages Iterable list of TMessage objects.
string $code Language code of the translations.
array $warnings Array where warnings are appended to.

Definition at line 39 of file MediaWikiMessageChecker.php.

MediaWikiMessageChecker::wikiParameterCheck ( messages,
code,
&$  warnings 
) [protected]

Checks if the translation uses all variables $[1-9] that the definition uses and vice versa.

Parameters:
TMessage[] $messages Iterable list of TMessage objects.
string $code Language code of the translations.
array $warnings Array where warnings are appended to.

Definition at line 25 of file MediaWikiMessageChecker.php.

Here is the call graph for this function:

MediaWikiMessageChecker::XhtmlCheck ( messages,
code,
&$  warnings 
) [protected]

Checks if the <br /> and <hr /> tags are using the correct syntax.

Parameters:
TMessage[] $messages Iterable list of TMessage objects.
string $code Language code of the translations.
array $warnings Array where warnings are appended to.

Definition at line 102 of file MediaWikiMessageChecker.php.


The documentation for this class was generated from the following file:
Generated on Tue Oct 29 00:00:48 2013 for MediaWiki Translate Extension by  doxygen 1.6.3