Detect Language: Simplified code.

Thanks to Zaahir and Russell.