Index: trunk/extensions/CategoryTree/CategoryTree.i18n.php |
— | — | @@ -38,7 +38,11 @@ |
39 | 39 | 'categorytree-page-bullet' => ' ', # do not translate or duplicate this message to other languages |
40 | 40 | |
41 | 41 | 'categorytree-member-counts' => 'contains {{PLURAL:$1|1 subcategory|$1 subcategories}}, {{PLURAL:$2|1 page|$2 pages}}, and {{PLURAL:$3|1 file|$3 files}}', # $1=subcategories, $2=subpages, $3=files, $4=total, $5=shown-in-tree |
42 | | - 'categorytree-member-num' => '($5)', # do not translate or duplicate this message to other languages |
| 42 | + 'categorytree-member-num' => '($5)', # do not translate or duplicate this message to other languages |
| 43 | + 'categorytree-num-categories' => '$1 C', |
| 44 | + 'categorytree-num-pages' => '$1 P', |
| 45 | + 'categorytree-num-files' => '$1 F', |
| 46 | + 'categorytree-num-empty' => 'empty', |
43 | 47 | |
44 | 48 | 'categorytree-load' => 'load', |
45 | 49 | 'categorytree-loading' => 'loading…', |
— | — | @@ -63,6 +67,7 @@ |
64 | 68 | * @author Yekrats |
65 | 69 | * @author Александр Сигачёв |
66 | 70 | * @author פוילישער |
| 71 | + * @author Amire80 |
67 | 72 | */ |
68 | 73 | $messages['qqq'] = array( |
69 | 74 | 'categorytree' => 'Title of [[Special:CategoryTree]]', |
— | — | @@ -91,6 +96,11 @@ |
92 | 97 | * $4 = total number of members, |
93 | 98 | * $5 = members to be shown in the tree, depending on mode. |
94 | 99 | Use with <nowiki>{{PLURAL}}</nowiki>', |
| 100 | + 'categorytree-member-num' => 'Do not translate or duplicate this message to other languages. It can be customized locally on a wiki.', |
| 101 | + 'categorytree-num-categories' => 'Number of sub-categories in a category. The word "categories" should be abbreviated. Appears in brackets after a name of an empty category. This message supports PLURAL.', |
| 102 | + 'categorytree-num-pages' => 'Number of pages in a category. The word "pages" should be abbreviated. Appears in brackets after a name of an empty category. This message supports PLURAL.', |
| 103 | + 'categorytree-num-files' => 'Number of sub-categories in a category. The word "files" should be abbreviated. Appears in brackets after a name of an empty category. This message supports PLURAL.', |
| 104 | + 'categorytree-num-empty' => 'The word "empty", as in "empty category". Appears in brackets after a name of an empty category.', |
95 | 105 | 'categorytree-load' => '{{Identical|Load}} |
96 | 106 | |
97 | 107 | Tooltip for the "expend" button, if the content was not yet loaded', |
— | — | @@ -1654,6 +1664,10 @@ |
1655 | 1665 | 'categorytree-collapse' => 'כיווץ', |
1656 | 1666 | 'categorytree-expand' => 'הרחבה', |
1657 | 1667 | 'categorytree-member-counts' => 'כוללת {{PLURAL:$1|קטגוריית משנה אחת|$1 קטגוריות משנה}}, {{PLURAL:$2|דף אחד|$2 דפים}}, ו{{PLURAL:$3|קובץ אחד|־$3 קבצים}}', |
| 1668 | + 'categorytree-num-categories' => '{{PLURAL:$1|קט אחת|$1 קט}}', |
| 1669 | + 'categorytree-num-pages' => '{{PLURAL:$1|דף אחד|$1 דפים}}', |
| 1670 | + 'categorytree-num-files' => '{{PLURAL:$1|קובץ אחד|$1 קב}}', |
| 1671 | + 'categorytree-num-empty' => 'ריקה', |
1658 | 1672 | 'categorytree-load' => 'טעינה', |
1659 | 1673 | 'categorytree-loading' => 'בטעינה', |
1660 | 1674 | 'categorytree-nothing-found' => 'לא נמצאו תוצאות', |
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php |
— | — | @@ -650,12 +650,31 @@ |
651 | 651 | if ( $count !== false && $this->getOption( 'showcount' ) ) { |
652 | 652 | $pages = $pageCount - $subcatCount - $fileCount; |
653 | 653 | |
| 654 | + global $wgContLang, $wgLang; |
654 | 655 | $attr = array( |
655 | | - 'title' => wfMsgExt( 'categorytree-member-counts', 'parsemag', $subcatCount, $pages , $fileCount, $pageCount, $count ) |
| 656 | + 'title' => wfMsgExt( 'categorytree-member-counts', 'parsemag', $subcatCount, $pages , $fileCount, $pageCount, $count ), |
| 657 | + 'dir' => $wgLang->getDir() # numbers and commas get messed up in a mixed dir env |
656 | 658 | ); |
657 | 659 | |
658 | | - global $wgContLang, $wgLang; |
659 | 660 | $s .= $wgContLang->getDirMark() . ' '; |
| 661 | + |
| 662 | + # Create a list of category members with only non-zero member counts |
| 663 | + $memberNums = array(); |
| 664 | + if ( $subcatCount ) { |
| 665 | + $memberNums[] = wfMessage( 'categorytree-num-categories', $wgLang->formatNum( $subcatCount ) )->text(); |
| 666 | + } |
| 667 | + if ( $pageCount ) { |
| 668 | + $memberNums[] = wfMessage( 'categorytree-num-pages', $wgLang->formatNum( $pageCount ) )->text(); |
| 669 | + } |
| 670 | + if ( $fileCount ) { |
| 671 | + $memberNums[] = wfMessage( 'categorytree-num-files', $wgLang->formatNum( $fileCount ) )->text(); |
| 672 | + } |
| 673 | + $memberNumsShort = $memberNums |
| 674 | + ? $wgLang->commaList( $memberNums ) |
| 675 | + : wfMessage( 'categorytree-num-empty' )->text(); |
| 676 | + |
| 677 | + # Only $5 is actually used in the default message. |
| 678 | + # Other arguments can be used in a customized message. |
660 | 679 | $s .= Xml::tags( 'span', $attr, |
661 | 680 | wfMsgExt( 'categorytree-member-num', |
662 | 681 | array( 'parsemag', 'escapenoentities' ), |
— | — | @@ -663,7 +682,7 @@ |
664 | 683 | $pages, |
665 | 684 | $fileCount, |
666 | 685 | $pageCount, |
667 | | - $wgLang->formatNum( $count ) ) ); |
| 686 | + $memberNumsShort ) ); |
668 | 687 | } |
669 | 688 | |
670 | 689 | $s .= Xml::closeElement( 'div' ); |