diff --git a/i18n/en.json b/i18n/en.json index dcb371b..fc7a918 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -21,6 +21,9 @@ "resourceloaderarticles-priority": "Priority", "resourceloaderarticles-id": "ID", + "resourceloaderarticles-resourcetype-script": "JavaScript", + "resourceloaderarticles-resourcetype-style": "Style Sheet", + "resourceloaderarticles-error-page-empty": "The page parameter cannot be empty!", "resourceloaderarticles-error-page-invalid": "The page name is invalid!", "resourceloaderarticles-error-priority-empty": "The priority parameter cannot be empty!", diff --git a/src/SpecialPage/SpecialResourceLoaderArticles.php b/src/SpecialPage/SpecialResourceLoaderArticles.php index cdf7c18..baeb486 100644 --- a/src/SpecialPage/SpecialResourceLoaderArticles.php +++ b/src/SpecialPage/SpecialResourceLoaderArticles.php @@ -83,7 +83,11 @@ private function listPages() { $deleteTitle = Title::newFromText( 'ResourceLoaderArticles/delete/' . $row->rla_id, NS_SPECIAL ); $editTitle = Title::newFromText( 'ResourceLoaderArticles/edit/' . $row->rla_id, NS_SPECIAL ); if ( $prevResType !== $row->rla_type ) { - $output->addHTML( "{ $row->rla_type }s" ); + $output->addHTML( + '' + . $this->msg( 'resourceloaderarticles-resourcetype-' . $row->rla_type )->text() + . '' + ); $prevResType = $row->rla_type; } $output->addHTML( @@ -121,9 +125,9 @@ private function addPage() { 'Type' => [ 'class' => 'HTMLSelectField', 'label' => 'Select an option', - 'options' => [ - 'JavaScript' => 'script', - 'CSS' => 'style', + 'options-messages' => [ + 'resourceloaderarticles-resourcetype-script' => 'script', + 'resourceloaderarticles-resourcetype-style' => 'style', ], ], 'Priority' => [ @@ -240,9 +244,9 @@ private function editPage( $id ) { 'Type' => [ 'class' => 'HTMLSelectField', 'label' => 'Select an option', - 'options' => [ - 'JavaScript' => 'script', - 'CSS' => 'style', + 'options-messages' => [ + 'resourceloaderarticles-resourcetype-script' => 'script', + 'resourceloaderarticles-resourcetype-style' => 'style', ], 'default' => $row->rla_type, ], @@ -366,9 +370,9 @@ private function deletePage( $id ) { 'Type' => [ 'class' => 'HTMLSelectField', 'label' => 'Select an option', - 'options' => [ - 'JavaScript' => 'script', - 'CSS' => 'style', + 'options-messages' => [ + 'resourceloaderarticles-resourcetype-script' => 'script', + 'resourceloaderarticles-resourcetype-style' => 'style', ], 'disabled' => true, 'default' => $row->rla_type,