+ if ( $ilLangLocalName === '' ) {
+ $ilFriendlySiteName = wfMessage( "interlanguage-link-sitename-$ilInterwikiCode" );
+ if ( !$ilFriendlySiteName->isDisabled() ) {
+ if ( $languageLinkTitleText === '' ) {
+ $ilTitle = wfMessage(
+ 'interlanguage-link-title-nonlangonly',
+ $ilFriendlySiteName->text()
+ )->text();
+ } else {
+ $ilTitle = wfMessage(
+ 'interlanguage-link-title-nonlang',
+ $languageLinkTitleText,
+ $ilFriendlySiteName->text()
+ )->text();
+ }
+ } else {
+ // we have nothing friendly to put in the title, so fall back to
+ // displaying the interlanguage link itself in the title text
+ // (similar to what is done in page content)
+ $ilTitle = $languageLinkTitle->getInterwiki() .
+ ":$languageLinkTitleText";
+ }
+ } elseif ( $languageLinkTitleText === '' ) {