Try request.has_key(language) ==> request.has_key('language') > > //when i use xxx?language='en' > if id == 'en' or (request.has_key(language)):