I'm having a problem that I simply don't have the time to learn enough php to do as anything more than a hack.
Basically, multilingual sites need hreflang for the search engines to know exactly which page is what language and how best to index the results. I've looked at it a bit, but it's giving me enough problems that to get it done right, I'd offer to pay someone to do it, rather than keep hacking away at it.
Anyway, with the translation plugin, I have thousands of pages, and they're all basically following the format of
en/start, es/start, de/start, etc.
The SEO on it is terrible though, because Google needs language headers on each page to say "This is the english version, you can find the spanish version here:"
https://support.google.com/webmasters/answer/189077?hl=en This article explains it very well. So, what I'm trying to do, is in tpl_metaheaders of my template.php, I'm trying to add something like this:
$trans = strtolower(str_replace(',', ' ', $conf['translations']));
$trans = array_unique(array_filter(explode(' ', $trans)));
sort($trans);
foreach($trans as $t) {
$head['link'][] = array(
'rel' => 'alternate',
'hreflang'=> $t,
'href' => $t
);
}
That's not done, because while I copied most of that code and have been messing with it, from helper.php from the translation program, $conf['translations'] and $conf('translations') both just return empty arrays. I can't seem to get the list of translations no matter what I'm doing, and I'm not sure why.
It should also NOT do that for whatever the current namespace is, but that's relatively easy, even for a hack like me. Even if I do get this figured out, I'd run the problem of making my upgrade path more difficult for the future, so I was hoping it was the type of thing that would be immensely useful for anyone using the translation plugin (that cares even remotely about SEO and how the search engines index their site).