Index: trunk/extensions/Translate/TranslatePage.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | wfMemIn( __METHOD__ ); |
35 | 35 | wfLoadExtensionMessages( 'Translate' ); |
36 | 36 | TranslateUtils::injectCSS(); |
37 | | - global $wgOut; |
| 37 | + global $wgOut, $wgTranslateBlacklist; |
38 | 38 | |
39 | 39 | $this->setup(); |
40 | 40 | $this->setHeaders(); |
— | — | @@ -59,6 +59,20 @@ |
60 | 60 | if ( count($errors) ) { |
61 | 61 | wfMemOut( __METHOD__ ); |
62 | 62 | return; |
| 63 | + } else { |
| 64 | + $checks = array( |
| 65 | + $this->options['group'], |
| 66 | + strtok( $this->options['group'], '-' ), |
| 67 | + '*' |
| 68 | + ); |
| 69 | + |
| 70 | + foreach ( $checks as $check ) { |
| 71 | + $reason = @$wgTranslateBlacklist[$check][$this->options['language']]; |
| 72 | + if ( $reason !== null ) { |
| 73 | + $wgOut->addWikiMsg( self::MSG . 'disabled', $reason ); |
| 74 | + return; |
| 75 | + } |
| 76 | + } |
63 | 77 | } |
64 | 78 | |
65 | 79 | # Proceed |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'TRANSLATE_VERSION', '8.37' ); |
| 15 | +define( 'TRANSLATE_VERSION', '8.36' ); |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'name' => 'Translate', |
— | — | @@ -85,6 +85,28 @@ |
86 | 86 | /** Language code for special documentation language */ |
87 | 87 | $wgTranslateDocumentationLanguageCode = false; |
88 | 88 | |
| 89 | +/** |
| 90 | + * Two-dimensional array of languages that cannot be translated. |
| 91 | + * Input can be exact group name, first part before '-' or '*' for all. |
| 92 | + * Second dimension should be language code mapped to reason for disabling. |
| 93 | + * Reason is parsed as wikitext. |
| 94 | + * |
| 95 | + * Example: |
| 96 | + * $wgTranslateBlacklist = array( |
| 97 | + * '*' => array( // All groups |
| 98 | + * 'en' => 'English is the source language.', |
| 99 | + * ), |
| 100 | + * 'core' => array( // Exact group |
| 101 | + * 'mul' => 'Not a real language.', |
| 102 | + * ), |
| 103 | + * 'ext' => array( // Wildcard-like group |
| 104 | + * 'mul' => 'Not a real language', |
| 105 | + * ), |
| 106 | + * ); |
| 107 | + */ |
| 108 | + |
| 109 | +$wgTranslateBlacklist = array(); |
| 110 | + |
89 | 111 | /** AC = Available classes */ |
90 | 112 | $wgTranslateAC = array( |
91 | 113 | 'core' => 'CoreMessageGroup', |
— | — | @@ -144,12 +166,11 @@ |
145 | 167 | 'ext-didyoumean' => 'DidYouMeanMessageGroup', |
146 | 168 | 'ext-dismissablesitenotice' => 'DismissableSiteNoticeMessageGroup', |
147 | 169 | 'ext-doublewiki' => 'DoubleWikiMessageGroup', |
148 | | -'ext-dplforum' => 'DPLForumMessageGroup', |
149 | 170 | 'ext-duplicator' => 'DuplicatorMessageGroup', |
150 | 171 | 'ext-editcount' => 'EditcountMessageGroup', |
151 | 172 | 'ext-editmessages' => 'EditMessagesMessageGroup', |
152 | 173 | 'ext-editown' => 'EditOwnMessageGroup', |
153 | | -'ext-editsubpages' => 'EditSubpagesMessageGroup', |
| 174 | +'ext-editsubpages' => 'EditSubpagesMessageGroup', |
154 | 175 | 'ext-edituser' => 'EditUserMessageGroup', |
155 | 176 | 'ext-emailaddressimage' => 'EmailAddressImageMessageGroup', |
156 | 177 | 'ext-eval' => 'EvalMessageGroup', |
— | — | @@ -171,7 +192,6 @@ |
172 | 193 | 'ext-i18ntags' => 'I18nTagsMessageGroup', |
173 | 194 | 'ext-icon' => 'IconMessageGroup', |
174 | 195 | 'ext-imagemap' => 'ImageMapMessageGroup', |
175 | | -'ext-imagetagging' => 'ImageTaggingMessageGroup', |
176 | 196 | 'ext-importfreeimages' => 'ImportFreeImagesMessageGroup', |
177 | 197 | 'ext-importusers' => 'ImportUsersMessageGroup', |
178 | 198 | 'ext-inputbox' => 'InputBoxMessageGroup', |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -30,6 +30,10 @@ |
31 | 31 | 'translate-page-no-such-task' => 'Specified task was invalid.', |
32 | 32 | 'translate-page-no-such-group' => 'Specified group was invalid.', |
33 | 33 | |
| 34 | + 'translate-page-disabled' => "Translations to this language in this group has been disabled. Reason: |
| 35 | + |
| 36 | +''$1''", |
| 37 | + |
34 | 38 | 'translate-page-settings-legend' => 'Settings', |
35 | 39 | 'translate-page-task' => 'I want to', |
36 | 40 | 'translate-page-group' => 'Group', |