Page MenuHomePhabricator

variantlangattributes.patch

Authored By
bzimport
Nov 21 2014, 11:06 PM
Size
1 KB
Referenced Files
None
Subscribers
None

variantlangattributes.patch

Index: skins/Vector.php
===================================================================
--- skins/Vector.php (revision 82013)
+++ skins/Vector.php (working copy)
@@ -350,7 +350,7 @@
<div class="menu">
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach ( $this->data['variant_urls'] as $link ): ?>
- <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
+ <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" hreflang="<?php echo htmlspecialchars( $link['hreflang'] ) ?>" link=<?php echo htmlspecialchars( $link['lang'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
<?php endforeach; ?>
</ul>
</div>
Index: includes/SkinTemplate.php
===================================================================
--- includes/SkinTemplate.php (revision 82013)
+++ includes/SkinTemplate.php (working copy)
@@ -1032,7 +1032,9 @@
$content_navigation['variants'][] = array(
'class' => ( $code == $preferred ) ? 'selected' : false,
'text' => $varname,
- 'href' => $title->getLocalURL( '', $code )
+ 'href' => $title->getLocalURL( '', $code ),
+ 'hreflang' => $code,
+ 'lang' => $code,
);
}
}

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6309
Default Alt Text
variantlangattributes.patch (1 KB)

Event Timeline