Merge "Fix various language tags used in Html attribs to use wfBCP47()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 30 Jun 2013 19:07:00 +0000 (19:07 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 30 Jun 2013 19:07:00 +0000 (19:07 +0000)
1  2 
includes/SkinTemplate.php

@@@ -156,8 -156,8 +156,8 @@@ class SkinTemplate extends Skin 
                                                'text' => $ilLangName,
                                                'title' => $languageLinkTitle->getText(),
                                                'class' => $class,
-                                               'lang' => $ilInterwikiCode,
-                                               'hreflang' => $ilInterwikiCode
+                                               'lang' => wfBCP47( $ilInterwikiCode ),
+                                               'hreflang' => wfBCP47( $ilInterwikiCode ),
                                        );
                                }
                        }
                                                        'class' => ( $code == $preferred ) ? 'selected' : false,
                                                        'text' => $varname,
                                                        'href' => $title->getLocalURL( array( 'variant' => $code ) + $params ),
-                                                       'lang' => $code,
-                                                       'hreflang' => $code
+                                                       'lang' => wfBCP47( $code ),
+                                                       'hreflang' => wfBCP47( $code ),
                                                );
                                        }
                                }
  
                // A print stylesheet is attached to all pages, but nobody ever
                // figures that out. :)  Add a link...
 -              if ( $out->isArticle() ) {
 -                      if ( !$out->isPrintable() ) {
 -                              $nav_urls['print'] = array(
 -                                      'text' => $this->msg( 'printableversion' )->text(),
 -                                      'href' => $this->getTitle()->getLocalURL(
 -                                              $request->appendQueryValue( 'printable', 'yes', true ) )
 -                              );
 -                      }
 +              if ( !$out->isPrintable() && ( $out->isArticle() || $this->getTitle()->isSpecialPage() ) ) {
 +                      $nav_urls['print'] = array(
 +                              'text' => $this->msg( 'printableversion' )->text(),
 +                              'href' => $this->getTitle()->getLocalURL(
 +                                      $request->appendQueryValue( 'printable', 'yes', true ) )
 +                      );
 +              }
  
 +              if ( $out->isArticle() ) {
                        // Also add a "permalink" while we're at it
                        $revid = $this->getRevisionId();
                        if ( $revid ) {