Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -405,6 +405,12 @@ |
406 | 406 | |
407 | 407 | # Startup code |
408 | 408 | |
| 409 | +if ( class_exists( 'ResourceLoader' ) ) { |
| 410 | + ResourceLoader::register( array( 'translate-css' => |
| 411 | + new ResourceLoaderFileModule( array( 'styles' => 'extensions/Translate/Translate.css' ) ) |
| 412 | + ) ); |
| 413 | +} |
| 414 | + |
409 | 415 | function efTranslateNamespaces( &$list ) { |
410 | 416 | global $wgPageTranslationNamespace; |
411 | 417 | if ( !defined( 'NS_TRANSLATIONS' ) ) { |
Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -359,16 +359,20 @@ |
360 | 360 | * Injects extension css (only once). |
361 | 361 | */ |
362 | 362 | public static function injectCSS() { |
| 363 | + global $wgOut; |
| 364 | + |
| 365 | + if ( class_exists( 'ResourceLoader' ) ) { |
| 366 | + $wgOut->addModuleStyles( 'translate-css' ); |
| 367 | + return true; |
| 368 | + } |
| 369 | + |
363 | 370 | static $done = false; |
364 | 371 | |
365 | | - if ( $done ) { |
366 | | - return; |
| 372 | + if ( !$done ) { |
| 373 | + $wgOut->addExtensionStyle( self::assetPath( 'Translate.css' ) ); |
367 | 374 | } |
368 | 375 | |
369 | | - $done = true; |
370 | | - |
371 | | - global $wgOut; |
372 | | - $wgOut->addExtensionStyle( self::assetPath( 'Translate.css' ) ); |
| 376 | + return $done = true; |
373 | 377 | } |
374 | 378 | |
375 | 379 | /** |