]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - maintenance/language/checkLanguage.inc
MediaWiki 1.16.0
[autoinstallsdev/mediawiki.git] / maintenance / language / checkLanguage.inc
1 <?php
2 /**
3  * @ingroup MaintenanceLanguage
4  */
5
6 class CheckLanguageCLI {
7         protected $code  = null;
8         protected $level = 2;
9         protected $doLinks = false;
10         protected $linksPrefix = '';
11         protected $wikiCode = 'en';
12         protected $checkAll = false;
13         protected $output = 'plain';
14         protected $checks = array();
15         protected $L = null;
16
17         protected $results = array();
18
19         private $includeExif = false;
20
21         /**
22          * Constructor.
23          * @param $options Options for script.
24          */
25         public function __construct( Array $options ) {
26                 if ( isset( $options['help'] ) ) {
27                         echo $this->help();
28                         exit(1);
29                 }
30
31                 if ( isset( $options['lang'] ) ) {
32                         $this->code = $options['lang'];
33                 } else {
34                         global $wgLanguageCode;
35                         $this->code = $wgLanguageCode;
36                 }
37
38                 if ( isset( $options['level'] ) ) {
39                         $this->level = $options['level'];
40                 }
41
42                 $this->doLinks = isset( $options['links'] );
43                 $this->includeExif = !isset( $options['noexif'] );
44                 $this->checkAll = isset( $options['all'] );
45
46                 if ( isset( $options['prefix'] ) ) {
47                         $this->linksPrefix = $options['prefix'];
48                 }
49
50                 if ( isset( $options['wikilang'] ) ) {
51                         $this->wikiCode = $options['wikilang'];
52                 }
53
54                 if ( isset( $options['whitelist'] ) ) {
55                         $this->checks = explode( ',', $options['whitelist'] );
56                 } elseif ( isset( $options['blacklist'] ) ) {
57                         $this->checks = array_diff(
58                                 isset( $options['easy'] ) ? $this->easyChecks() : $this->defaultChecks(),
59                                 explode( ',', $options['blacklist'] )
60                         );
61                 } elseif ( isset( $options['easy'] ) ) {
62                         $this->checks = $this->easyChecks();
63                 } else {
64                         $this->checks = $this->defaultChecks();
65                 }
66
67                 if ( isset( $options['output'] ) ) {
68                         $this->output = $options['output'];
69                 }
70
71                 $this->L = new languages( $this->includeExif );
72         }
73
74         /**
75          * Get the default checks.
76          * @return A list of the default checks.
77          */
78         protected function defaultChecks() {
79                 return array(
80                         'untranslated', 'duplicate', 'obsolete', 'variables', 'empty', 'plural',
81                         'whitespace', 'xhtml', 'chars', 'links', 'unbalanced', 'namespace',
82                         'projecttalk', 'magic', 'magic-old', 'magic-over', 'magic-case',
83                         'special', 'special-old',
84                 );
85         }
86
87         /**
88          * Get the checks which check other things than messages.
89          * @return A list of the non-message checks.
90          */
91         protected function nonMessageChecks() {
92                 return array(
93                         'namespace', 'projecttalk', 'magic', 'magic-old', 'magic-over',
94                         'magic-case', 'special', 'special-old',
95                 );
96         }
97
98         /**
99          * Get the checks that can easily be treated by non-speakers of the language.
100          * @return A list of the easy checks.
101          */
102         protected function easyChecks() {
103                 return array(
104                         'duplicate', 'obsolete', 'empty', 'whitespace', 'xhtml', 'chars', 'magic-old',
105                         'magic-over', 'magic-case', 'special-old',
106                 );
107         }
108
109         /**
110          * Get all checks.
111          * @return An array of all check names mapped to their function names.
112          */
113         protected function getChecks() {
114                 return array(
115                         'untranslated' => 'getUntranslatedMessages',
116                         'duplicate'    => 'getDuplicateMessages',
117                         'obsolete'     => 'getObsoleteMessages',
118                         'variables'    => 'getMessagesWithMismatchVariables',
119                         'plural'       => 'getMessagesWithoutPlural',
120                         'empty'        => 'getEmptyMessages',
121                         'whitespace'   => 'getMessagesWithWhitespace',
122                         'xhtml'        => 'getNonXHTMLMessages',
123                         'chars'        => 'getMessagesWithWrongChars',
124                         'links'        => 'getMessagesWithDubiousLinks',
125                         'unbalanced'   => 'getMessagesWithUnbalanced',
126                         'namespace'    => 'getUntranslatedNamespaces',
127                         'projecttalk'  => 'getProblematicProjectTalks',
128                         'magic'        => 'getUntranslatedMagicWords',
129                         'magic-old'    => 'getObsoleteMagicWords',
130                         'magic-over'   => 'getOverridingMagicWords',
131                         'magic-case'   => 'getCaseMismatchMagicWords',
132                         'special'      => 'getUntraslatedSpecialPages',
133                         'special-old'  => 'getObsoleteSpecialPages',
134                 );
135         }
136
137         /**
138          * Get total count for each check non-messages check.
139          * @return An array of all check names mapped to a two-element array:
140          * function name to get the total count and language code or null
141          * for checked code.
142          */
143         protected function getTotalCount() {
144                 return array(
145                         'namespace'    => array( 'getNamespaceNames', 'en' ),
146                         'projecttalk'  => null,
147                         'magic'        => array( 'getMagicWords', 'en' ),
148                         'magic-old'    => array( 'getMagicWords', null ),
149                         'magic-over'   => array( 'getMagicWords', null ),
150                         'magic-case'   => array( 'getMagicWords', null ),
151                         'special'      => array( 'getSpecialPageAliases', 'en' ),
152                         'special-old'  => array( 'getSpecialPageAliases', null ),
153                 );
154         }
155
156         /**
157          * Get all check descriptions.
158          * @return An array of all check names mapped to their descriptions.
159          */
160         protected function getDescriptions() {
161                 return array(
162                         'untranslated' => '$1 message(s) of $2 are not translated to $3, but exist in en:',
163                         'duplicate'    => '$1 message(s) of $2 are translated the same in en and $3:',
164                         'obsolete'     => '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:',
165                         'variables'    => '$1 message(s) of $2 in $3 don\'t match the variables used in en:',
166                         'plural'       => '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:',
167                         'empty'        => '$1 message(s) of $2 in $3 are empty or -:',
168                         'whitespace'   => '$1 message(s) of $2 in $3 have trailing whitespace:',
169                         'xhtml'        => '$1 message(s) of $2 in $3 contain illegal XHTML:',
170                         'chars'        => '$1 message(s) of $2 in $3 include hidden chars which should not be used in the messages:',
171                         'links'        => '$1 message(s) of $2 in $3 have problematic link(s):',
172                         'unbalanced'   => '$1 message(s) of $2 in $3 have unbalanced {[]}:',
173                         'namespace'    => '$1 namespace name(s) of $2 are not translated to $3, but exist in en:',
174                         'projecttalk'  => '$1 namespace name(s) and alias(es) in $3 are project talk namespaces without the parameter:',
175                         'magic'        => '$1 magic word(s) of $2 are not translated to $3, but exist in en:',
176                         'magic-old'    => '$1 magic word(s) of $2 do not exist in en, but exist in $3:',
177                         'magic-over'   => '$1 magic word(s) of $2 in $3 do not contain the original en word(s):',
178                         'magic-case'   => '$1 magic word(s) of $2 in $3 change the case-sensitivity of the original en word:',
179                         'special'      => '$1 special page alias(es) of $2 are not translated to $3, but exist in en:',
180                         'special-old'  => '$1 special page alias(es) of $2 do not exist in en, but exist in $3:',
181                 );
182         }
183
184         /**
185          * Get help.
186          * @return The help string.
187          */
188         protected function help() {
189                 return <<<ENDS
190 Run this script to check a specific language file, or all of them.
191 Command line settings are in form --parameter[=value].
192 Parameters:
193         * lang: Language code (default: the installation default language).
194         * all: Check all customized languages.
195         * help: Show this help.
196         * level: Show the following display level (default: 2).
197         * links: Link the message values (default off).
198         * prefix: prefix to add to links.
199         * wikilang: For the links, what is the content language of the wiki to display the output in (default en).
200         * whitelist: Do only the following checks (form: code,code).
201         * blacklist: Don't do the following checks (form: code,code).
202         * easy: Do only the easy checks, which can be treated by non-speakers of the language.
203         * noexif: Don't check for EXIF messages (a bit hard and boring to translate), if you know that they are currently not translated and want to focus on other problems (default off).
204 Check codes (ideally, all of them should result 0; all the checks are executed by default (except language-specific check blacklists in checkLanguage.inc):
205         * untranslated: Messages which are required to translate, but are not translated.
206         * duplicate: Messages which translation equal to fallback
207         * obsolete: Messages which are untranslatable or do not exist, but are translated.
208         * variables: Messages without variables which should be used, or with variables which shouldn't be used.
209         * empty: Empty messages and messages that contain only -.
210         * whitespace: Messages which have trailing whitespace.
211         * xhtml: Messages which are not well-formed XHTML (checks only few common errors).
212         * chars: Messages with hidden characters.
213         * links: Messages which contains broken links to pages (does not find all).
214         * unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
215         * namespace: Namespace names that were not translated.
216         * projecttalk: Namespace names and aliases where the project talk does not contain $1.
217         * magic: Magic words that were not translated.
218         * magic-old: Magic words which do not exist.
219         * magic-over: Magic words that override the original English word.
220         * magic-case: Magic words whose translation changes the case-sensitivity of the original English word.
221         * special: Special page names that were not translated.
222         * special-old: Special page names which do not exist.
223 Display levels (default: 2):
224         * 0: Skip the checks (useful for checking syntax).
225         * 1: Show only the stub headers and number of wrong messages, without list of messages.
226         * 2: Show only the headers and the message keys, without the message values.
227         * 3: Show both the headers and the complete messages, with both keys and values.
228
229 ENDS;
230         }
231
232         /**
233          * Execute the script.
234          */
235         public function execute() {
236                 $this->doChecks();
237                 if ( $this->level > 0 ) {
238                         switch ( $this->output ) {
239                                 case 'plain':
240                                         $this->outputText();
241                                         break;
242                                 case 'wiki':
243                                         $this->outputWiki();
244                                         break;
245                                 default:
246                                         throw new MWException( "Invalid output type $this->output" );
247                         }
248                 }
249         }
250
251         /**
252          * Execute the checks.
253          */
254         protected function doChecks() {
255                 $ignoredCodes = array( 'en', 'enRTL' );
256
257                 $this->results = array();
258                 # Check the language
259                 if ( $this->checkAll ) {
260                         foreach ( $this->L->getLanguages() as $language ) {
261                                 if ( !in_array( $language, $ignoredCodes ) ) {
262                                         $this->results[$language] = $this->checkLanguage( $language );
263                                 }
264                         }
265                 } else {
266                         if ( in_array( $this->code, $ignoredCodes ) ) {
267                                 throw new MWException( "Cannot check code $this->code." );
268                         } else {
269                                 $this->results[$this->code] = $this->checkLanguage( $this->code );
270                         }
271                 }
272         }
273
274         /**
275          * Get the check blacklist.
276          * @return The list of checks which should not be executed.
277          */
278         protected function getCheckBlacklist() {
279                 global $checkBlacklist;
280                 return $checkBlacklist;
281         }
282
283         /**
284          * Check a language.
285          * @param $code The language code.
286          * @return The results.
287          */
288         protected function checkLanguage( $code ) {
289                 # Syntax check only
290                 if ( $this->level === 0 ) {
291                         $this->L->getMessages( $code );
292                         return;
293                 }
294
295                 $results = array();
296                 $checkFunctions = $this->getChecks();
297                 $checkBlacklist = $this->getCheckBlacklist();
298                 foreach ( $this->checks as $check ) {
299                         if ( isset( $checkBlacklist[$code] ) &&
300                                 in_array( $check, $checkBlacklist[$code] ) ) {
301                                 $results[$check] = array();
302                                 continue;
303                         }
304
305                         $callback = array( $this->L, $checkFunctions[$check] );
306                         if ( !is_callable( $callback ) ) {
307                                 throw new MWException( "Unkown check $check." );
308                         }
309                         $results[$check] = call_user_func( $callback, $code );
310                 }
311
312                 return $results;
313         }
314
315         /**
316          * Format a message key.
317          * @param $key The message key.
318          * @param $code The language code.
319          * @return The formatted message key.
320          */
321         protected function formatKey( $key, $code ) {
322                 if ( $this->doLinks ) {
323                         $displayKey = ucfirst( $key );
324                         if ( $code == $this->wikiCode ) {
325                                 return "[[{$this->linksPrefix}MediaWiki:$displayKey|$key]]";
326                         } else {
327                                 return "[[{$this->linksPrefix}MediaWiki:$displayKey/$code|$key]]";
328                         }
329                 } else {
330                         return $key;
331                 }
332         }
333
334         /**
335          * Output the checks results as plain text.
336          * @return The checks results as plain text.
337          */
338         protected function outputText() {
339                 foreach ( $this->results as $code => $results ) {
340                         $translated = $this->L->getMessages( $code );
341                         $translated = count( $translated['translated'] );
342                         foreach ( $results as $check => $messages ) {
343                                 $count = count( $messages );
344                                 if ( $count ) {
345                                         if ( $check == 'untranslated' ) {
346                                                 $translatable = $this->L->getGeneralMessages();
347                                                 $total = count( $translatable['translatable'] );
348                                         } elseif ( in_array( $check, $this->nonMessageChecks() ) ) {
349                                                 $totalCount = $this->getTotalCount();
350                                                 $totalCount = $totalCount[$check];
351                                                 $callback = array( $this->L, $totalCount[0] );
352                                                 $callCode = $totalCount[1] ? $totalCount[1] : $code;
353                                                 $total = count( call_user_func( $callback, $callCode ) );
354                                         } else {
355                                                 $total = $translated;
356                                         }
357                                         $search = array( '$1', '$2', '$3' );
358                                         $replace = array( $count, $total, $code );
359                                         $descriptions = $this->getDescriptions();
360                                         echo "\n" . str_replace( $search, $replace, $descriptions[$check] ) . "\n";
361                                         if ( $this->level == 1 ) {
362                                                 echo "[messages are hidden]\n";
363                                         } else {
364                                                 foreach ( $messages as $key => $value ) {
365                                                         if( !in_array( $check, $this->nonMessageChecks() ) ) {
366                                                                 $key = $this->formatKey( $key, $code );
367                                                         }
368                                                         if ( $this->level == 2 || empty( $value ) ) {
369                                                                 echo "* $key\n";
370                                                         } else {
371                                                                 echo "* $key:           '$value'\n";
372                                                         }
373                                                 }
374                                         }
375                                 }
376                         }
377                 }
378         }
379
380         /**
381          * Output the checks results as wiki text.
382          * @return The checks results as wiki text.
383          */
384         function outputWiki() {
385                 global $wgContLang, $IP;
386                 $detailText = '';
387                 $rows[] = '! Language !! Code !! Total !! ' . implode( ' !! ', array_diff( $this->checks, $this->nonMessageChecks() ) );
388                 foreach ( $this->results as $code => $results ) {
389                         $detailTextForLang = "==$code==\n";
390                         $numbers = array();
391                         $problems = 0;
392                         $detailTextForLangChecks = array();
393                         foreach ( $results as $check => $messages ) {
394                                 if( in_array( $check, $this->nonMessageChecks() ) ) {
395                                         continue;
396                                 }
397                                 $count = count( $messages );
398                                 if ( $count ) {
399                                         $problems += $count;
400                                         $messageDetails = array();
401                                         foreach ( $messages as $key => $details ) {
402                                                 $displayKey = $this->formatKey( $key, $code );
403                                                 $messageDetails[] = $displayKey;
404                                         }
405                                         $detailTextForLangChecks[] = "=== $code-$check ===\n* " . implode( ', ', $messageDetails );
406                                         $numbers[] = "'''[[#$code-$check|$count]]'''";
407                                 } else {
408                                         $numbers[] = $count;
409                                 }
410
411                         }
412
413                         if ( count( $detailTextForLangChecks ) ) {
414                                 $detailText .= $detailTextForLang . implode( "\n", $detailTextForLangChecks ) . "\n";
415                         }
416
417                         if ( !$problems ) {
418                                 # Don't list languages without problems
419                                 continue;
420                         }
421                         $language = $wgContLang->getLanguageName( $code );
422                         $rows[] = "| $language || $code || $problems || " . implode( ' || ', $numbers );
423                 }
424
425                 $tableRows = implode( "\n|-\n", $rows );
426
427                 $version = SpecialVersion::getVersion( 'nodb' );
428                 echo <<<EOL
429 '''Check results are for:''' <code>$version</code>
430
431
432 {| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear: both;"
433 $tableRows
434 |}
435
436 $detailText
437
438 EOL;
439         }
440
441         /**
442          * Check if there are any results for the checks, in any language.
443          * @return True if there are any results, false if not.
444          */
445         protected function isEmpty() {
446                 foreach( $this->results as $code => $results ) {
447                         foreach( $results as $check => $messages ) {
448                                 if( !empty( $messages ) ) {
449                                         return false;
450                                 }
451                         }
452                 }
453                 return true;
454         }
455 }
456
457 class CheckExtensionsCLI extends CheckLanguageCLI {
458         private $extensions;
459
460         /**
461          * Constructor.
462          * @param $options Options for script.
463          * @param $extension The extension name (or names).
464          */
465         public function __construct( Array $options, $extension ) {
466                 if ( isset( $options['help'] ) ) {
467                         echo $this->help();
468                         exit(1);
469                 }
470
471                 if ( isset( $options['lang'] ) ) {
472                         $this->code = $options['lang'];
473                 } else {
474                         global $wgLanguageCode;
475                         $this->code = $wgLanguageCode;
476                 }
477
478                 if ( isset( $options['level'] ) ) {
479                         $this->level = $options['level'];
480                 }
481
482                 $this->doLinks = isset( $options['links'] );
483
484                 if ( isset( $options['wikilang'] ) ) {
485                         $this->wikiCode = $options['wikilang'];
486                 }
487
488                 if ( isset( $options['whitelist'] ) ) {
489                         $this->checks = explode( ',', $options['whitelist'] );
490                 } elseif ( isset( $options['blacklist'] ) ) {
491                         $this->checks = array_diff(
492                                 isset( $options['easy'] ) ? $this->easyChecks() : $this->defaultChecks(),
493                                 explode( ',', $options['blacklist'] )
494                         );
495                 } elseif ( isset( $options['easy'] ) ) {
496                         $this->checks = $this->easyChecks();
497                 } else {
498                         $this->checks = $this->defaultChecks();
499                 }
500
501                 if ( isset( $options['output'] ) ) {
502                         $this->output = $options['output'];
503                 }
504
505                 # Some additional checks not enabled by default
506                 if ( isset( $options['duplicate'] ) ) {
507                         $this->checks[] = 'duplicate';
508                 }
509
510                 $this->extensions = array();
511                 $extensions = new PremadeMediawikiExtensionGroups();
512                 $extensions->addAll();
513                 if ( $extension == 'all' ) {
514                         foreach ( MessageGroups::singleton()->getGroups() as $group ) {
515                                 if ( strpos( $group->getId(), 'ext-' ) === 0 && !$group->isMeta() ) {
516                                         $this->extensions[] = new extensionLanguages( $group );
517                                 }
518                         }
519                 } elseif ( $extension == 'wikimedia' ) {
520                         $wikimedia = MessageGroups::getGroup( 'ext-0-wikimedia' );
521                         foreach ( $wikimedia->wmfextensions() as $extension ) {
522                                 $group = MessageGroups::getGroup( $extension );
523                                 $this->extensions[] = new extensionLanguages( $group );
524                         }
525                 } elseif ( $extension == 'flaggedrevs' ) {
526                         foreach ( MessageGroups::singleton()->getGroups() as $group ) {
527                                 if ( strpos( $group->getId(), 'ext-flaggedrevs-' ) === 0 && !$group->isMeta() ) {
528                                         $this->extensions[] = new extensionLanguages( $group );
529                                 }
530                         }
531                 } else {
532                         $extensions = explode( ',', $extension );
533                         foreach ( $extensions as $extension ) {
534                                 $group = MessageGroups::getGroup( 'ext-' . $extension );
535                                 if ( $group ) {
536                                         $extension = new extensionLanguages( $group );
537                                         $this->extensions[] = $extension;
538                                 } else {
539                                         print "No such extension $extension.\n";
540                                 }
541                         }
542                 }
543         }
544
545         /**
546          * Get the default checks.
547          * @return A list of the default checks.
548          */
549         protected function defaultChecks() {
550                 return array(
551                         'untranslated', 'duplicate', 'obsolete', 'variables', 'empty', 'plural',
552                         'whitespace', 'xhtml', 'chars', 'links', 'unbalanced',
553                 );
554         }
555
556         /**
557          * Get the checks which check other things than messages.
558          * @return A list of the non-message checks.
559          */
560         protected function nonMessageChecks() {
561                 return array();
562         }
563
564         /**
565          * Get the checks that can easily be treated by non-speakers of the language.
566          * @return A list of the easy checks.
567          */
568         protected function easyChecks() {
569                 return array(
570                         'duplicate', 'obsolete', 'empty', 'whitespace', 'xhtml', 'chars',
571                 );
572         }
573
574         /**
575          * Get help.
576          * @return The help string.
577          */
578         protected function help() {
579                 return <<<ENDS
580 Run this script to check the status of a specific language in extensions, or all of them.
581 Command line settings are in form --parameter[=value], except for the first one.
582 Parameters:
583         * 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.
584         * lang: Language code (default: the installation default language).
585         * help: Show this help.
586         * level: Show the following display level (default: 2).
587         * links: Link the message values (default off).
588         * wikilang: For the links, what is the content language of the wiki to display the output in (default en).
589         * whitelist: Do only the following checks (form: code,code).
590         * blacklist: Do not perform the following checks (form: code,code).
591         * easy: Do only the easy checks, which can be treated by non-speakers of the language.
592 Check codes (ideally, all of them should result 0; all the checks are executed by default (except language-specific check blacklists in checkLanguage.inc):
593         * untranslated: Messages which are required to translate, but are not translated.
594         * duplicate: Messages which translation equal to fallback
595         * obsolete: Messages which are untranslatable, but translated.
596         * variables: Messages without variables which should be used, or with variables which should not be used.
597         * empty: Empty messages.
598         * whitespace: Messages which have trailing whitespace.
599         * xhtml: Messages which are not well-formed XHTML (checks only few common errors).
600         * chars: Messages with hidden characters.
601         * links: Messages which contains broken links to pages (does not find all).
602         * unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
603 Display levels (default: 2):
604         * 0: Skip the checks (useful for checking syntax).
605         * 1: Show only the stub headers and number of wrong messages, without list of messages.
606         * 2: Show only the headers and the message keys, without the message values.
607         * 3: Show both the headers and the complete messages, with both keys and values.
608
609 ENDS;
610         }
611
612         /**
613          * Execute the script.
614          */
615         public function execute() {
616                 $this->doChecks();
617         }
618
619         /**
620          * Check a language and show the results.
621          * @param $code The language code.
622          */
623         protected function checkLanguage( $code ) {
624                 foreach( $this->extensions as $extension ) {
625                         $this->L = $extension;
626                         $this->results = array();
627                         $this->results[$code] = parent::checkLanguage( $code );
628
629                         if( !$this->isEmpty() ) {
630                                 echo $extension->name() . ":\n";
631
632                                 if( $this->level > 0 ) {
633                                         switch( $this->output ) {
634                                                 case 'plain':
635                                                         $this->outputText();
636                                                         break;
637                                                 case 'wiki':
638                                                         $this->outputWiki();
639                                                         break;
640                                                 default:
641                                                         throw new MWException( "Invalid output type $this->output" );
642                                         }
643                                 }
644
645                                 echo "\n";
646                         }
647                 }
648         }
649 }
650
651 # Blacklist some checks for some languages
652 $checkBlacklist = array(
653 #'code'        => array( 'check1', 'check2' ... )
654 'az'           => array( 'plural' ),
655 'bo'           => array( 'plural' ),
656 'dz'           => array( 'plural' ),
657 'id'           => array( 'plural' ),
658 'fa'           => array( 'plural' ),
659 'gan'          => array( 'plural' ),
660 'gan-hans'     => array( 'plural' ),
661 'gan-hant'     => array( 'plural' ),
662 'gn'           => array( 'plural' ),
663 'hak'          => array( 'plural' ),
664 'hu'           => array( 'plural' ),
665 'ja'           => array( 'plural' ), // Does not use plural
666 'jv'           => array( 'plural' ),
667 'ka'           => array( 'plural' ),
668 'kk-arab'      => array( 'plural' ),
669 'kk-cyrl'      => array( 'plural' ),
670 'kk-latn'      => array( 'plural' ),
671 'km'           => array( 'plural' ),
672 'kn'           => array( 'plural' ),
673 'ko'           => array( 'plural' ),
674 'lzh'          => array( 'plural' ),
675 'mn'           => array( 'plural' ),
676 'ms'           => array( 'plural' ),
677 'my'           => array( 'plural', 'chars' ),  // Uses a lot zwnj
678 'sah'          => array( 'plural' ),
679 'sq'           => array( 'plural' ),
680 'tet'          => array( 'plural' ),
681 'th'           => array( 'plural' ),
682 'to'           => array( 'plural' ),
683 'tr'           => array( 'plural' ),
684 'vi'           => array( 'plural' ),
685 'wuu'          => array( 'plural' ),
686 'xmf'          => array( 'plural' ),
687 'yo'           => array( 'plural' ),
688 'yue'          => array( 'plural' ),
689 'zh'           => array( 'plural' ),
690 'zh-classical' => array( 'plural' ),
691 'zh-cn'        => array( 'plural' ),
692 'zh-hans'      => array( 'plural' ),
693 'zh-hant'      => array( 'plural' ),
694 'zh-hk'        => array( 'plural' ),
695 'zh-sg'        => array( 'plural' ),
696 'zh-tw'        => array( 'plural' ),
697 'zh-yue'       => array( 'plural' ),
698 );