do u need it to detect the language? or do you have different Arabic and English pages? If your case is the second one, you can use a css switcher like css2switch to choose different template css for arabic page....
More