r100344 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100343‎ | r100344 | r100345 >
Date:13:48, 20 October 2011
Author:liangent
Status:ok
Tags:
Comment:
Display friendly names of rights on Special:Gadgets
Modified paths:
  • /trunk/extensions/Gadgets/Gadgets.i18n.php (modified) (history)
  • /trunk/extensions/Gadgets/SpecialGadgets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Gadgets/Gadgets.i18n.php
@@ -33,7 +33,9 @@
3434 'gadgets-pagetext' => "Below is a list of special gadgets users can enable on their [[Special:Preferences|preferences page]], as defined by the [[MediaWiki:Gadgets-definition|definitions]].
3535 This overview provides easy access to the system message pages that define each gadget's description and code.",
3636 'gadgets-uses' => 'Uses',
37 - 'gadgets-required-rights' => 'Requires the {{PLURAL:$2|$1 right|following rights: $1}}.',
 37+ 'gadgets-required-rights' => 'Requires the following {{PLURAL:$2|right|rights}}:
 38+
 39+$1',
3840 'gadgets-default' => 'Enabled for everyone by default.',
3941 'gadgets-export' => 'Export',
4042 'gadgets-export-title' => 'Gadget export',
@@ -68,7 +70,7 @@
6971
7072 See [http://meta.wikimedia.org/wiki/Special:Gadgets Gadgets page in meta.wikimedia.org]",
7173 'gadgets-required-rights' => 'Parameters:
72 -* $1 - a list.
 74+* $1 - a list in wikitext.
7375 * $2 - the number of items in list $1 for PLURAL use.',
7476 'gadgets-export' => 'Used on [[Special:Gadgets]]. This is a verb, not noun.
7577 {{Identical|Export}}',
@@ -2775,7 +2777,9 @@
27762778 'gadgets-pagetext' => '以下是一个按照[[MediaWiki:Gadgets-definition]]定义的特殊小工具列表,用户可以在他们的参数设置页面中激活它们。
27772779 通过这个概览可以方便的获得系统信息页面,从而可以定义每个小工具的描述以及源码。',
27782780 'gadgets-uses' => '使用',
2779 - 'gadgets-required-rights' => '需要{{PLURAL:$2|$1权限|以下权限:$1}}.',
 2781+ 'gadgets-required-rights' => '需要以下{{PLURAL:$2|权限|权限}}:
 2782+
 2783+$1',
27802784 'gadgets-default' => '默认情况下启用的每个人。',
27812785 'gadgets-export' => '导出',
27822786 'gadgets-export-title' => '小工具出口',
@@ -2807,7 +2811,9 @@
28082812
28092813 這個概覽提供的系統資訊頁面的簡易存取,可以定義每個小工具的描述以及原始碼。',
28102814 'gadgets-uses' => '使用',
2811 - 'gadgets-required-rights' => '需要{{PLURAL:$2|$1權限|以下權限:$1}}。',
 2815+ 'gadgets-required-rights' => '需要以下{{PLURAL:$2|權限|權限}}:
 2816+
 2817+$1',
28122818 'gadgets-default' => '預設所有人啟用。',
28132819 'gadgets-export' => '匯出',
28142820 'gadgets-export-title' => '匯出小工具',
Index: trunk/extensions/Gadgets/SpecialGadgets.php
@@ -117,11 +117,14 @@
118118 $lnk[] = $skin->link( $t, htmlspecialchars( $t->getText() ) );
119119 }
120120 $wgOut->addHTML( $wgLang->commaList( $lnk ) );
121 - $rights = $gadget->getRequiredRights();
 121+ $rights = array();
 122+ foreach ( $gadget->getRequiredRights() as $right ) {
 123+ $rights[] = '* ' . wfMessage( "right-$right" )->plain();
 124+ }
122125
123126 if ( count( $rights ) ) {
124127 $wgOut->addHTML( '<br />' .
125 - wfMessage( 'gadgets-required-rights', $wgLang->commaList( $rights ), count( $rights ) )->parse()
 128+ wfMessage( 'gadgets-required-rights', implode( "\n", $rights ), count( $rights ) )->parse()
126129 );
127130 }
128131

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85268Gadgets: bug 12211 - show in preferences only gadgets the user is able to usemaxsem19:01, 3 April 2011

Status & tagging log