2007-01-09 03:40:11 +00:00
|
|
|
<?php
|
2010-12-16 19:15:12 +00:00
|
|
|
/**
|
|
|
|
|
* Helper class for checkLanguage.php script.
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup MaintenanceLanguage
|
|
|
|
|
*/
|
2010-04-09 17:21:52 +00:00
|
|
|
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
/**
|
|
|
|
|
* @ingroup MaintenanceLanguage
|
|
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
class CheckLanguageCLI {
|
|
|
|
|
protected $code = null;
|
|
|
|
|
protected $level = 2;
|
|
|
|
|
protected $doLinks = false;
|
2009-12-27 14:59:27 +00:00
|
|
|
protected $linksPrefix = '';
|
2008-05-09 14:16:59 +00:00
|
|
|
protected $wikiCode = 'en';
|
|
|
|
|
protected $checkAll = false;
|
|
|
|
|
protected $output = 'plain';
|
|
|
|
|
protected $checks = array();
|
|
|
|
|
protected $L = null;
|
|
|
|
|
|
|
|
|
|
protected $results = array();
|
|
|
|
|
|
|
|
|
|
private $includeExif = false;
|
|
|
|
|
|
|
|
|
|
/**
|
2008-10-21 09:29:47 +00:00
|
|
|
* Constructor.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @param $options array Options for script.
|
2008-05-09 14:16:59 +00:00
|
|
|
*/
|
|
|
|
|
public function __construct( Array $options ) {
|
|
|
|
|
if ( isset( $options['help'] ) ) {
|
|
|
|
|
echo $this->help();
|
2009-04-06 14:41:33 +00:00
|
|
|
exit(1);
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['lang'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->code = $options['lang'];
|
|
|
|
|
} else {
|
|
|
|
|
global $wgLanguageCode;
|
|
|
|
|
$this->code = $wgLanguageCode;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['level'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->level = $options['level'];
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
$this->doLinks = isset( $options['links'] );
|
|
|
|
|
$this->includeExif = !isset( $options['noexif'] );
|
|
|
|
|
$this->checkAll = isset( $options['all'] );
|
2008-05-09 14:16:59 +00:00
|
|
|
|
2009-12-27 14:59:27 +00:00
|
|
|
if ( isset( $options['prefix'] ) ) {
|
|
|
|
|
$this->linksPrefix = $options['prefix'];
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['wikilang'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->wikiCode = $options['wikilang'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $options['whitelist'] ) ) {
|
|
|
|
|
$this->checks = explode( ',', $options['whitelist'] );
|
|
|
|
|
} elseif ( isset( $options['blacklist'] ) ) {
|
|
|
|
|
$this->checks = array_diff(
|
2008-10-25 17:35:26 +00:00
|
|
|
isset( $options['easy'] ) ? $this->easyChecks() : $this->defaultChecks(),
|
2008-05-09 14:16:59 +00:00
|
|
|
explode( ',', $options['blacklist'] )
|
|
|
|
|
);
|
2008-10-25 17:35:26 +00:00
|
|
|
} elseif ( isset( $options['easy'] ) ) {
|
|
|
|
|
$this->checks = $this->easyChecks();
|
2008-05-09 14:16:59 +00:00
|
|
|
} else {
|
2008-10-21 09:29:47 +00:00
|
|
|
$this->checks = $this->defaultChecks();
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['output'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->output = $options['output'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->L = new languages( $this->includeExif );
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get the default checks.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array A list of the default checks.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
|
|
|
|
protected function defaultChecks() {
|
|
|
|
|
return array(
|
|
|
|
|
'untranslated', 'duplicate', 'obsolete', 'variables', 'empty', 'plural',
|
|
|
|
|
'whitespace', 'xhtml', 'chars', 'links', 'unbalanced', 'namespace',
|
2008-12-25 18:00:26 +00:00
|
|
|
'projecttalk', 'magic', 'magic-old', 'magic-over', 'magic-case',
|
2008-10-25 17:24:37 +00:00
|
|
|
'special', 'special-old',
|
2008-10-21 09:29:47 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2008-10-25 17:35:26 +00:00
|
|
|
* Get the checks which check other things than messages.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array A list of the non-message checks.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
|
|
|
|
protected function nonMessageChecks() {
|
|
|
|
|
return array(
|
2008-12-25 18:00:26 +00:00
|
|
|
'namespace', 'projecttalk', 'magic', 'magic-old', 'magic-over',
|
2008-10-25 17:24:37 +00:00
|
|
|
'magic-case', 'special', 'special-old',
|
2008-10-21 09:29:47 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
/**
|
|
|
|
|
* Get the checks that can easily be treated by non-speakers of the language.
|
2011-03-30 19:00:11 +00:00
|
|
|
* @return Array A list of the easy checks.
|
2008-10-25 17:35:26 +00:00
|
|
|
*/
|
|
|
|
|
protected function easyChecks() {
|
|
|
|
|
return array(
|
|
|
|
|
'duplicate', 'obsolete', 'empty', 'whitespace', 'xhtml', 'chars', 'magic-old',
|
|
|
|
|
'magic-over', 'magic-case', 'special-old',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get all checks.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array An array of all check names mapped to their function names.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function getChecks() {
|
2008-10-21 09:29:47 +00:00
|
|
|
return array(
|
|
|
|
|
'untranslated' => 'getUntranslatedMessages',
|
|
|
|
|
'duplicate' => 'getDuplicateMessages',
|
|
|
|
|
'obsolete' => 'getObsoleteMessages',
|
2009-02-21 10:18:45 +00:00
|
|
|
'variables' => 'getMessagesWithMismatchVariables',
|
2008-10-21 09:29:47 +00:00
|
|
|
'plural' => 'getMessagesWithoutPlural',
|
|
|
|
|
'empty' => 'getEmptyMessages',
|
|
|
|
|
'whitespace' => 'getMessagesWithWhitespace',
|
|
|
|
|
'xhtml' => 'getNonXHTMLMessages',
|
|
|
|
|
'chars' => 'getMessagesWithWrongChars',
|
|
|
|
|
'links' => 'getMessagesWithDubiousLinks',
|
|
|
|
|
'unbalanced' => 'getMessagesWithUnbalanced',
|
|
|
|
|
'namespace' => 'getUntranslatedNamespaces',
|
|
|
|
|
'projecttalk' => 'getProblematicProjectTalks',
|
|
|
|
|
'magic' => 'getUntranslatedMagicWords',
|
2008-10-25 17:24:37 +00:00
|
|
|
'magic-old' => 'getObsoleteMagicWords',
|
2008-10-21 09:29:47 +00:00
|
|
|
'magic-over' => 'getOverridingMagicWords',
|
|
|
|
|
'magic-case' => 'getCaseMismatchMagicWords',
|
|
|
|
|
'special' => 'getUntraslatedSpecialPages',
|
2008-10-25 17:24:37 +00:00
|
|
|
'special-old' => 'getObsoleteSpecialPages',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get total count for each check non-messages check.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array An array of all check names mapped to a two-element array:
|
2008-10-25 17:24:37 +00:00
|
|
|
* function name to get the total count and language code or null
|
|
|
|
|
* for checked code.
|
|
|
|
|
*/
|
|
|
|
|
protected function getTotalCount() {
|
|
|
|
|
return array(
|
|
|
|
|
'namespace' => array( 'getNamespaceNames', 'en' ),
|
|
|
|
|
'projecttalk' => null,
|
|
|
|
|
'magic' => array( 'getMagicWords', 'en' ),
|
|
|
|
|
'magic-old' => array( 'getMagicWords', null ),
|
|
|
|
|
'magic-over' => array( 'getMagicWords', null ),
|
|
|
|
|
'magic-case' => array( 'getMagicWords', null ),
|
|
|
|
|
'special' => array( 'getSpecialPageAliases', 'en' ),
|
|
|
|
|
'special-old' => array( 'getSpecialPageAliases', null ),
|
2008-10-21 09:29:47 +00:00
|
|
|
);
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get all check descriptions.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array An array of all check names mapped to their descriptions.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function getDescriptions() {
|
2008-10-21 09:29:47 +00:00
|
|
|
return array(
|
|
|
|
|
'untranslated' => '$1 message(s) of $2 are not translated to $3, but exist in en:',
|
|
|
|
|
'duplicate' => '$1 message(s) of $2 are translated the same in en and $3:',
|
|
|
|
|
'obsolete' => '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:',
|
2009-02-21 10:18:45 +00:00
|
|
|
'variables' => '$1 message(s) of $2 in $3 don\'t match the variables used in en:',
|
2008-10-21 09:29:47 +00:00
|
|
|
'plural' => '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:',
|
|
|
|
|
'empty' => '$1 message(s) of $2 in $3 are empty or -:',
|
|
|
|
|
'whitespace' => '$1 message(s) of $2 in $3 have trailing whitespace:',
|
|
|
|
|
'xhtml' => '$1 message(s) of $2 in $3 contain illegal XHTML:',
|
|
|
|
|
'chars' => '$1 message(s) of $2 in $3 include hidden chars which should not be used in the messages:',
|
|
|
|
|
'links' => '$1 message(s) of $2 in $3 have problematic link(s):',
|
|
|
|
|
'unbalanced' => '$1 message(s) of $2 in $3 have unbalanced {[]}:',
|
|
|
|
|
'namespace' => '$1 namespace name(s) of $2 are not translated to $3, but exist in en:',
|
|
|
|
|
'projecttalk' => '$1 namespace name(s) and alias(es) in $3 are project talk namespaces without the parameter:',
|
|
|
|
|
'magic' => '$1 magic word(s) of $2 are not translated to $3, but exist in en:',
|
2008-10-25 17:24:37 +00:00
|
|
|
'magic-old' => '$1 magic word(s) of $2 do not exist in en, but exist in $3:',
|
2008-10-21 09:29:47 +00:00
|
|
|
'magic-over' => '$1 magic word(s) of $2 in $3 do not contain the original en word(s):',
|
|
|
|
|
'magic-case' => '$1 magic word(s) of $2 in $3 change the case-sensitivity of the original en word:',
|
|
|
|
|
'special' => '$1 special page alias(es) of $2 are not translated to $3, but exist in en:',
|
2008-10-25 17:24:37 +00:00
|
|
|
'special-old' => '$1 special page alias(es) of $2 do not exist in en, but exist in $3:',
|
2008-10-21 09:29:47 +00:00
|
|
|
);
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get help.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return string The help string.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function help() {
|
|
|
|
|
return <<<ENDS
|
|
|
|
|
Run this script to check a specific language file, or all of them.
|
|
|
|
|
Command line settings are in form --parameter[=value].
|
|
|
|
|
Parameters:
|
2010-04-09 17:21:52 +00:00
|
|
|
--help: Show this help.
|
|
|
|
|
--lang: Language code (default: the installation default language).
|
|
|
|
|
--all: Check all customized languages.
|
|
|
|
|
--level: Show the following display level (default: 2):
|
|
|
|
|
* 0: Skip the checks (useful for checking syntax).
|
|
|
|
|
* 1: Show only the stub headers and number of wrong messages, without list of messages.
|
|
|
|
|
* 2: Show only the headers and the message keys, without the message values.
|
|
|
|
|
* 3: Show both the headers and the complete messages, with both keys and values.
|
|
|
|
|
--links: Link the message values (default off).
|
|
|
|
|
--prefix: prefix to add to links.
|
|
|
|
|
--wikilang: For the links, what is the content language of the wiki to display the output in (default en).
|
2012-02-20 09:57:56 +00:00
|
|
|
--noexif: Do not check for EXIF messages (a bit hard and boring to translate), if you know
|
2010-04-09 17:21:52 +00:00
|
|
|
that they are currently not translated and want to focus on other problems (default off).
|
|
|
|
|
--whitelist: Do only the following checks (form: code,code).
|
2012-02-20 09:57:56 +00:00
|
|
|
--blacklist: Do not do the following checks (form: code,code).
|
2010-04-09 17:21:52 +00:00
|
|
|
--easy: Do only the easy checks, which can be treated by non-speakers of the language.
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
Check codes (ideally, all of them should result 0; all the checks are executed by default (except language-specific check blacklists in checkLanguage.inc):
|
2008-05-09 14:16:59 +00:00
|
|
|
* untranslated: Messages which are required to translate, but are not translated.
|
|
|
|
|
* duplicate: Messages which translation equal to fallback
|
2008-10-25 17:24:37 +00:00
|
|
|
* obsolete: Messages which are untranslatable or do not exist, but are translated.
|
2012-02-20 09:57:56 +00:00
|
|
|
* variables: Messages without variables which should be used, or with variables which should not be used.
|
2008-10-21 09:29:47 +00:00
|
|
|
* empty: Empty messages and messages that contain only -.
|
2008-05-09 14:16:59 +00:00
|
|
|
* whitespace: Messages which have trailing whitespace.
|
|
|
|
|
* xhtml: Messages which are not well-formed XHTML (checks only few common errors).
|
|
|
|
|
* chars: Messages with hidden characters.
|
|
|
|
|
* links: Messages which contains broken links to pages (does not find all).
|
|
|
|
|
* unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
|
2008-10-21 09:29:47 +00:00
|
|
|
* namespace: Namespace names that were not translated.
|
|
|
|
|
* projecttalk: Namespace names and aliases where the project talk does not contain $1.
|
|
|
|
|
* magic: Magic words that were not translated.
|
2008-10-25 17:24:37 +00:00
|
|
|
* magic-old: Magic words which do not exist.
|
2008-10-21 09:29:47 +00:00
|
|
|
* magic-over: Magic words that override the original English word.
|
|
|
|
|
* magic-case: Magic words whose translation changes the case-sensitivity of the original English word.
|
|
|
|
|
* special: Special page names that were not translated.
|
2008-10-25 17:24:37 +00:00
|
|
|
* special-old: Special page names which do not exist.
|
2008-05-09 14:16:59 +00:00
|
|
|
|
|
|
|
|
ENDS;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Execute the script.
|
|
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
public function execute() {
|
|
|
|
|
$this->doChecks();
|
|
|
|
|
if ( $this->level > 0 ) {
|
2008-10-21 09:29:47 +00:00
|
|
|
switch ( $this->output ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
case 'plain':
|
|
|
|
|
$this->outputText();
|
|
|
|
|
break;
|
|
|
|
|
case 'wiki':
|
|
|
|
|
$this->outputWiki();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2008-10-21 09:29:47 +00:00
|
|
|
throw new MWException( "Invalid output type $this->output" );
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Execute the checks.
|
|
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function doChecks() {
|
|
|
|
|
$ignoredCodes = array( 'en', 'enRTL' );
|
|
|
|
|
|
|
|
|
|
$this->results = array();
|
|
|
|
|
# Check the language
|
|
|
|
|
if ( $this->checkAll ) {
|
|
|
|
|
foreach ( $this->L->getLanguages() as $language ) {
|
2008-10-21 09:29:47 +00:00
|
|
|
if ( !in_array( $language, $ignoredCodes ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->results[$language] = $this->checkLanguage( $language );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2008-10-21 09:29:47 +00:00
|
|
|
if ( in_array( $this->code, $ignoredCodes ) ) {
|
|
|
|
|
throw new MWException( "Cannot check code $this->code." );
|
2008-05-09 14:16:59 +00:00
|
|
|
} else {
|
|
|
|
|
$this->results[$this->code] = $this->checkLanguage( $this->code );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get the check blacklist.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array The list of checks which should not be executed.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function getCheckBlacklist() {
|
|
|
|
|
global $checkBlacklist;
|
|
|
|
|
return $checkBlacklist;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Check a language.
|
2011-10-14 21:19:25 +00:00
|
|
|
* @param $code string The language code.
|
|
|
|
|
* @return array The results.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function checkLanguage( $code ) {
|
|
|
|
|
# Syntax check only
|
2011-10-14 21:19:25 +00:00
|
|
|
$results = array();
|
2008-05-09 14:16:59 +00:00
|
|
|
if ( $this->level === 0 ) {
|
|
|
|
|
$this->L->getMessages( $code );
|
2011-10-14 21:19:25 +00:00
|
|
|
return $results;
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$checkFunctions = $this->getChecks();
|
|
|
|
|
$checkBlacklist = $this->getCheckBlacklist();
|
|
|
|
|
foreach ( $this->checks as $check ) {
|
2008-10-21 09:29:47 +00:00
|
|
|
if ( isset( $checkBlacklist[$code] ) &&
|
|
|
|
|
in_array( $check, $checkBlacklist[$code] ) ) {
|
2009-12-27 17:08:33 +00:00
|
|
|
$results[$check] = array();
|
2008-05-09 14:16:59 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$callback = array( $this->L, $checkFunctions[$check] );
|
2008-10-21 09:29:47 +00:00
|
|
|
if ( !is_callable( $callback ) ) {
|
2008-10-21 09:34:01 +00:00
|
|
|
throw new MWException( "Unkown check $check." );
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
2008-10-25 17:24:37 +00:00
|
|
|
$results[$check] = call_user_func( $callback, $code );
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $results;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Format a message key.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @param $key string The message key.
|
|
|
|
|
* @param $code string The language code.
|
|
|
|
|
* @return string The formatted message key.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function formatKey( $key, $code ) {
|
|
|
|
|
if ( $this->doLinks ) {
|
|
|
|
|
$displayKey = ucfirst( $key );
|
|
|
|
|
if ( $code == $this->wikiCode ) {
|
2009-12-27 14:59:27 +00:00
|
|
|
return "[[{$this->linksPrefix}MediaWiki:$displayKey|$key]]";
|
2008-05-09 14:16:59 +00:00
|
|
|
} else {
|
2009-12-27 14:59:27 +00:00
|
|
|
return "[[{$this->linksPrefix}MediaWiki:$displayKey/$code|$key]]";
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return $key;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Output the checks results as plain text.
|
|
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function outputText() {
|
|
|
|
|
foreach ( $this->results as $code => $results ) {
|
|
|
|
|
$translated = $this->L->getMessages( $code );
|
|
|
|
|
$translated = count( $translated['translated'] );
|
|
|
|
|
foreach ( $results as $check => $messages ) {
|
|
|
|
|
$count = count( $messages );
|
|
|
|
|
if ( $count ) {
|
2008-10-25 17:24:37 +00:00
|
|
|
if ( $check == 'untranslated' ) {
|
|
|
|
|
$translatable = $this->L->getGeneralMessages();
|
|
|
|
|
$total = count( $translatable['translatable'] );
|
|
|
|
|
} elseif ( in_array( $check, $this->nonMessageChecks() ) ) {
|
|
|
|
|
$totalCount = $this->getTotalCount();
|
|
|
|
|
$totalCount = $totalCount[$check];
|
|
|
|
|
$callback = array( $this->L, $totalCount[0] );
|
|
|
|
|
$callCode = $totalCount[1] ? $totalCount[1] : $code;
|
|
|
|
|
$total = count( call_user_func( $callback, $callCode ) );
|
|
|
|
|
} else {
|
|
|
|
|
$total = $translated;
|
2008-10-21 09:29:47 +00:00
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
$search = array( '$1', '$2', '$3' );
|
2008-10-21 09:29:47 +00:00
|
|
|
$replace = array( $count, $total, $code );
|
2008-05-09 14:16:59 +00:00
|
|
|
$descriptions = $this->getDescriptions();
|
|
|
|
|
echo "\n" . str_replace( $search, $replace, $descriptions[$check] ) . "\n";
|
|
|
|
|
if ( $this->level == 1 ) {
|
|
|
|
|
echo "[messages are hidden]\n";
|
|
|
|
|
} else {
|
|
|
|
|
foreach ( $messages as $key => $value ) {
|
2008-10-21 09:29:47 +00:00
|
|
|
if( !in_array( $check, $this->nonMessageChecks() ) ) {
|
|
|
|
|
$key = $this->formatKey( $key, $code );
|
|
|
|
|
}
|
|
|
|
|
if ( $this->level == 2 || empty( $value ) ) {
|
|
|
|
|
echo "* $key\n";
|
2008-05-09 14:16:59 +00:00
|
|
|
} else {
|
2008-10-21 09:29:47 +00:00
|
|
|
echo "* $key: '$value'\n";
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2008-10-21 09:29:47 +00:00
|
|
|
* Output the checks results as wiki text.
|
2008-05-09 14:16:59 +00:00
|
|
|
*/
|
|
|
|
|
function outputWiki() {
|
|
|
|
|
$detailText = '';
|
2009-12-27 16:44:57 +00:00
|
|
|
$rows[] = '! Language !! Code !! Total !! ' . implode( ' !! ', array_diff( $this->checks, $this->nonMessageChecks() ) );
|
2008-05-09 14:16:59 +00:00
|
|
|
foreach ( $this->results as $code => $results ) {
|
|
|
|
|
$detailTextForLang = "==$code==\n";
|
|
|
|
|
$numbers = array();
|
|
|
|
|
$problems = 0;
|
|
|
|
|
$detailTextForLangChecks = array();
|
|
|
|
|
foreach ( $results as $check => $messages ) {
|
2008-10-21 09:29:47 +00:00
|
|
|
if( in_array( $check, $this->nonMessageChecks() ) ) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
$count = count( $messages );
|
|
|
|
|
if ( $count ) {
|
|
|
|
|
$problems += $count;
|
|
|
|
|
$messageDetails = array();
|
|
|
|
|
foreach ( $messages as $key => $details ) {
|
|
|
|
|
$displayKey = $this->formatKey( $key, $code );
|
|
|
|
|
$messageDetails[] = $displayKey;
|
|
|
|
|
}
|
2008-10-21 09:29:47 +00:00
|
|
|
$detailTextForLangChecks[] = "=== $code-$check ===\n* " . implode( ', ', $messageDetails );
|
2008-05-09 14:16:59 +00:00
|
|
|
$numbers[] = "'''[[#$code-$check|$count]]'''";
|
|
|
|
|
} else {
|
|
|
|
|
$numbers[] = $count;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( count( $detailTextForLangChecks ) ) {
|
|
|
|
|
$detailText .= $detailTextForLang . implode( "\n", $detailTextForLangChecks ) . "\n";
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
if ( !$problems ) {
|
|
|
|
|
# Don't list languages without problems
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2012-03-08 20:56:26 +00:00
|
|
|
$language = Language::fetchLanguageName( $code );
|
2008-05-09 14:16:59 +00:00
|
|
|
$rows[] = "| $language || $code || $problems || " . implode( ' || ', $numbers );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$tableRows = implode( "\n|-\n", $rows );
|
|
|
|
|
|
2009-05-02 10:49:37 +00:00
|
|
|
$version = SpecialVersion::getVersion( 'nodb' );
|
2008-05-09 14:16:59 +00:00
|
|
|
echo <<<EOL
|
|
|
|
|
'''Check results are for:''' <code>$version</code>
|
|
|
|
|
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
{| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear: both;"
|
2008-05-09 14:16:59 +00:00
|
|
|
$tableRows
|
|
|
|
|
|}
|
|
|
|
|
|
|
|
|
|
$detailText
|
|
|
|
|
|
|
|
|
|
EOL;
|
|
|
|
|
}
|
2008-07-06 11:12:02 +00:00
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Check if there are any results for the checks, in any language.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return bool True if there are any results, false if not.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-07-06 11:12:02 +00:00
|
|
|
protected function isEmpty() {
|
2010-10-14 20:53:04 +00:00
|
|
|
foreach( $this->results as $results ) {
|
|
|
|
|
foreach( $results as $messages ) {
|
2008-07-06 11:12:02 +00:00
|
|
|
if( !empty( $messages ) ) {
|
2008-10-21 09:29:47 +00:00
|
|
|
return false;
|
2008-07-06 11:12:02 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-10-21 09:29:47 +00:00
|
|
|
return true;
|
2008-07-06 11:12:02 +00:00
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2010-04-09 17:21:52 +00:00
|
|
|
/**
|
|
|
|
|
* @ingroup MaintenanceLanguage
|
|
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
class CheckExtensionsCLI extends CheckLanguageCLI {
|
|
|
|
|
private $extensions;
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Constructor.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @param $options array Options for script.
|
|
|
|
|
* @param $extension string The extension name (or names).
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
public function __construct( Array $options, $extension ) {
|
|
|
|
|
if ( isset( $options['help'] ) ) {
|
|
|
|
|
echo $this->help();
|
2009-04-06 14:41:33 +00:00
|
|
|
exit(1);
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['lang'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->code = $options['lang'];
|
|
|
|
|
} else {
|
|
|
|
|
global $wgLanguageCode;
|
|
|
|
|
$this->code = $wgLanguageCode;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['level'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->level = $options['level'];
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
$this->doLinks = isset( $options['links'] );
|
2008-05-09 14:16:59 +00:00
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['wikilang'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->wikiCode = $options['wikilang'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $options['whitelist'] ) ) {
|
|
|
|
|
$this->checks = explode( ',', $options['whitelist'] );
|
|
|
|
|
} elseif ( isset( $options['blacklist'] ) ) {
|
|
|
|
|
$this->checks = array_diff(
|
2008-10-25 17:35:26 +00:00
|
|
|
isset( $options['easy'] ) ? $this->easyChecks() : $this->defaultChecks(),
|
2008-05-09 14:16:59 +00:00
|
|
|
explode( ',', $options['blacklist'] )
|
|
|
|
|
);
|
2008-10-25 17:35:26 +00:00
|
|
|
} elseif ( isset( $options['easy'] ) ) {
|
|
|
|
|
$this->checks = $this->easyChecks();
|
2008-05-09 14:16:59 +00:00
|
|
|
} else {
|
2008-10-21 09:29:47 +00:00
|
|
|
$this->checks = $this->defaultChecks();
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( isset( $options['output'] ) ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->output = $options['output'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Some additional checks not enabled by default
|
|
|
|
|
if ( isset( $options['duplicate'] ) ) {
|
|
|
|
|
$this->checks[] = 'duplicate';
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-10 08:25:44 +00:00
|
|
|
$this->extensions = array();
|
2008-06-07 08:43:44 +00:00
|
|
|
$extensions = new PremadeMediawikiExtensionGroups();
|
|
|
|
|
$extensions->addAll();
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( $extension == 'all' ) {
|
|
|
|
|
foreach ( MessageGroups::singleton()->getGroups() as $group ) {
|
|
|
|
|
if ( strpos( $group->getId(), 'ext-' ) === 0 && !$group->isMeta() ) {
|
2008-05-09 14:16:59 +00:00
|
|
|
$this->extensions[] = new extensionLanguages( $group );
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-10-25 17:35:26 +00:00
|
|
|
} elseif ( $extension == 'wikimedia' ) {
|
2008-06-14 09:59:13 +00:00
|
|
|
$wikimedia = MessageGroups::getGroup( 'ext-0-wikimedia' );
|
2008-10-25 17:35:26 +00:00
|
|
|
foreach ( $wikimedia->wmfextensions() as $extension ) {
|
2008-06-14 09:59:13 +00:00
|
|
|
$group = MessageGroups::getGroup( $extension );
|
|
|
|
|
$this->extensions[] = new extensionLanguages( $group );
|
|
|
|
|
}
|
2008-12-25 18:14:32 +00:00
|
|
|
} elseif ( $extension == 'flaggedrevs' ) {
|
|
|
|
|
foreach ( MessageGroups::singleton()->getGroups() as $group ) {
|
|
|
|
|
if ( strpos( $group->getId(), 'ext-flaggedrevs-' ) === 0 && !$group->isMeta() ) {
|
|
|
|
|
$this->extensions[] = new extensionLanguages( $group );
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
} else {
|
2008-06-10 08:25:44 +00:00
|
|
|
$extensions = explode( ',', $extension );
|
2008-10-25 17:35:26 +00:00
|
|
|
foreach ( $extensions as $extension ) {
|
2008-06-10 08:25:44 +00:00
|
|
|
$group = MessageGroups::getGroup( 'ext-' . $extension );
|
2008-10-25 17:35:26 +00:00
|
|
|
if ( $group ) {
|
2008-06-10 08:25:44 +00:00
|
|
|
$extension = new extensionLanguages( $group );
|
|
|
|
|
$this->extensions[] = $extension;
|
|
|
|
|
} else {
|
|
|
|
|
print "No such extension $extension.\n";
|
|
|
|
|
}
|
2008-05-09 14:32:28 +00:00
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get the default checks.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array A list of the default checks.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
|
|
|
|
protected function defaultChecks() {
|
|
|
|
|
return array(
|
|
|
|
|
'untranslated', 'duplicate', 'obsolete', 'variables', 'empty', 'plural',
|
|
|
|
|
'whitespace', 'xhtml', 'chars', 'links', 'unbalanced',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-25 17:35:26 +00:00
|
|
|
/**
|
|
|
|
|
* Get the checks which check other things than messages.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return array A list of the non-message checks.
|
2008-10-25 17:35:26 +00:00
|
|
|
*/
|
|
|
|
|
protected function nonMessageChecks() {
|
|
|
|
|
return array();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the checks that can easily be treated by non-speakers of the language.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return arrayA list of the easy checks.
|
2008-10-25 17:35:26 +00:00
|
|
|
*/
|
|
|
|
|
protected function easyChecks() {
|
|
|
|
|
return array(
|
|
|
|
|
'duplicate', 'obsolete', 'empty', 'whitespace', 'xhtml', 'chars',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Get help.
|
2012-02-09 21:08:06 +00:00
|
|
|
* @return string The help string.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function help() {
|
|
|
|
|
return <<<ENDS
|
|
|
|
|
Run this script to check the status of a specific language in extensions, or all of them.
|
|
|
|
|
Command line settings are in form --parameter[=value], except for the first one.
|
|
|
|
|
Parameters:
|
2008-12-25 18:14:32 +00:00
|
|
|
* First parameter (mandatory): Extension name, multiple extension names (separated by commas), "all" for all the extensions, "wikimedia" for extensions used by Wikimedia or "flaggedrevs" for all FLaggedRevs extension messages.
|
2008-05-09 14:16:59 +00:00
|
|
|
* lang: Language code (default: the installation default language).
|
|
|
|
|
* help: Show this help.
|
2008-10-21 09:29:47 +00:00
|
|
|
* level: Show the following display level (default: 2).
|
2008-05-09 14:16:59 +00:00
|
|
|
* links: Link the message values (default off).
|
|
|
|
|
* wikilang: For the links, what is the content language of the wiki to display the output in (default en).
|
|
|
|
|
* whitelist: Do only the following checks (form: code,code).
|
2008-07-13 10:16:48 +00:00
|
|
|
* blacklist: Do not perform the following checks (form: code,code).
|
2008-10-25 17:35:26 +00:00
|
|
|
* easy: Do only the easy checks, which can be treated by non-speakers of the language.
|
2008-10-21 09:29:47 +00:00
|
|
|
Check codes (ideally, all of them should result 0; all the checks are executed by default (except language-specific check blacklists in checkLanguage.inc):
|
2008-05-09 14:16:59 +00:00
|
|
|
* untranslated: Messages which are required to translate, but are not translated.
|
|
|
|
|
* duplicate: Messages which translation equal to fallback
|
|
|
|
|
* obsolete: Messages which are untranslatable, but translated.
|
2009-05-31 13:23:37 +00:00
|
|
|
* variables: Messages without variables which should be used, or with variables which should not be used.
|
2008-05-09 14:16:59 +00:00
|
|
|
* empty: Empty messages.
|
|
|
|
|
* whitespace: Messages which have trailing whitespace.
|
|
|
|
|
* xhtml: Messages which are not well-formed XHTML (checks only few common errors).
|
|
|
|
|
* chars: Messages with hidden characters.
|
|
|
|
|
* links: Messages which contains broken links to pages (does not find all).
|
|
|
|
|
* unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
|
|
|
|
|
Display levels (default: 2):
|
|
|
|
|
* 0: Skip the checks (useful for checking syntax).
|
|
|
|
|
* 1: Show only the stub headers and number of wrong messages, without list of messages.
|
|
|
|
|
* 2: Show only the headers and the message keys, without the message values.
|
|
|
|
|
* 3: Show both the headers and the complete messages, with both keys and values.
|
|
|
|
|
|
|
|
|
|
ENDS;
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Execute the script.
|
|
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
public function execute() {
|
|
|
|
|
$this->doChecks();
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-21 09:29:47 +00:00
|
|
|
/**
|
|
|
|
|
* Check a language and show the results.
|
2011-10-14 21:19:25 +00:00
|
|
|
* @param $code string The language code.
|
2008-10-21 09:29:47 +00:00
|
|
|
*/
|
2008-05-09 14:16:59 +00:00
|
|
|
protected function checkLanguage( $code ) {
|
|
|
|
|
foreach( $this->extensions as $extension ) {
|
|
|
|
|
$this->L = $extension;
|
|
|
|
|
$this->results = array();
|
|
|
|
|
$this->results[$code] = parent::checkLanguage( $code );
|
|
|
|
|
|
2008-07-06 11:12:02 +00:00
|
|
|
if( !$this->isEmpty() ) {
|
|
|
|
|
echo $extension->name() . ":\n";
|
|
|
|
|
|
|
|
|
|
if( $this->level > 0 ) {
|
|
|
|
|
switch( $this->output ) {
|
|
|
|
|
case 'plain':
|
|
|
|
|
$this->outputText();
|
|
|
|
|
break;
|
|
|
|
|
case 'wiki':
|
|
|
|
|
$this->outputWiki();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new MWException( "Invalid output type $this->output" );
|
|
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
|
2008-07-06 11:12:02 +00:00
|
|
|
echo "\n";
|
|
|
|
|
}
|
2008-05-09 14:16:59 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2007-10-15 12:58:00 +00:00
|
|
|
# Blacklist some checks for some languages
|
|
|
|
|
$checkBlacklist = array(
|
2007-12-10 04:21:14 +00:00
|
|
|
#'code' => array( 'check1', 'check2' ... )
|
2009-09-28 08:40:09 +00:00
|
|
|
'az' => array( 'plural' ),
|
|
|
|
|
'bo' => array( 'plural' ),
|
|
|
|
|
'dz' => array( 'plural' ),
|
|
|
|
|
'id' => array( 'plural' ),
|
|
|
|
|
'fa' => array( 'plural' ),
|
2007-12-10 04:21:14 +00:00
|
|
|
'gan' => array( 'plural' ),
|
2009-05-31 13:23:37 +00:00
|
|
|
'gan-hans' => array( 'plural' ),
|
|
|
|
|
'gan-hant' => array( 'plural' ),
|
2008-07-18 15:53:29 +00:00
|
|
|
'gn' => array( 'plural' ),
|
2007-12-10 04:21:14 +00:00
|
|
|
'hak' => array( 'plural' ),
|
2008-07-18 15:53:29 +00:00
|
|
|
'hu' => array( 'plural' ),
|
2007-12-10 04:21:14 +00:00
|
|
|
'ja' => array( 'plural' ), // Does not use plural
|
2009-09-28 08:40:09 +00:00
|
|
|
'jv' => array( 'plural' ),
|
2008-05-01 20:17:51 +00:00
|
|
|
'ka' => array( 'plural' ),
|
2008-05-12 15:44:12 +00:00
|
|
|
'kk-arab' => array( 'plural' ),
|
|
|
|
|
'kk-cyrl' => array( 'plural' ),
|
|
|
|
|
'kk-latn' => array( 'plural' ),
|
2009-09-28 08:40:09 +00:00
|
|
|
'km' => array( 'plural' ),
|
|
|
|
|
'kn' => array( 'plural' ),
|
2008-04-20 18:05:55 +00:00
|
|
|
'ko' => array( 'plural' ),
|
2009-05-31 13:23:37 +00:00
|
|
|
'lzh' => array( 'plural' ),
|
2008-04-21 10:57:51 +00:00
|
|
|
'mn' => array( 'plural' ),
|
2008-05-01 20:17:51 +00:00
|
|
|
'ms' => array( 'plural' ),
|
2009-09-28 08:40:09 +00:00
|
|
|
'my' => array( 'plural', 'chars' ), // Uses a lot zwnj
|
2008-07-18 15:53:29 +00:00
|
|
|
'sah' => array( 'plural' ),
|
2008-05-01 20:17:51 +00:00
|
|
|
'sq' => array( 'plural' ),
|
2007-12-10 04:21:14 +00:00
|
|
|
'tet' => array( 'plural' ),
|
|
|
|
|
'th' => array( 'plural' ),
|
2009-09-28 08:40:09 +00:00
|
|
|
'to' => array( 'plural' ),
|
|
|
|
|
'tr' => array( 'plural' ),
|
|
|
|
|
'vi' => array( 'plural' ),
|
2007-12-12 02:42:49 +00:00
|
|
|
'wuu' => array( 'plural' ),
|
2008-04-15 21:15:40 +00:00
|
|
|
'xmf' => array( 'plural' ),
|
2009-09-28 08:40:09 +00:00
|
|
|
'yo' => array( 'plural' ),
|
2007-12-10 04:21:14 +00:00
|
|
|
'yue' => array( 'plural' ),
|
|
|
|
|
'zh' => array( 'plural' ),
|
2007-10-15 15:09:42 +00:00
|
|
|
'zh-classical' => array( 'plural' ),
|
2007-12-10 04:21:14 +00:00
|
|
|
'zh-cn' => array( 'plural' ),
|
|
|
|
|
'zh-hans' => array( 'plural' ),
|
|
|
|
|
'zh-hant' => array( 'plural' ),
|
|
|
|
|
'zh-hk' => array( 'plural' ),
|
|
|
|
|
'zh-sg' => array( 'plural' ),
|
|
|
|
|
'zh-tw' => array( 'plural' ),
|
|
|
|
|
'zh-yue' => array( 'plural' ),
|
2007-10-15 12:58:00 +00:00
|
|
|
);
|