How to Implement Language Detection