r79808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79807‎ | r79808 | r79809 >
Date:06:13, 7 January 2011
Author:laner
Status:deferred
Tags:
Comment:
* Added missing array parameter for wfMsgExt calls
* Added messages for HTMLForm forms
Modified paths:
  • /trunk/extensions/OpenStackManager/OpenStackManager.i18n.php (modified) (history)
  • /trunk/extensions/OpenStackManager/SpecialNovaDomain.php (modified) (history)
  • /trunk/extensions/OpenStackManager/SpecialNovaInstance.php (modified) (history)
  • /trunk/extensions/OpenStackManager/SpecialNovaKey.php (modified) (history)
  • /trunk/extensions/OpenStackManager/SpecialNovaProject.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenStackManager/SpecialNovaInstance.php
@@ -227,7 +227,7 @@
228228 'section' => 'instance/puppetinfo',
229229 'options' => $classes,
230230 'default' => $defaults,
231 - 'label-message' => 'puppetclasses',
 231+ 'label-message' => 'openstackmanager-puppetclasses',
232232 );
233233 }
234234
@@ -252,7 +252,7 @@
253253 'default' => 'configure',
254254 );
255255
256 - $instanceForm = new SpecialNovaInstanceForm( $instanceInfo, 'novainstance-form' );
 256+ $instanceForm = new SpecialNovaInstanceForm( $instanceInfo, 'openstackmanager-novainstance' );
257257 $instanceForm->setTitle( SpecialPage::getTitleFor( 'NovaInstance' ) );
258258 $instanceForm->setSubmitID( 'novainstance-form-configureinstancesubmit' );
259259 $instanceForm->setSubmitCallback( array( $this, 'tryConfigureSubmit' ) );
@@ -270,7 +270,7 @@
271271 $instanceid = $wgRequest->getText( 'instanceid' );
272272 $project = $wgRequest->getText( 'project' );
273273 if ( ! $wgRequest->wasPosted() ) {
274 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deleteinstancequestion', $instanceid ) );
 274+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deleteinstancequestion', array(), $instanceid ) );
275275 $wgOut->addHTML( $out );
276276 }
277277 $instanceInfo = Array();
@@ -286,7 +286,7 @@
287287 'type' => 'hidden',
288288 'default' => 'delete',
289289 );
290 - $instanceForm = new SpecialNovaInstanceForm( $instanceInfo, 'novainstance-form' );
 290+ $instanceForm = new SpecialNovaInstanceForm( $instanceInfo, 'openstackmanager-novainstance' );
291291 $instanceForm->setTitle( SpecialPage::getTitleFor( 'NovaInstance' ) );
292292 $instanceForm->setSubmitID( 'novainstance-form-deleteinstancesubmit' );
293293 $instanceForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) );
@@ -332,19 +332,22 @@
333333 $instanceOut .= Html::element( 'td', array(), $instance->getInstanceType() );
334334 $instanceOut .= Html::element( 'td', array(), $instance->getInstancePrivateIP() );
335335 $instanceOut .= Html::element( 'td', array(), $instance->getImageId() );
336 - $actions = $sk->link( $this->getTitle(), 'delete', array(),
 336+ $msg = wfMsg( 'openstackmanager-delete' );
 337+ $actions = $sk->link( $this->getTitle(), $msg, array(),
337338 array( 'action' => 'delete',
338339 'project' => $project,
339340 'instanceid' => $instance->getInstanceId() ),
340341 array() );
341342 $actions .= ', ';
342 - $actions .= $sk->link( $this->getTitle(), 'rename', array(),
 343+ $msg = wfMsg( 'openstackmanager-rename' );
 344+ $actions .= $sk->link( $this->getTitle(), $msg, array(),
343345 array( 'action' => 'rename',
344346 'project' => $project,
345347 'instanceid' => $instance->getInstanceId() ),
346348 array() );
347349 $actions .= ', ';
348 - $actions .= $sk->link( $this->getTitle(), 'configure', array(),
 350+ $msg = wfMsg( 'openstackmanager-configure' );
 351+ $actions .= $sk->link( $this->getTitle(), $msg, array(),
349352 array( 'action' => 'configure',
350353 'project' => $project,
351354 'instanceid' => $instance->getInstanceId() ),
@@ -398,7 +401,7 @@
399402 $title = Title::newFromText( $wgOut->getPageTitle() );
400403 $job = new OpenStackNovaHostJob( $title, array( 'instanceid' => (string)$instance->getInstanceId() ) );
401404 $job->insert();
402 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-createdinstance',
 405+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-createdinstance', array(),
403406 $instance->getInstanceID(), $instance->getImageId(),
404407 $host->getFullyQualifiedHostName() ) );
405408 } else {
@@ -430,9 +433,9 @@
431434 if ( $success ) {
432435 $success = OpenStackNovaHost::deleteHostByInstanceId( $instanceid );
433436 if ( $success ) {
434 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedinstance', $instanceid ) );
 437+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedinstance', array(), $instanceid ) );
435438 } else {
436 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedinstance-faileddns', $instancename, $instanceid ) );
 439+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedinstance-faileddns', array(), $instancename, $instanceid ) );
437440 }
438441 } else {
439442 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-deleteinstancefailed' ) );
Index: trunk/extensions/OpenStackManager/SpecialNovaProject.php
@@ -61,7 +61,7 @@
6262 $projectInfo = Array();
6363 $projectInfo['projectname'] = array(
6464 'type' => 'text',
65 - 'label-message' => 'projectname',
 65+ 'label-message' => 'openstackmanager-projectname',
6666 'default' => '',
6767 'section' => 'project/info',
6868 );
@@ -71,7 +71,7 @@
7272 'default' => 'create',
7373 );
7474
75 - $projectForm = new SpecialNovaProjectForm( $projectInfo, 'novaprojectform' );
 75+ $projectForm = new SpecialNovaProjectForm( $projectInfo, 'openstackmanager-novaproject' );
7676 $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) );
7777 $projectForm->setSubmitID( 'novaproject-form-createprojectsubmit' );
7878 $projectForm->setSubmitCallback( array( $this, 'tryCreateSubmit' ) );
@@ -90,7 +90,7 @@
9191 $projectInfo = Array();
9292 $projectInfo['member'] = array(
9393 'type' => 'text',
94 - 'label-message' => 'member',
 94+ 'label-message' => 'openstackmanager-member',
9595 'default' => '',
9696 'section' => 'project/info',
9797 );
@@ -103,7 +103,7 @@
104104 'default' => $project,
105105 );
106106
107 - $projectForm = new SpecialNovaProjectForm( $projectInfo, 'novaprojectform' );
 107+ $projectForm = new SpecialNovaProjectForm( $projectInfo, 'openstackmanager-novaproject' );
108108 $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) );
109109 $projectForm->setSubmitID( 'novaproject-form-addmembersubmit' );
110110 $projectForm->setSubmitCallback( array( $this, 'tryAddMemberSubmit' ) );
@@ -121,7 +121,7 @@
122122 $member = $wgRequest->getText( 'member' );
123123 $project = $wgRequest->getText( 'projectname' );
124124 if ( ! $wgRequest->wasPosted() ) {
125 - $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removememberconfirm', $member, $project ) );
 125+ $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removememberconfirm', array(), $member, $project ) );
126126 $wgOut->addHTML( $out );
127127 }
128128 $projectInfo = Array();
@@ -138,7 +138,7 @@
139139 'default' => $project,
140140 );
141141
142 - $projectForm = new SpecialNovaProjectForm( $projectInfo, 'novaprojectform' );
 142+ $projectForm = new SpecialNovaProjectForm( $projectInfo, 'openstackmanager-novaproject' );
143143 $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) );
144144 $projectForm->setSubmitID( 'novaproject-form-deletemembersubmit' );
145145 $projectForm->setSubmitCallback( array( $this, 'tryDeleteMemberSubmit' ) );
@@ -155,7 +155,7 @@
156156
157157 $project = $wgRequest->getText( 'projectname' );
158158 if ( ! $wgRequest->wasPosted() ) {
159 - $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removeprojectconfirm', $project ) );
 159+ $out .= Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removeprojectconfirm', array(), $project ) );
160160 $wgOut->addHTML( $out );
161161 }
162162 $projectInfo = Array();
@@ -167,7 +167,7 @@
168168 'type' => 'hidden',
169169 'default' => 'delete',
170170 );
171 - $projectForm = new SpecialNovaProjectForm( $projectInfo, 'novaproject-form' );
 171+ $projectForm = new SpecialNovaProjectForm( $projectInfo, 'openstackmanager-novaproject' );
172172 $projectForm->setTitle( SpecialPage::getTitleFor( 'NovaProject' ) );
173173 $projectForm->setSubmitID( 'novaproject-form-deleteprojectsubmit' );
174174 $projectForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) );
@@ -186,9 +186,9 @@
187187 $out = '';
188188 $sk = $wgUser->getSkin();
189189 $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-createproject' ), array(), array( 'action' => 'create' ), array() );
190 - $projectsOut = Html::element( 'th', array(), 'Project name' );
191 - $projectsOut .= Html::element( 'th', array(), 'Members' );
192 - $projectsOut .= Html::element( 'th', array(), 'Action' );
 190+ $projectsOut = Html::element( 'th', array(), wfMsg( 'openstackmanager-projectname' ) );
 191+ $projectsOut .= Html::element( 'th', array(), wfMsg( 'openstackmanager-members' ) );
 192+ $projectsOut .= Html::element( 'th', array(), wfMsg( 'openstackmanager-actions' ) );
193193 $projects = OpenStackNovaProject::getAllProjects();
194194 if ( ! $projects ) {
195195 $projectsOut = '';
@@ -264,10 +264,10 @@
265265 $project = new OpenStackNovaProject( $formData['projectname'] );
266266 $success = $project->addMember( $formData['member'] );
267267 if ( $success ) {
268 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedto', $formData['member'],
 268+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-addedto', array(), $formData['member'],
269269 $formData['projectname'] ) );
270270 } else {
271 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoadd', $formData['member'],
 271+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoadd', array(), $formData['member'],
272272 $formData['projectname'] ) );
273273 }
274274 $out .= '<br />';
@@ -284,10 +284,10 @@
285285 $project = new OpenStackNovaProject( $formData['projectname'] );
286286 $success = $project->deleteMember( $formData['member'] );
287287 if ( $success ) {
288 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removedfrom', $formData['member'],
 288+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-removedfrom', array(), $formData['member'],
289289 $formData['projectname'] ) );
290290 } else {
291 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoremove', $formData['member'],
 291+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-failedtoremove', array(), $formData['member'],
292292 $formData['projectname'] ) );
293293 }
294294 $out .= '<br />';
Index: trunk/extensions/OpenStackManager/SpecialNovaDomain.php
@@ -47,19 +47,19 @@
4848 $domainInfo = Array();
4949 $domainInfo['domainname'] = array(
5050 'type' => 'text',
51 - 'label-message' => 'domainname',
 51+ 'label-message' => 'openstackmanager-domainname',
5252 'default' => '',
5353 'section' => 'domain/info',
5454 );
5555 $domainInfo['fqdn'] = array(
5656 'type' => 'text',
57 - 'label-message' => 'fqdn',
 57+ 'label-message' => 'openstackmanager-fqdn',
5858 'default' => '',
5959 'section' => 'domain/info',
6060 );
6161 $domainInfo['location'] = array(
6262 'type' => 'text',
63 - 'label-message' => 'location',
 63+ 'label-message' => 'openstackmanager-location',
6464 'default' => '',
6565 'section' => 'domain/info',
6666 );
@@ -68,7 +68,7 @@
6969 'default' => 'create',
7070 );
7171
72 - $domainForm = new SpecialNovaDomainForm( $domainInfo, 'novadomainform' );
 72+ $domainForm = new SpecialNovaDomainForm( $domainInfo, 'openstackmanager-novadomain' );
7373 $domainForm->setTitle( SpecialPage::getTitleFor( 'NovaDomain' ) );
7474 $domainForm->setSubmitID( 'novadomain-form-createdomainsubmit' );
7575 $domainForm->setSubmitCallback( array( $this, 'tryCreateSubmit' ) );
@@ -85,7 +85,7 @@
8686
8787 $domainname = $wgRequest->getText( 'domainname' );
8888 if ( ! $wgRequest->wasPosted() ) {
89 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedomain-confirm', $domainname ) );
 89+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-deletedomain-confirm', array(), $domainname ) );
9090 $wgOut->addHTML( $out );
9191 }
9292 $domainInfo = Array();
@@ -97,7 +97,7 @@
9898 'type' => 'hidden',
9999 'default' => 'delete',
100100 );
101 - $domainForm = new SpecialNovaDomainForm( $domainInfo, 'novadomain-form' );
 101+ $domainForm = new SpecialNovaDomainForm( $domainInfo, 'openstackmanager-novadomain' );
102102 $domainForm->setTitle( SpecialPage::getTitleFor( 'NovaDomain' ) );
103103 $domainForm->setSubmitID( 'novadomain-form-deletedomainsubmit' );
104104 $domainForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) );
@@ -116,10 +116,10 @@
117117 $out = '';
118118 $sk = $wgUser->getSkin();
119119 $out .= $sk->link( $this->getTitle(), wfMsg( 'openstackmanager-createdomain' ), array(), array( 'action' => 'create' ), array() );
120 - $domainsOut = Html::element( 'th', array(), 'Domain name' );
121 - $domainsOut .= Html::element( 'th', array(), 'FQDN' );
122 - $domainsOut .= Html::element( 'th', array(), 'Location' );
123 - $domainsOut .= Html::element( 'th', array(), 'Action' );
 120+ $domainsOut = Html::element( 'th', array(), wfMsg( 'openstackmanager-domainname' ) );
 121+ $domainsOut .= Html::element( 'th', array(), wfMsg( 'openstackmanager-fqdn' ) );
 122+ $domainsOut .= Html::element( 'th', array(), wfMsg( 'openstackmanager-location' ) );
 123+ $domainsOut .= Html::element( 'th', array(), wfMsg( 'openstackmanager-actions' ) );
124124 $domains = OpenStackNovaDomain::getAllDomains();
125125 foreach ( $domains as $domain ) {
126126 $domainName = $domain->getDomainName();
@@ -128,7 +128,8 @@
129129 $domainOut = Html::element( 'td', array(), $domainName );
130130 $domainOut .= Html::element( 'td', array(), $fqdn );
131131 $domainOut .= Html::element( 'td', array(), $location );
132 - $link = $sk->link( $this->getTitle(), 'delete domain', array(),
 132+ $msg = wfMsg( 'openstackmanager-delete' );
 133+ $link = $sk->link( $this->getTitle(), $msg, array(),
133134 array( 'action' => 'delete', 'domainname' => $domainName ), array() );
134135 $domainOut .= Html::rawElement( 'td', array(), $link );
135136 $domainsOut .= Html::rawElement( 'tr', array(), $domainOut );
Index: trunk/extensions/OpenStackManager/OpenStackManager.i18n.php
@@ -22,6 +22,15 @@
2323 'openstackmanager-instance' => 'Manage Instance',
2424 'openstackmanager-title' => 'OpenStackManager',
2525
 26+ 'novadomain' => 'Nova Domain',
 27+ 'novainstance' => 'Nova Instance',
 28+ 'novakey' => 'Nova Key',
 29+ 'novaproject' => 'Nova Project',
 30+
 31+ 'openstackmanager-delete' => 'delete',
 32+ 'openstackmanager-configure' => 'configure',
 33+ 'openstackmanager-rename' => 'rename',
 34+ 'openstackmanager-actions' => 'Actions',
2635 'openstackmanager-notloggedin' => 'Not logged in',
2736 'openstackmanager-mustbeloggedin' => '<p>You must be logged in to perform this action</p>',
2837 'openstackmanager-nonovacred' => 'No Nova credentials found for your account',
@@ -32,6 +41,8 @@
3342
3443 'openstackmanager-deletedomain' => 'Delete domain',
3544 'openstackmanager-deletedomain-confirm' => 'Are you sure you wish to delete domain "$1"? This action has reprecusions on all VMs. Do not take this action lightly!',
 45+ 'openstackmanager-novadomain-domain' => 'Domain',
 46+ 'openstackmanager-novadomain-info' => 'Domain Information',
3647
3748 'openstackmanager-createdomainfailed' => 'Failed to create domain',
3849 'openstackmanager-createddomain' => 'Created domain',
@@ -39,6 +50,9 @@
4051 'openstackmanager-backdomainlist' => 'Back to domain list',
4152 'openstackmanager-deleteddomain' => 'Successfully deleted domain',
4253 'openstackmanager-failedeletedomain' => 'Failed to delete domain',
 54+ 'openstackmanager-domainname' => 'Domain Name',
 55+ 'openstackmanager-fqdn' => 'Fully Qualified Domain Name',
 56+ 'openstackmanager-location' => 'Location',
4357
4458 'openstackmanager-novainstance-instance' => 'Instance',
4559 'openstackmanager-configureinstance' => 'Configure Instance',
@@ -54,15 +68,15 @@
5569 'openstackmanager-instanceid' => 'Instance ID',
5670 'openstackmanager-instancestate' => 'Instance State',
5771 'openstackmanager-instancetype' => 'Instance Type',
 72+ 'openstackmanager-instanceip' => 'Instance IP',
5873 'openstackmanager-availabilityzone' => 'Availability Zone',
5974 'openstackmanager-imageid' => 'Image ID',
6075 'openstackmanager-imagetype' => 'Image Type',
61 - 'openstackmanager-actions' => 'Actions',
6276
6377 'openstackmanager-createinstance' => 'Create a new instance',
6478 'openstackmanager-invaliddomain' => 'Requested domain is invalid',
6579
66 - 'openstackmanager-createdinstance' => 'Created instance $1 with image $2 and hostname $3 and ip $4',
 80+ 'openstackmanager-createdinstance' => 'Created instance $1 with image $2 and hostname $3',
6781 'openstackmanager-createfailedldap' => 'Failed to create instance as the host could not be added to LDAP',
6882 'openstackmanager-createinstancefailed' => 'Failed to create instance',
6983 'openstackmanager-backinstancelist' => 'Back to instance list',
@@ -94,6 +108,7 @@
95109 'openstackmanager-createproject' => 'Create a new project',
96110 'openstackmanager-projectname' => 'Project name',
97111 'openstackmanager-members' => 'Members',
 112+ 'openstackmanager-member' => 'Member',
98113 'openstackmanager-action' => 'Action',
99114 'openstackmanager-createproject' => 'Create project',
100115 'openstackmanager-createprojectfailed' => 'Failed to create project',
@@ -108,6 +123,8 @@
109124 'openstackmanager-removedfrom' => 'Successfully removed $1 from $2',
110125 'openstackmanager-failedtoremove' => 'Failed to remove $1 from $2',
111126 'openstackmanager-badinstancename' => 'Bad instance name provided. Instance names must start with a-z, and can only contain a-z, 0-9, and - characters.',
 127+ 'openstackmanager-novaproject-project' => 'Project',
 128+ 'openstackmanager-novaproject-info' => 'Project Information',
112129
113130 );
114131
Index: trunk/extensions/OpenStackManager/SpecialNovaKey.php
@@ -56,7 +56,7 @@
5757 if ( $wgOpenStackManagerNovaKeypairStorage == 'nova' ) {
5858 $keyInfo['keyname'] = array(
5959 'type' => 'text',
60 - 'label-message' => 'keyname',
 60+ 'label-message' => 'openstackmanager-keyname',
6161 'default' => '',
6262 'section' => 'key/info',
6363 );
@@ -66,7 +66,7 @@
6767 'type' => 'textarea',
6868 'section' => 'key/info',
6969 'default' => '',
70 - 'label-message' => 'key',
 70+ 'label-message' => 'openstackmanager-key',
7171 );
7272
7373 $keyInfo['action'] = array(
@@ -79,7 +79,7 @@
8080 'default' => htmlentities( $project ),
8181 );
8282
83 - $keyForm = new SpecialNovaKeyForm( $keyInfo, 'novakey-form' );
 83+ $keyForm = new SpecialNovaKeyForm( $keyInfo, 'openstackmanager-novakey' );
8484 $keyForm->setTitle( SpecialPage::getTitleFor( 'NovaKey' ) );
8585 $keyForm->setSubmitID( 'novakey-form-createkeysubmit' );
8686 $keyForm->setSubmitCallback( array( $this, 'tryImportSubmit' ) );
@@ -132,7 +132,7 @@
133133 'type' => 'hidden',
134134 'default' => 'delete',
135135 );
136 - $keyForm = new SpecialNovaKeyForm( $keyInfo, 'novakey-form' );
 136+ $keyForm = new SpecialNovaKeyForm( $keyInfo, 'openstackmanager-novakey' );
137137 $keyForm->setTitle( SpecialPage::getTitleFor( 'NovaKey' ) );
138138 $keyForm->setSubmitID( 'novakey-form-deletekeysubmit' );
139139 $keyForm->setSubmitCallback( array( $this, 'tryDeleteSubmit' ) );
@@ -176,7 +176,8 @@
177177 $keysOut = '';
178178 foreach ( $keypairs as $hash => $key ) {
179179 $keyOut = Html::element( 'td', array(), $key );
180 - $link = $sk->link( $this->getTitle(), 'delete', array(), array( 'action' => 'delete', 'hash' => $hash ), array() );
 180+ $msg = wfMsg( 'openstackmanager-delete' );
 181+ $link = $sk->link( $this->getTitle(), $msg, array(), array( 'action' => 'delete', 'hash' => $hash ), array() );
181182 $keyOut .= Html::rawElement( 'td', array(), $link );
182183 $keysOut .= Html::rawElement( 'tr', array(), $keyOut );
183184 }
@@ -206,7 +207,7 @@
207208 # of this option isn't currently recommended
208209 $keypair = $this->userNova->importKeypair( $formData['keyname'], $formData['key'] );
209210
210 - $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-keypairimportedfingerprint',
 211+ $out = Html::element( 'p', array(), wfMsgExt( 'openstackmanager-keypairimportedfingerprint', array(),
211212 $keypair->getKeyName(), $keypair->getKeyFingerprint() ) );
212213 } else {
213214 $out = Html::element( 'p', array(), wfMsg( 'openstackmanager-invalidkeypair' ) );

Status & tagging log