Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a situation where I want to give specific style to my Navigation Menu when the website is in German language.

My website works well in English language but when I switch to German, it causes a css problem.

So how do I determine which language is currently active with qTranslate plugin?

share|improve this question

2 Answers 2

You can use the qtrans_getLanguage() function.

$currentLang = qtrans_getLanguage();

return the current language. See this link for an example. See the offical docs for developer here

share|improve this answer
    
Unfortunately, both links are not working, official docs is redirected to WordPress forum. –  Dharmang Jul 23 at 11:05

I have found a possible solution:

if ( 'de' === $GLOBALS['q_config']['language'])
{
    echo "<style>#nav li a { margin-left:3px !important; }</style>"; // menu bar width fix
}

This works well for my menu items being not looking wired.

share|improve this answer
    
Thanks Kaiser. Does this method work for all global variables? –  Darshan Thanki Sep 23 '12 at 8:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.