Not logged in. · Lost password · Register
Forum: General Help and Support Plugins Plugin Wishlist RSS
Translation Plugin Upgrade Request [Possible Bounty]
Daulken #1
Member since Mar 2015 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: Translation Plugin Upgrade Request [Possible Bounty]
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:"  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)));

    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).
eilko #2
Member since Feb 2012 · 22 posts
Group memberships: Members
Show profile · Link to this post
have you found a solution? I am looking for the same...
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-12-08, 04:22:57 (UTC +01:00)