hello evrybody,

sorry for cross-posting.. (I already asked this over here http://drupal.org/node/119375) ..but i actually think this might be the more appropriate forum to ask this: how can I find out, what language is currently selected..? I'm trying to do something like this:

if($language == "English") {
echo("this is english");
return(TRUE);
} else {
echo("this is NOT english");
return(FALSE);
}

..and would therefore need some variable, that tells me, what the user selected ..

..help..? ..thanks!! greetz, till..

Comments

pobster’s picture

Dunno about localizer but with locale you'd do this;

global $locale;
print $locale;

Pobster

tille’s picture

looking at the solution it looks actually quite 'banal' - and I really dont know why i couldnt find it anywhere - but yes, this is exactly what I was looking for - thank you!

greetz, till..

ps: I also updated the other thread..

___________________________
my pictures: www.bilderbook.org

___________________________

sim6’s picture

<?php
global $language;
echo 'Lang: '.$language->language;
?>

--
sim6

pobster’s picture

Thanks for that reply but you are two and half years late to this party...

Pobster

revnoah’s picture

Well, it had the answer I needed right now. So, yes, it was helpful to actually post the solution.

jzachary’s picture

is it possible to change the subtheme based on this variable? I'm trying to do a simple css switch to change all the images for the dif. languages, or am i going about it the wrong way?

j