Commit e3072e03 authored by Josaphat Imani's avatar Josaphat Imani Committed by Adrien Mbuya Maloba
Browse files

[NEW] Multilingual lib: Added hreflang tag to pages

parent 9f27529e
Pipeline #756169815 passed with stages
in 8 minutes and 14 seconds
......@@ -209,6 +209,15 @@ class WikiRenderer
$this->smartyassign('translationsCount', count($this->trads));
$pageLang = $this->info['lang'];
$this->smartyassign('pageLang', $pageLang);
$headerlib = TikiLib::lib('header');
$links = [];
foreach ($this->trads as $trad) {
if ($trad['lang'] != $this->info['lang']) {
$links[] = '<link rel="alternate" href="tiki-index.php?page=' . $trad['objName'] . '" hreflang="' . $trad['lang'] . '">';
}
}
$headerlib->add_rawhtml(implode("\n", $links) . "\n");
}
if ($prefs['feature_machine_translation'] == 'y' && $prefs['lang_machine_translate_wiki'] == 'y' && ! empty($this->info['lang'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment