Automatically select the language based on the input field's current text