Index: trunk/extensions/Translate/PageTranslation.i18n.php |
— | — | @@ -93,6 +93,8 @@ |
94 | 94 | 'tpt-unknown-page' => 'This namespace is reserved for content page translations. |
95 | 95 | The page you are trying to edit does not seem to correspond any page marked for translation.', |
96 | 96 | 'tpt-translation-restricted' => 'Translation of this group to this language has been prevented by translation administrator.', |
| 97 | + 'tpt-discouraged-language-force' => 'Translation administrator prevented translation of this group to this language.', |
| 98 | + 'tpt-discouraged-language' => 'Translation administrator discourage translation of this group to this language.', |
97 | 99 | |
98 | 100 | 'tpt-render-summary' => 'Updating to match new version of source page', |
99 | 101 | |
— | — | @@ -243,6 +245,8 @@ |
244 | 246 | 'tpt-languages-legend' => 'The caption of a language selector displayed using <code><languages /></code>, e.g. on [[Project list]].', |
245 | 247 | 'tpt-languages-separator' => '{{optional}}', |
246 | 248 | 'tpt-translation-restricted' => 'Error message shown to user when translation to a language which is restricted by translation admin.', |
| 249 | + 'tpt-discouraged-language-force' => 'Warning shown along with group description if the language is prevented from translation for the selected language', |
| 250 | + 'tpt-discouraged-language' => 'Warning shown along with group description if the language is discouraged from translation for the selected language', |
247 | 251 | 'pt-parse-open' => '"Translation template" is the structure of a translation page, where the place for the translations of each section is marked with a placeholder.', |
248 | 252 | 'pt-shake-multiple' => 'Each translation (=section) unit can only contain one marker.', |
249 | 253 | 'pt-shake-empty' => 'Translation unit (=section) is empty except for the translation marker (=<nowiki><!--T:1--></nowiki>)', |
Index: trunk/extensions/Translate/specials/SpecialTranslate.php |
— | — | @@ -140,7 +140,17 @@ |
141 | 141 | if ( $status !== false ) { |
142 | 142 | $description = $status . $description; |
143 | 143 | } |
144 | | - |
| 144 | + $priorityLangs = array_flip( explode( ',', TranslateMetadata::get( $this->group->getId(), 'prioritylangs' ) ) ); |
| 145 | + $priorityForce = TranslateMetadata::get( $this->group->getId(), 'priorityforce' ); |
| 146 | + if ( count( $priorityLangs ) > 0 && !isset( $priorityLangs[$this->options['language']] ) ) { |
| 147 | + $priorityReason = TranslateMetadata::get( $this->group->getId(), 'priorityreason' ); |
| 148 | + if ( $priorityForce == 'on' ) { |
| 149 | + $this->paging['count'] = 0; |
| 150 | + $description .= '<p>' . wfMsg( 'tpt-discouraged-language-force' ) . '</p>' . $priorityReason ; |
| 151 | + } else { |
| 152 | + $description .= '<p>' . wfMsg( 'tpt-discouraged-language' ) . '</p>' . $priorityReason; |
| 153 | + } |
| 154 | + } |
145 | 155 | if ( $description ) { |
146 | 156 | $description = Xml::fieldset( wfMsg( 'translate-page-description-legend' ), $description ); |
147 | 157 | } |
— | — | @@ -149,7 +159,7 @@ |
150 | 160 | |
151 | 161 | if ( $this->paging['count'] === 0 ) { |
152 | 162 | $wgOut->addHTML( $description . $links ); |
153 | | - } elseif( $this->paging['count'] === $this->paging['total'] ) { |
| 163 | + } elseif ( $this->paging['count'] === $this->paging['total'] ) { |
154 | 164 | $wgOut->addHTML( $description . $output . $links ); |
155 | 165 | } else { |
156 | 166 | $wgOut->addHTML( $description . $links . $output . $links ); |
— | — | @@ -214,7 +224,7 @@ |
215 | 225 | } else { |
216 | 226 | $defaults['task'] = 'reviewall'; |
217 | 227 | } |
218 | | - } elseif( $nondefaults['taction'] === 'export' ) { |
| 228 | + } elseif ( $nondefaults['taction'] === 'export' ) { |
219 | 229 | $defaults['task'] = ''; |
220 | 230 | } |
221 | 231 | } |
— | — | @@ -655,7 +665,7 @@ |
656 | 666 | if ( trim( $sub ) !== '' ) { |
657 | 667 | if ( $alias === 'Translate' || $alias === 'MessageGroupStats' ) { |
658 | 668 | $params['group'] = $sub; |
659 | | - } elseif( $alias === 'LanguageStats' ) { |
| 669 | + } elseif ( $alias === 'LanguageStats' ) { |
660 | 670 | // Breaks if additional parameters besides language are code provided |
661 | 671 | $params['language'] = $sub; |
662 | 672 | } |