Santhosh has uploaded a new change for review.

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

Change subject: Interlanguage link: Simplify the autonym identification
......................................................................

Interlanguage link: Simplify the autonym identification

It is guaranteed that jquery.uls.data is loaded before
createCXInterlanguageItem is called. So we can safely use
$.uls.data.getAutonym() for getting the autonym.

Change-Id: I89e1ed2f1b642230234b750055f2ca01995b9ea4
---
M modules/entrypoint/ext.cx.interlanguagelink.js
1 file changed, 1 insertion(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/62/240962/1

diff --git a/modules/entrypoint/ext.cx.interlanguagelink.js 
b/modules/entrypoint/ext.cx.interlanguagelink.js
index 166c81f..c585522 100644
--- a/modules/entrypoint/ext.cx.interlanguagelink.js
+++ b/modules/entrypoint/ext.cx.interlanguagelink.js
@@ -75,14 +75,7 @@
        function createCXInterlanguageItem( code ) {
                var from, $link, $item, autonym;
 
-               // Optimization: if it's just the user language,
-               // get the autonym from an available variable.
-               // Otherwise, get it from uls.data, which should be loaded by 
now.
-               if ( code === mw.config.get( 'wgUserLanguage' ) ) {
-                       autonym = mw.config.get( 'wgULSCurrentAutonym' );
-               } else {
-                       autonym = $.uls.data.getAutonym( code );
-               }
+               autonym = $.uls.data.getAutonym( code );
                // TODO: This should be done more robustly.
                // We can't use something like wgContentLanguage because this
                // will fail for a wiki like simple.wikipedia.org, where

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89e1ed2f1b642230234b750055f2ca01995b9ea4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

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

Reply via email to