MediaWiki specific message checks. More...
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. |
MediaWiki specific message checks.
Definition at line 16 of file MediaWikiMessageChecker.php.
static MediaWikiMessageChecker::getPluralFormCount | ( | $ | code | ) | [static] |
Returns the number of plural forms MediaWiki supports for a language.
string | $code Language code |
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.
string | $translation |
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.
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.
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.
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.
TMessage[] | $messages | |
string | $code | |
array | $warnings |
Definition at line 173 of file MediaWikiMessageChecker.php.
static MediaWikiMessageChecker::removeExplicitPluralForms | ( | array $ | forms | ) | [static] |
Imitiates the core plural form handling by removing plural forms that start with 0= or 1=.
array | $forms |
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.
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.
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.
MediaWikiMessageChecker::XhtmlCheck | ( | $ | messages, | |
$ | code, | |||
&$ | warnings | |||
) | [protected] |
Checks if the <br /> and <hr /> tags are using the correct syntax.
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.