How to detect the current language through PHP?

You can check the variable $_SERVER[‘HTTP_LINGUISE_ORIGINAL_LANGUAGE’] if it’s not defined, you are under your default language.
Otherwise, it will contain the current translated language.