https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112666
Revision: 112666
Author: santhosh
Date: 2012-02-29 04:05:10 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
Special:Translation should not show messages if the language is prevented from
translation to the selected language.
Show warning that translation to a language is discouraged by translation
admin.
Show the reason for language preference if translation admin provided it.
Minor whitespace fixes.
Modified Paths:
--------------
trunk/extensions/Translate/PageTranslation.i18n.php
trunk/extensions/Translate/specials/SpecialTranslate.php
Modified: trunk/extensions/Translate/PageTranslation.i18n.php
===================================================================
--- trunk/extensions/Translate/PageTranslation.i18n.php 2012-02-29 01:52:47 UTC
(rev 112665)
+++ trunk/extensions/Translate/PageTranslation.i18n.php 2012-02-29 04:05:10 UTC
(rev 112666)
@@ -93,6 +93,8 @@
'tpt-unknown-page' => 'This namespace is reserved for content page
translations.
The page you are trying to edit does not seem to correspond any page marked
for translation.',
'tpt-translation-restricted' => 'Translation of this group to this
language has been prevented by translation administrator.',
+ 'tpt-discouraged-language-force' => 'Translation administrator
prevented translation of this group to this language.',
+ 'tpt-discouraged-language' => 'Translation administrator discourage
translation of this group to this language.',
'tpt-render-summary' => 'Updating to match new version of source page',
@@ -243,6 +245,8 @@
'tpt-languages-legend' => 'The caption of a language selector displayed
using <code><languages /></code>, e.g. on [[Project list]].',
'tpt-languages-separator' => '{{optional}}',
'tpt-translation-restricted' => 'Error message shown to user when
translation to a language which is restricted by translation admin.',
+ 'tpt-discouraged-language-force' => 'Warning shown along with group
description if the language is prevented from translation for the selected
language',
+ 'tpt-discouraged-language' => 'Warning shown along with group
description if the language is discouraged from translation for the selected
language',
'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.',
'pt-shake-multiple' => 'Each translation (=section) unit can only
contain one marker.',
'pt-shake-empty' => 'Translation unit (=section) is empty except for
the translation marker (=<nowiki><!--T:1--></nowiki>)',
Modified: trunk/extensions/Translate/specials/SpecialTranslate.php
===================================================================
--- trunk/extensions/Translate/specials/SpecialTranslate.php 2012-02-29
01:52:47 UTC (rev 112665)
+++ trunk/extensions/Translate/specials/SpecialTranslate.php 2012-02-29
04:05:10 UTC (rev 112666)
@@ -140,7 +140,17 @@
if ( $status !== false ) {
$description = $status . $description;
}
-
+ $priorityLangs = array_flip( explode( ',',
TranslateMetadata::get( $this->group->getId(), 'prioritylangs' ) ) );
+ $priorityForce = TranslateMetadata::get(
$this->group->getId(), 'priorityforce' );
+ if ( count( $priorityLangs ) > 0 && !isset(
$priorityLangs[$this->options['language']] ) ) {
+ $priorityReason = TranslateMetadata::get(
$this->group->getId(), 'priorityreason' );
+ if ( $priorityForce == 'on' ) {
+ $this->paging['count'] = 0;
+ $description .= '<p>' . wfMsg(
'tpt-discouraged-language-force' ) . '</p>' . $priorityReason ;
+ } else {
+ $description .= '<p>' . wfMsg(
'tpt-discouraged-language' ) . '</p>' . $priorityReason;
+ }
+ }
if ( $description ) {
$description = Xml::fieldset( wfMsg(
'translate-page-description-legend' ), $description );
}
@@ -149,7 +159,7 @@
if ( $this->paging['count'] === 0 ) {
$wgOut->addHTML( $description . $links );
- } elseif( $this->paging['count'] ===
$this->paging['total'] ) {
+ } elseif ( $this->paging['count'] ===
$this->paging['total'] ) {
$wgOut->addHTML( $description . $output .
$links );
} else {
$wgOut->addHTML( $description . $links .
$output . $links );
@@ -214,7 +224,7 @@
} else {
$defaults['task'] = 'reviewall';
}
- } elseif( $nondefaults['taction'] === 'export' ) {
+ } elseif ( $nondefaults['taction'] === 'export' ) {
$defaults['task'] = '';
}
}
@@ -655,7 +665,7 @@
if ( trim( $sub ) !== '' ) {
if ( $alias === 'Translate' || $alias ===
'MessageGroupStats' ) {
$params['group'] = $sub;
- } elseif( $alias === 'LanguageStats' ) {
+ } elseif ( $alias === 'LanguageStats' ) {
// Breaks if additional parameters besides
language are code provided
$params['language'] = $sub;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs