WordPress.org

Support

Support » Plugins and Hacks » Help on translating a few words with xlanguage

Help on translating a few words with xlanguage

  • I am using the xlanguage plugin to translate my posts (great plugin btw). But at this time i need to translate a brief descriptive paragraph that is harcoded in the header template.

    I’ve tried the following and other things but i cant get it to work :

    <?php if (function_exists('xlanguage_current_language_code') && xlanguage_current_language_code() == 'en') { ?>
    	<p>bla bla</p>
    <?php }else{ ?>
    	<p>bla bla</p>
    <?php } ?>

    Any idea on how to make this work inside a template? thanks …

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’ve been attempting to do the same thing without success.

    Reading the plugin site’s discussion, there is a post pertaining to this issue within comment #120 and a reply from the plugin’s author within comment #122.

    I’ve posted my own experiences with trying to hard-code such a solution within comments #552 and #553.

    As I mentioned, though, I have not been successful, so please post here and on the official site if you discover a working solution.

    I will do the same.

    Good luck to us both!

    after trying odd codes with my poor php skills i found the solution!
    ther’s an error in the syntax of the plugin’s author if statement:

    this is what the author suggests
    if (xlanguage_current_language_code == “cy”) { … }

    this is the working one
    if (xlanguage_current_language_code() == “cy”) { … }

    i found it trying to echo the variable xlanguage_current_language_code

    hope it works for you as it did for me..
    happy coding 😉

    THX gelkamar!

    Worked like a charm!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help on translating a few words with xlanguage’ is closed to new replies.
Skip to toolbar