]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - maintenance/language/checkLanguage.inc
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / maintenance / language / checkLanguage.inc
1 <?php
2
3 /**
4  * @ingroup MaintenanceLanguage
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         --help: Show this help.
194         --lang: Language code (default: the installation default language).
195         --all: Check all customized languages.
196         --level: Show the following display level (default: 2):
197                 * 0: Skip the checks (useful for checking syntax).
198                 * 1: Show only the stub headers and number of wrong messages, without list of messages.
199                 * 2: Show only the headers and the message keys, without the message values.
200                 * 3: Show both the headers and the complete messages, with both keys and values.
201         --links: Link the message values (default off).
202         --prefix: prefix to add to links.
203         --wikilang: For the links, what is the content language of the wiki to display the output in (default en).
204         --noexif: Don't check for EXIF messages (a bit hard and boring to translate), if you know
205                 that they are currently not translated and want to focus on other problems (default off).
206         --whitelist: Do only the following checks (form: code,code).
207         --blacklist: Don't do the following checks (form: code,code).
208         --easy: Do only the easy checks, which can be treated by non-speakers of the language.
209
210 Check codes (ideally, all of them should result 0; all the checks are executed by default (except language-specific check blacklists in checkLanguage.inc):
211         * untranslated: Messages which are required to translate, but are not translated.
212         * duplicate: Messages which translation equal to fallback
213         * obsolete: Messages which are untranslatable or do not exist, but are translated.
214         * variables: Messages without variables which should be used, or with variables which shouldn't be used.
215         * empty: Empty messages and messages that contain only -.
216         * whitespace: Messages which have trailing whitespace.
217         * xhtml: Messages which are not well-formed XHTML (checks only few common errors).
218         * chars: Messages with hidden characters.
219         * links: Messages which contains broken links to pages (does not find all).
220         * unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
221         * namespace: Namespace names that were not translated.
222         * projecttalk: Namespace names and aliases where the project talk does not contain $1.
223         * magic: Magic words that were not translated.
224         * magic-old: Magic words which do not exist.
225         * magic-over: Magic words that override the original English word.
226         * magic-case: Magic words whose translation changes the case-sensitivity of the original English word.
227         * special: Special page names that were not translated.
228         * special-old: Special page names which do not exist.
229
230 ENDS;
231         }
232
233         /**
234          * Execute the script.
235          */
236         public function execute() {
237                 $this->doChecks();
238                 if ( $this->level > 0 ) {
239                         switch ( $this->output ) {
240                                 case 'plain':
241                                         $this->outputText();
242                                         break;
243                                 case 'wiki':
244                                         $this->outputWiki();
245                                         break;
246                                 default:
247                                         throw new MWException( "Invalid output type $this->output" );
248                         }
249                 }
250         }
251
252         /**
253          * Execute the checks.
254          */
255         protected function doChecks() {
256                 $ignoredCodes = array( 'en', 'enRTL' );
257
258                 $this->results = array();
259                 # Check the language
260                 if ( $this->checkAll ) {
261                         foreach ( $this->L->getLanguages() as $language ) {
262                                 if ( !in_array( $language, $ignoredCodes ) ) {
263                                         $this->results[$language] = $this->checkLanguage( $language );
264                                 }
265                         }
266                 } else {
267                         if ( in_array( $this->code, $ignoredCodes ) ) {
268                                 throw new MWException( "Cannot check code $this->code." );
269                         } else {
270                                 $this->results[$this->code] = $this->checkLanguage( $this->code );
271                         }
272                 }
273         }
274
275         /**
276          * Get the check blacklist.
277          * @return The list of checks which should not be executed.
278          */
279         protected function getCheckBlacklist() {
280                 global $checkBlacklist;
281                 return $checkBlacklist;
282         }
283
284         /**
285          * Check a language.
286          * @param $code The language code.
287          * @return The results.
288          */
289         protected function checkLanguage( $code ) {
290                 # Syntax check only
291                 if ( $this->level === 0 ) {
292                         $this->L->getMessages( $code );
293                         return;
294                 }
295
296                 $results = array();
297                 $checkFunctions = $this->getChecks();
298                 $checkBlacklist = $this->getCheckBlacklist();
299                 foreach ( $this->checks as $check ) {
300                         if ( isset( $checkBlacklist[$code] ) &&
301                                 in_array( $check, $checkBlacklist[$code] ) ) {
302                                 $results[$check] = array();
303                                 continue;
304                         }
305
306                         $callback = array( $this->L, $checkFunctions[$check] );
307                         if ( !is_callable( $callback ) ) {
308                                 throw new MWException( "Unkown check $check." );
309                         }
310                         $results[$check] = call_user_func( $callback, $code );
311                 }
312
313                 return $results;
314         }
315
316         /**
317          * Format a message key.
318          * @param $key The message key.
319          * @param $code The language code.
320          * @return The formatted message key.
321          */
322         protected function formatKey( $key, $code ) {
323                 if ( $this->doLinks ) {
324                         $displayKey = ucfirst( $key );
325                         if ( $code == $this->wikiCode ) {
326                                 return "[[{$this->linksPrefix}MediaWiki:$displayKey|$key]]";
327                         } else {
328                                 return "[[{$this->linksPrefix}MediaWiki:$displayKey/$code|$key]]";
329                         }
330                 } else {
331                         return $key;
332                 }
333         }
334
335         /**
336          * Output the checks results as plain text.
337          * @return The checks results as plain text.
338          */
339         protected function outputText() {
340                 foreach ( $this->results as $code => $results ) {
341                         $translated = $this->L->getMessages( $code );
342                         $translated = count( $translated['translated'] );
343                         foreach ( $results as $check => $messages ) {
344                                 $count = count( $messages );
345                                 if ( $count ) {
346                                         if ( $check == 'untranslated' ) {
347                                                 $translatable = $this->L->getGeneralMessages();
348                                                 $total = count( $translatable['translatable'] );
349                                         } elseif ( in_array( $check, $this->nonMessageChecks() ) ) {
350                                                 $totalCount = $this->getTotalCount();
351                                                 $totalCount = $totalCount[$check];
352                                                 $callback = array( $this->L, $totalCount[0] );
353                                                 $callCode = $totalCount[1] ? $totalCount[1] : $code;
354                                                 $total = count( call_user_func( $callback, $callCode ) );
355                                         } else {
356                                                 $total = $translated;
357                                         }
358                                         $search = array( '$1', '$2', '$3' );
359                                         $replace = array( $count, $total, $code );
360                                         $descriptions = $this->getDescriptions();
361                                         echo "\n" . str_replace( $search, $replace, $descriptions[$check] ) . "\n";
362                                         if ( $this->level == 1 ) {
363                                                 echo "[messages are hidden]\n";
364                                         } else {
365                                                 foreach ( $messages as $key => $value ) {
366                                                         if( !in_array( $check, $this->nonMessageChecks() ) ) {
367                                                                 $key = $this->formatKey( $key, $code );
368                                                         }
369                                                         if ( $this->level == 2 || empty( $value ) ) {
370                                                                 echo "* $key\n";
371                                                         } else {
372                                                                 echo "* $key:           '$value'\n";
373                                                         }
374                                                 }
375                                         }
376                                 }
377                         }
378                 }
379         }
380
381         /**
382          * Output the checks results as wiki text.
383          * @return The checks results as wiki text.
384          */
385         function outputWiki() {
386                 global $wgContLang;
387                 $detailText = '';
388                 $rows[] = '! Language !! Code !! Total !! ' . implode( ' !! ', array_diff( $this->checks, $this->nonMessageChecks() ) );
389                 foreach ( $this->results as $code => $results ) {
390                         $detailTextForLang = "==$code==\n";
391                         $numbers = array();
392                         $problems = 0;
393                         $detailTextForLangChecks = array();
394                         foreach ( $results as $check => $messages ) {
395                                 if( in_array( $check, $this->nonMessageChecks() ) ) {
396                                         continue;
397                                 }
398                                 $count = count( $messages );
399                                 if ( $count ) {
400                                         $problems += $count;
401                                         $messageDetails = array();
402                                         foreach ( $messages as $key => $details ) {
403                                                 $displayKey = $this->formatKey( $key, $code );
404                                                 $messageDetails[] = $displayKey;
405                                         }
406                                         $detailTextForLangChecks[] = "=== $code-$check ===\n* " . implode( ', ', $messageDetails );
407                                         $numbers[] = "'''[[#$code-$check|$count]]'''";
408                                 } else {
409                                         $numbers[] = $count;
410                                 }
411
412                         }
413
414                         if ( count( $detailTextForLangChecks ) ) {
415                                 $detailText .= $detailTextForLang . implode( "\n", $detailTextForLangChecks ) . "\n";
416                         }
417
418                         if ( !$problems ) {
419                                 # Don't list languages without problems
420                                 continue;
421                         }
422                         $language = $wgContLang->getLanguageName( $code );
423                         $rows[] = "| $language || $code || $problems || " . implode( ' || ', $numbers );
424                 }
425
426                 $tableRows = implode( "\n|-\n", $rows );
427
428                 $version = SpecialVersion::getVersion( 'nodb' );
429                 echo <<<EOL
430 '''Check results are for:''' <code>$version</code>
431
432
433 {| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear: both;"
434 $tableRows
435 |}
436
437 $detailText
438
439 EOL;
440         }
441
442         /**
443          * Check if there are any results for the checks, in any language.
444          * @return True if there are any results, false if not.
445          */
446         protected function isEmpty() {
447                 foreach( $this->results as $results ) {
448                         foreach( $results as $messages ) {
449                                 if( !empty( $messages ) ) {
450                                         return false;
451                                 }
452                         }
453                 }
454                 return true;
455         }
456 }
457
458 /**
459  * @ingroup MaintenanceLanguage
460  */
461 class CheckExtensionsCLI extends CheckLanguageCLI {
462         private $extensions;
463
464         /**
465          * Constructor.
466          * @param $options Options for script.
467          * @param $extension The extension name (or names).
468          */
469         public function __construct( Array $options, $extension ) {
470                 if ( isset( $options['help'] ) ) {
471                         echo $this->help();
472                         exit(1);
473                 }
474
475                 if ( isset( $options['lang'] ) ) {
476                         $this->code = $options['lang'];
477                 } else {
478                         global $wgLanguageCode;
479                         $this->code = $wgLanguageCode;
480                 }
481
482                 if ( isset( $options['level'] ) ) {
483                         $this->level = $options['level'];
484                 }
485
486                 $this->doLinks = isset( $options['links'] );
487
488                 if ( isset( $options['wikilang'] ) ) {
489                         $this->wikiCode = $options['wikilang'];
490                 }
491
492                 if ( isset( $options['whitelist'] ) ) {
493                         $this->checks = explode( ',', $options['whitelist'] );
494                 } elseif ( isset( $options['blacklist'] ) ) {
495                         $this->checks = array_diff(
496                                 isset( $options['easy'] ) ? $this->easyChecks() : $this->defaultChecks(),
497                                 explode( ',', $options['blacklist'] )
498                         );
499                 } elseif ( isset( $options['easy'] ) ) {
500                         $this->checks = $this->easyChecks();
501                 } else {
502                         $this->checks = $this->defaultChecks();
503                 }
504
505                 if ( isset( $options['output'] ) ) {
506                         $this->output = $options['output'];
507                 }
508
509                 # Some additional checks not enabled by default
510                 if ( isset( $options['duplicate'] ) ) {
511                         $this->checks[] = 'duplicate';
512                 }
513
514                 $this->extensions = array();
515                 $extensions = new PremadeMediawikiExtensionGroups();
516                 $extensions->addAll();
517                 if ( $extension == 'all' ) {
518                         foreach ( MessageGroups::singleton()->getGroups() as $group ) {
519                                 if ( strpos( $group->getId(), 'ext-' ) === 0 && !$group->isMeta() ) {
520                                         $this->extensions[] = new extensionLanguages( $group );
521                                 }
522                         }
523                 } elseif ( $extension == 'wikimedia' ) {
524                         $wikimedia = MessageGroups::getGroup( 'ext-0-wikimedia' );
525                         foreach ( $wikimedia->wmfextensions() as $extension ) {
526                                 $group = MessageGroups::getGroup( $extension );
527                                 $this->extensions[] = new extensionLanguages( $group );
528                         }
529                 } elseif ( $extension == 'flaggedrevs' ) {
530                         foreach ( MessageGroups::singleton()->getGroups() as $group ) {
531                                 if ( strpos( $group->getId(), 'ext-flaggedrevs-' ) === 0 && !$group->isMeta() ) {
532                                         $this->extensions[] = new extensionLanguages( $group );
533                                 }
534                         }
535                 } else {
536                         $extensions = explode( ',', $extension );
537                         foreach ( $extensions as $extension ) {
538                                 $group = MessageGroups::getGroup( 'ext-' . $extension );
539                                 if ( $group ) {
540                                         $extension = new extensionLanguages( $group );
541                                         $this->extensions[] = $extension;
542                                 } else {
543                                         print "No such extension $extension.\n";
544                                 }
545                         }
546                 }
547         }
548
549         /**
550          * Get the default checks.
551          * @return A list of the default checks.
552          */
553         protected function defaultChecks() {
554                 return array(
555                         'untranslated', 'duplicate', 'obsolete', 'variables', 'empty', 'plural',
556                         'whitespace', 'xhtml', 'chars', 'links', 'unbalanced',
557                 );
558         }
559
560         /**
561          * Get the checks which check other things than messages.
562          * @return A list of the non-message checks.
563          */
564         protected function nonMessageChecks() {
565                 return array();
566         }
567
568         /**
569          * Get the checks that can easily be treated by non-speakers of the language.
570          * @return A list of the easy checks.
571          */
572         protected function easyChecks() {
573                 return array(
574                         'duplicate', 'obsolete', 'empty', 'whitespace', 'xhtml', 'chars',
575                 );
576         }
577
578         /**
579          * Get help.
580          * @return The help string.
581          */
582         protected function help() {
583                 return <<<ENDS
584 Run this script to check the status of a specific language in extensions, or all of them.
585 Command line settings are in form --parameter[=value], except for the first one.
586 Parameters:
587         * 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.
588         * lang: Language code (default: the installation default language).
589         * help: Show this help.
590         * level: Show the following display level (default: 2).
591         * links: Link the message values (default off).
592         * wikilang: For the links, what is the content language of the wiki to display the output in (default en).
593         * whitelist: Do only the following checks (form: code,code).
594         * blacklist: Do not perform the following checks (form: code,code).
595         * easy: Do only the easy checks, which can be treated by non-speakers of the language.
596 Check codes (ideally, all of them should result 0; all the checks are executed by default (except language-specific check blacklists in checkLanguage.inc):
597         * untranslated: Messages which are required to translate, but are not translated.
598         * duplicate: Messages which translation equal to fallback
599         * obsolete: Messages which are untranslatable, but translated.
600         * variables: Messages without variables which should be used, or with variables which should not be used.
601         * empty: Empty messages.
602         * whitespace: Messages which have trailing whitespace.
603         * xhtml: Messages which are not well-formed XHTML (checks only few common errors).
604         * chars: Messages with hidden characters.
605         * links: Messages which contains broken links to pages (does not find all).
606         * unbalanced: Messages which contains unequal numbers of opening {[ and closing ]}.
607 Display levels (default: 2):
608         * 0: Skip the checks (useful for checking syntax).
609         * 1: Show only the stub headers and number of wrong messages, without list of messages.
610         * 2: Show only the headers and the message keys, without the message values.
611         * 3: Show both the headers and the complete messages, with both keys and values.
612
613 ENDS;
614         }
615
616         /**
617          * Execute the script.
618          */
619         public function execute() {
620                 $this->doChecks();
621         }
622
623         /**
624          * Check a language and show the results.
625          * @param $code The language code.
626          */
627         protected function checkLanguage( $code ) {
628                 foreach( $this->extensions as $extension ) {
629                         $this->L = $extension;
630                         $this->results = array();
631                         $this->results[$code] = parent::checkLanguage( $code );
632
633                         if( !$this->isEmpty() ) {
634                                 echo $extension->name() . ":\n";
635
636                                 if( $this->level > 0 ) {
637                                         switch( $this->output ) {
638                                                 case 'plain':
639                                                         $this->outputText();
640                                                         break;
641                                                 case 'wiki':
642                                                         $this->outputWiki();
643                                                         break;
644                                                 default:
645                                                         throw new MWException( "Invalid output type $this->output" );
646                                         }
647                                 }
648
649                                 echo "\n";
650                         }
651                 }
652         }
653 }
654
655 # Blacklist some checks for some languages
656 $checkBlacklist = array(
657 #'code'        => array( 'check1', 'check2' ... )
658 'az'           => array( 'plural' ),
659 'bo'           => array( 'plural' ),
660 'dz'           => array( 'plural' ),
661 'id'           => array( 'plural' ),
662 'fa'           => array( 'plural' ),
663 'gan'          => array( 'plural' ),
664 'gan-hans'     => array( 'plural' ),
665 'gan-hant'     => array( 'plural' ),
666 'gn'           => array( 'plural' ),
667 'hak'          => array( 'plural' ),
668 'hu'           => array( 'plural' ),
669 'ja'           => array( 'plural' ), // Does not use plural
670 'jv'           => array( 'plural' ),
671 'ka'           => array( 'plural' ),
672 'kk-arab'      => array( 'plural' ),
673 'kk-cyrl'      => array( 'plural' ),
674 'kk-latn'      => array( 'plural' ),
675 'km'           => array( 'plural' ),
676 'kn'           => array( 'plural' ),
677 'ko'           => array( 'plural' ),
678 'lzh'          => array( 'plural' ),
679 'mn'           => array( 'plural' ),
680 'ms'           => array( 'plural' ),
681 'my'           => array( 'plural', 'chars' ),  // Uses a lot zwnj
682 'sah'          => array( 'plural' ),
683 'sq'           => array( 'plural' ),
684 'tet'          => array( 'plural' ),
685 'th'           => array( 'plural' ),
686 'to'           => array( 'plural' ),
687 'tr'           => array( 'plural' ),
688 'vi'           => array( 'plural' ),
689 'wuu'          => array( 'plural' ),
690 'xmf'          => array( 'plural' ),
691 'yo'           => array( 'plural' ),
692 'yue'          => array( 'plural' ),
693 'zh'           => array( 'plural' ),
694 'zh-classical' => array( 'plural' ),
695 'zh-cn'        => array( 'plural' ),
696 'zh-hans'      => array( 'plural' ),
697 'zh-hant'      => array( 'plural' ),
698 'zh-hk'        => array( 'plural' ),
699 'zh-sg'        => array( 'plural' ),
700 'zh-tw'        => array( 'plural' ),
701 'zh-yue'       => array( 'plural' ),
702 );