WordPress.org

Ready to get started?Download WordPress

Forums

How to change footer language in multilingual website? (9 posts)

  1. Vilkdagiss
    Member
    Posted 2 years ago #

    Hello everyone,

    I browsed the internet and did not find anything that would answer my question (well I believe, I didn't look very well because there is no question still not asked). And since search in support isn't very good, sorry if this question was already asked before.

    I have a website in three langugages, used qTranslate plugin to do that. Everything looks good so far (didn't spend much time checking though) except footer. How do I change language there?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Is the text in the theme's footer.php file translation ready?

  3. Vilkdagiss
    Member
    Posted 2 years ago #

    I don't know how to make it ready... I would like to receive help here :)

  4. esmi
    Forum Moderator
    Posted 2 years ago #

  5. Vilkdagiss
    Member
    Posted 2 years ago #

    I checked that page you gave me. I am starting to think I wrote my problem incorrectly.

    So, I have a page that must be written in English, Russian and my native language (default). qTranslate is a widget and it translates menu, content, links and so one very well, but footer stays the same in every language, because it is never edited in a dashboard. There must be done something additional to make it english when I click english flag, russian, when I click russian flag.

    I found something like get_footer('english'), but there was no full explanation about that. Do I need additional files? Functions?

  6. brasofilo
    Member
    Posted 2 years ago #

    Whatever you need to translate in your footer.php file may need this kind of adjustment:

    $lingo = qtrans_getLanguage();
    if ($lingo == 'en') {
    	// your stuff
    } elseif ($lingo == 'ru') {
    	// your stuff
    } else { // default languae
    	// original stuff
    }
  7. bhenselmann
    Member
    Posted 2 years ago #

    Have a look on the plugin "Codestyling Localization"
    http://wordpress.org/extend/plugins/codestyling-localization/

  8. hogmark
    Member
    Posted 1 year ago #

    Hi,

    I don't know PHP, but I wanted to reply with my solution to this issue. I'm running a site with two languages (English and Swedish). I reformatted the code by brasofilo, after reading this post, and here's my code in footer.php for showing site-generator content in the correct language:

    <div id="site-generator">
    
    	<?php $lingo = qtrans_getLanguage();?>
    	<?php if ($lingo == 'en') : ?>
    	<!-- English HTML here -->
    	<?php else : ?>
    	<!-- Other language HTML here -->
    	<?php endif ?>
    
    </div>

    Hopefully this information will aid.

  9. hogmark
    Member
    Posted 1 year ago #

    This page is also very useful!

    Tested with the following code that is basically the same:

    <?php if( qtrans_getLanguage() == 'en' ){ ?>
        <!-- English content here -->
    <?php }else { ?>
        <!-- Other language content here -->
    <?php } ?>

    Works well. Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic