r112672 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112671‎ | r112672 | r112673 >
Date:09:21, 29 February 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Parse the messages and pass the reason as variable
Modified paths:
  • /trunk/extensions/Translate/PageTranslation.i18n.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialTranslate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/PageTranslation.i18n.php
@@ -97,9 +97,13 @@
9898 'tpt-unknown-page' => 'This namespace is reserved for content page translations.
9999 The page you are trying to edit does not seem to correspond any page marked for translation.',
100100 'tpt-translation-restricted' => 'Translation of this message group to this language has been prevented by translation administrator.',
101 - 'tpt-discouraged-language-force' => 'Translation administrator has limited the languages this message group can be translated to. This languages is not among those languegs.',
102 - 'tpt-discouraged-language' => 'This language is not among the priority languages set by translation administrator for this message group.',
 101+ 'tpt-discouraged-language-force' => 'Translation administrator has limited the languages this message group can be translated to. This languages is not among those languages.
103102
 103+Reason for limiting: $1',
 104+ 'tpt-discouraged-language' => 'This language is not among the priority languages set by translation administrator for this message group
 105+
 106+Reason for prioritization: $1',
 107+
104108 'tpt-render-summary' => 'Updating to match new version of source page',
105109
106110 'tpt-download-page' => 'Export page with translations',
Index: trunk/extensions/Translate/specials/SpecialTranslate.php
@@ -142,13 +142,14 @@
143143 }
144144 $priorityLangs = array_flip( explode( ',', TranslateMetadata::get( $this->group->getId(), 'prioritylangs' ) ) );
145145 $priorityForce = TranslateMetadata::get( $this->group->getId(), 'priorityforce' );
146 - if ( count( $priorityLangs ) > 0 && !isset( $priorityLangs[$this->options['language']] ) ) {
 146+ if ( !isset( $priorityLangs[$this->options['language']] ) ) {
147147 $priorityReason = TranslateMetadata::get( $this->group->getId(), 'priorityreason' );
148 - if ( $priorityForce == 'on' ) {
 148+ if ( $priorityForce === 'on' ) {
 149+ // Hide table
149150 $this->paging['count'] = 0;
150 - $description .= '<p>' . wfMsg( 'tpt-discouraged-language-force' ) . '</p>' . $priorityReason ;
 151+ $description .= wfMessage( 'tpt-discouraged-language-force', $priorityReason )->parseAsBlock();
151152 } else {
152 - $description .= '<p>' . wfMsg( 'tpt-discouraged-language' ) . '</p>' . $priorityReason;
 153+ $description .= wfMessage( 'tpt-discouraged-language', $priorityReason )->parseAsBlock();
153154 }
154155 }
155156 if ( $description ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112666Special:Translation should not show messages if the language is prevented fro...santhosh04:05, 29 February 2012
r112670Wording tweaks, ping r112667 and r112666nikerabbit08:36, 29 February 2012

Status & tagging log