r111866 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111865‎ | r111866 | r111867 >
Date:15:16, 19 February 2012
Author:siebrand
Status:resolved (Comments)
Tags:i18nreview 
Comment:
Remove 1.17 compatibility code.
Modified paths:
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/TranslateHooks.php (modified) (history)
  • /trunk/extensions/Translate/specials/SpecialImportTranslations.php (modified) (history)
  • /trunk/extensions/Translate/tag/PageTranslationHooks.php (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/tag/PageTranslationHooks.php
@@ -203,12 +203,7 @@
204204
205205 $options = $parser->getOptions();
206206
207 - if ( method_exists( $options, 'getUserLang' ) ) {
208 - $userLangCode = $options->getUserLang();
209 - } else { // Backward compat for MediaWiki 1.17
210 - global $wgLang;
211 - $userLangCode = $wgLang->getCode();
212 - }
 207+ $userLangCode = $options->getUserLang();
213208
214209 // BC for <1.19
215210 $linker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker;
Index: trunk/extensions/Translate/Translate.php
@@ -269,13 +269,6 @@
270270 'scripts' => 'resources/jquery.autoresize.js',
271271 ) + $resourcePaths;
272272
273 -// Doesn't exist in 1.17, but declaring twice causes an error
274 -if ( version_compare( $wgVersion, '1.18', '<' ) ) {
275 -$wgResourceModules['jquery.form'] = array(
276 - 'scripts' => 'resources/jquery.form.js',
277 -) + $resourcePaths;
278 -}
279 -
280273 /** @endcond */
281274
282275
Index: trunk/extensions/Translate/TranslateHooks.php
@@ -84,10 +84,6 @@
8585 define( 'NS_TRANSLATIONS_TALK', $wgPageTranslationNamespace + 1 );
8686 }
8787
88 - if ( version_compare( $wgVersion, '1.17alpha', '<' ) ) {
89 - efTranslateNamespaces( $wgExtraNamespaces );
90 - }
91 -
9288 $wgNamespacesWithSubpages[NS_TRANSLATIONS] = true;
9389 $wgNamespacesWithSubpages[NS_TRANSLATIONS_TALK] = true;
9490
Index: trunk/extensions/Translate/README
@@ -30,6 +30,8 @@
3131 https://translatewiki.net/docs/Translate/html/
3232
3333 == Change log ==
 34+* 2012-02-19
 35+- MediaWiki 1.18 or later is now required.
3436 * 2012-02-13
3537 - Updated some deprecated function calls
3638 - New translation memory called TTMServer comes with the extension and is enabled
Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -1376,13 +1376,6 @@
13771377
13781378 public static function addModules( OutputPage $out ) {
13791379 $out->addModules( 'ext.translate.quickedit' );
1380 -
1381 - // Might be needed, but ajax doesn't load it
1382 - // Globals :(
1383 - /// @todo: remove when 1.17 is no longer supported.
1384 - // The RL module name is different in 1.17 and >1.17
1385 - $diff = new DifferenceEngine;
1386 - $diff->showDiffStyle();
13871380 }
13881381
13891382 /// @since 2012-01-04
Index: trunk/extensions/Translate/specials/SpecialImportTranslations.php
@@ -158,9 +158,6 @@
159159 $this->request->getText( 'upload-type' ) === 'wiki' ) .
160160 "\n" . Xml::closeElement( 'td' ) . Xml::openElement( 'td' ) . "\n" .
161161 Xml::input( 'upload-wiki', 50,
162 - /**
163 - * @todo Needs i18n in content language.
164 - */
165162 $this->request->getText( 'upload-wiki', 'File:' ),
166163 array( 'id' => 'mw-translate-up-wiki-input' ) + $class ) .
167164 "\n" . Xml::closeElement( 'td' ) . Xml::closeElement( 'tr' ) .

Follow-up revisions

RevisionCommit summaryAuthorDate
r111994Partial revert of r111866: utils\TranslationHelpers.php change was based on a...siebrand09:26, 21 February 2012

Comments

#Comment by Nikerabbit (talk | contribs)   07:14, 20 February 2012

Couldn't we have waited for 1.19 to be released? Userbase is still running 1.17.

Also broke diffs in Special:Translations.

#Comment by Siebrand (talk | contribs)   09:25, 21 February 2012

I've rolled back the change in utils/TranslationHelpers.php which broke the diffs, without adding the 1.17 remark. AFAIK we're keeping BC for the latest stable version and trunk, so 1.17 had to go.

#Comment by Nikerabbit (talk | contribs)   14:14, 21 February 2012

I was extending it to two stable version, but maybe 1.5 stable versions is enough for now.

Status & tagging log