Amire80 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62402


Change subject: Fixes for empty interlanguage links list
......................................................................

Fixes for empty interlanguage links list

* Change the title near the icon to 'Language'.
* Remove the empty box in the Monobook skin.

Bug: 47972
Bug: 47967
Change-Id: Ie6930509ed7f200cf0bffda91b8d9fd58f1bed8b
---
M Resources.php
M UniversalLanguageSelector.i18n.php
M resources/js/ext.uls.interface.js
3 files changed, 22 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/02/62402/1

diff --git a/Resources.php b/Resources.php
index 4747205..0018022 100644
--- a/Resources.php
+++ b/Resources.php
@@ -75,6 +75,9 @@
                'ext.uls.displaysettings',
                'ext.uls.inputsettings',
        ),
+       'messages' => array(
+               'uls-plang-title-languages',
+       ),
        'position' => 'top',
 ) + $resourcePaths;
 
diff --git a/UniversalLanguageSelector.i18n.php 
b/UniversalLanguageSelector.i18n.php
index 811a1ab..9fcb9df 100644
--- a/UniversalLanguageSelector.i18n.php
+++ b/UniversalLanguageSelector.i18n.php
@@ -23,18 +23,24 @@
 /**
  * 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 shown.',
        'uls-select-content-language' => 'Main heading in the language selector 
popup.
 {{Identical|Select language}}',
 );
diff --git a/resources/js/ext.uls.interface.js 
b/resources/js/ext.uls.interface.js
index b685144..e0e8727 100644
--- a/resources/js/ext.uls.interface.js
+++ b/resources/js/ext.uls.interface.js
@@ -40,8 +40,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' );

-- 
To view, visit https://gerrit.wikimedia.org/r/62402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6930509ed7f200cf0bffda91b8d9fd58f1bed8b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to