Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328542 )

Change subject: Make languageLabelDescriptionAliases work without ULS
......................................................................

Make languageLabelDescriptionAliases work without ULS

The way this code was loaded was weird. The JS is always loaded and
executed, but it did not do anything when ULS is not enabled. With this
patch I'm applying the same fallback we have in other places (most
notably summary lines): the language code in square brackets.

Change-Id: I72dd4cdcb3097a715712f278314fe74949a4360e
---
M 
repo/resources/wikibase.special/wikibase.special.languageLabelDescriptionAliases.js
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/42/328542/1

diff --git 
a/repo/resources/wikibase.special/wikibase.special.languageLabelDescriptionAliases.js
 
b/repo/resources/wikibase.special/wikibase.special.languageLabelDescriptionAliases.js
index 280f610..ce14230 100644
--- 
a/repo/resources/wikibase.special/wikibase.special.languageLabelDescriptionAliases.js
+++ 
b/repo/resources/wikibase.special/wikibase.special.languageLabelDescriptionAliases.js
@@ -9,10 +9,6 @@
        $( document ).ready( function () {
                var $lang, fields, fieldCount, autonyms, langWidget;
 
-               if ( !$.uls ) {
-                       return;
-               }
-
                $lang = $( document.getElementsByName( 'lang' ) ).closest( 
'.oo-ui-inputWidget' );
                if ( $lang.length === 0 ) {
                        return;
@@ -47,14 +43,14 @@
                        return;
                }
 
-               autonyms = $.uls.data.getAutonyms();
+               autonyms = $.uls ? $.uls.data.getAutonyms() : {};
                langWidget = OO.ui.infuse( $lang );
                $.each( fields, function ( i ) {
                        fields[ i ].$input = OO.ui.infuse( fields[ i ].$element 
).$input;
                } );
 
                function updatePlaceholders( value ) {
-                       var autonym = autonyms[ value ];
+                       var autonym = autonyms[ value ] || '[' + value + ']';
                        $.each( fields, function ( i ) {
                                var msg;
                                if ( autonym ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72dd4cdcb3097a715712f278314fe74949a4360e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>

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

Reply via email to