The SidebarTranslate gadget is broken when used with Compact Language Links.
A JS error is shown: Cannot read property 'toLowerCase' of null TypeError: Cannot read property 'toLowerCase' of null
This happens because the gadget adds more <a> elements, and when the ULS code is trying to process all the <a> elements, it fails when it doesn't find an element with a lang attribute.
Several possible solutions:
- Add a particular class to the <a> element of the actual interlanguage link, so that ULS would only load that element. This will have to be in core MediaWiki.
- When querying for elements, use this.$interlanguageList.find( 'li.interlanguage-link > a:first-child' ) instead of just this.$interlanguageList.find( 'li.interlanguage-link > a' ). This should solve the problem with this gadget, but may break with other gadgets that add <a> elements.