Merge "Fixes for empty interlanguage links list"

This commit is contained in:
jenkins-bot
2013-05-07 12:56:55 +00:00
committed by Gerrit Code Review
3 changed files with 22 additions and 0 deletions

View File

@@ -75,6 +75,9 @@ $wgResourceModules['ext.uls.interface'] = array(
'ext.uls.displaysettings',
'ext.uls.inputsettings',
),
'messages' => array(
'uls-plang-title-languages',
),
'position' => 'top',
) + $resourcePaths;

View File

@@ -23,18 +23,24 @@ $messages = array();
/**
* English
* @author santhosh
* @author Amire80
*/
$messages['en'] = array(
'UniversalLanguageSelector' => 'Universal Language Selector',
'uls-desc' => 'Gives the user several ways to select a language and to adjust language settings',
'uls-plang-title-languages' => 'Languages',
);
/** Message documentation (Message documentation)
* @author Shirayuki
* @author Amire80
*/
$messages['qqq'] = array(
'UniversalLanguageSelector' => 'Extension name',
'uls-desc' => 'Extension description',
'uls-plang-title-languages' => 'A title for the are in the sidebar in which the interlanguage links are supposed to appear.
This title is shown when there are no interlanguage links there, but an icon that enables the ULS is shown.',
'uls-select-content-language' => 'Main heading in the language selector popup.
{{Identical|Select language}}',
);

View File

@@ -44,8 +44,21 @@
.addClass( 'uls-trigger' )
.attr( 'title', $.i18n( 'ext-uls-language-settings-title' ) )
);
// Remove the dummy link that was added to make sure that the section appears
$pLang.find( '.uls-p-lang-dummy' ).remove();
if ( !$pLang.find( 'div ul' ).children().length ) {
// Replace the title of the interlanguage links
// area if there are no interlanguage links
$pLang.find( 'h3' )
.text( mw.msg( 'uls-plang-title-languages' ) );
// Remove the empty box that appears in the monobook skin
if ( mw.config.get( 'skin' ) === 'monobook' ) {
$pLang.find( 'div.pBody' ).remove();
}
}
}
$ulsTrigger = $( '.uls-trigger' );