• dmaher

    (@dmaher)


    I have the Gengo plugin working so I have my site in English and French, works perfect. The problem is the menu links are still in English because they’re coded into the header.php page. So what I did was create a /fr directory and install another copy of WordPress here with the same config.php file so it accesses the same database. It’s the same site with Gengo installed and a French menu. So now I have the English install with English menu and Gengo working for a French/English site. Then I have the /fr directory with the French version installed, the French menu, and Gengo translating this one to English and French. That means I have 2 WordPress installs and 4 languages….2 English and 2 French. When the user comes to the site, it’s all in english with /?language=en at the end. When they click the French link, it brings them to /fr/?language=fr with all French content and French menu.

    To try and not confuse you, I’m using the English side of the English menu site and the French side of the French menu site and leaving the English/French and French/English sides alone. But if you close the page while in French, and visit again, it brings you to the French side of the English install meaning it’s all in French but there’s English menu items.

    My question is this…….if they reach 1 of the 2 areas they shouldn’t be in where English and French are mixed, is there a way to take the language variable from the URL and check to see if it is en or fr and redirect accordingly? I’m using

    <?php
    $language = $_GET['language'];
    if ($language = "erewd") : header( 'Location: https://www.em2ab.com/index.html' ) ;
    endif;
    ?>

    but it just redirects everytime no matter what the language variable is. Did I confuse you? Can anyone help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • moshu

    (@moshu)

    To be honest, it is quite confusing what you did.
    There is a much simpler solution and you really DON’T need two installations.
    Gengo has a feature where you can create “Synonym Blocks” for things like hardcoded menus.

    Thread Starter dmaher

    (@dmaher)

    I did a search for it on WordPress and in these support forums and it returned zero results. Any more information?

    moshu

    (@moshu)

    What information do you need? Just read the admin panel of the Gengo.

    Cut out that hardcoded thing and go in admin > gengo > Synonyms.
    Scroll down to Synonym Blocks.
    Paste the text you just cut before into the English field.
    Write the same in French into the French field.
    Give it a name, e.g. mynewmenu
    Tehn go back to the template file and in the place from where you cut out the code, put this:
    gengo_synblock('mynewmenu')
    Done.
    As you change languages the menu will also change.

    Thread Starter dmaher

    (@dmaher)

    Wow, that’s a great feature. You’re a lifesaver, thanks.

    Cut out that hardcoded thing and go in admin > gengo > Synonyms.
    Scroll down to Synonym Blocks.

    Hey Moshu, and thanks for helping me out earlier! I’m just wondering, are the Synonym Blocks the same thing as snippets? My menubar shows only the headers Languages, Translations, Synonyms and Exclusions and when clicking Synonyms, the options Category Translations and Snippets appear.

    Thanks again!

    Seems that gengo_synblock() is now deprecated and indeed replaced with gengo_snippet().

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How do I redirect to another page?’ is closed to new replies.