I'm trying to track down some language-related bugs, and am wondering how $language is set. If I'm logged in with my base language set to 'English', working on a survey with a base language of 'Vietnamese', and I'm running the statistics report, the select box for choose from a list of answers is generated in statistics.php with the code
//get answers
$query = "SELECT code, answer FROM ".db_table_name("answers")." WHERE qid='$flt[0]' AND language='{$language}' ORDER BY sortorder, answer";
I'm thinking that $language might be set based on cookies, a post or get request, session, something like that, and maybe there's something unexpected in my configuration for prioritizing globals. I have this is a bug report, but maybe it's hard to reproduce with different environments. For example, right now when I import a survey with a base language other than English, but whole UI switches, at least until I move to another section of admin.
Tac