Will be accepting input mainly in two languages (English & Arabic).
What would be the simplest way to detect which language was used?
This pear package may help, but I didn't use it:
http://pear.php.net/package/Text_LanguageDetect
Look at this post Checking browser's language by PHP? this is the only way I know of. to check the language of the browser, assuming this is the user's main language
There's no way to test 100% reliably, but you can try checking the Accept-Language header that the browser should send with its requests to determine which language to use. This will contain a list of languages the client is willing to accept, it also includes a quality score that the server can use to determine the preferred language.
Do provide the option for the user to manually set the language as well though, as I said it might not be 100% reliable.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html gives more technical details on the accept-language header.
精彩评论