From 60f1f969b4cbc1d636684b93696f1830674b1e9c Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Sun, 26 Feb 2012 16:52:37 +0000 Subject: [PATCH] Add lang and hreflang tags to the variants in the variant menu's. This fixes bug 24742. I have not added the rel 'alternate' links, because they are also present in the --- includes/SkinLegacy.php | 2 +- includes/SkinTemplate.php | 4 +++- skins/Vector.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/SkinLegacy.php b/includes/SkinLegacy.php index 03ae3a44f3..eb637d79de 100644 --- a/includes/SkinLegacy.php +++ b/includes/SkinLegacy.php @@ -250,7 +250,7 @@ class LegacyTemplate extends BaseTemplate { } $s = $wgLang->pipeList( array( $s, - '' . htmlspecialchars( $varname ) . '' + '' . htmlspecialchars( $varname ) . '' ) ); } } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 1a933dda4f..68e595bdcf 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -1000,7 +1000,9 @@ class SkinTemplate extends Skin { $content_navigation['variants'][] = array( 'class' => ( $code == $preferred ) ? 'selected' : false, 'text' => $varname, - 'href' => $title->getLocalURL( array( 'variant' => $code ) ) + 'href' => $title->getLocalURL( array( 'variant' => $code ) ), + 'lang' => $code, + 'hreflang' => $code ); } } diff --git a/skins/Vector.php b/skins/Vector.php index 74b2fff735..cee8c0e87a 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -371,7 +371,7 @@ class VectorTemplate extends BaseTemplate { -- 2.20.1