I really like how gboard handles it. It figures out what language I'm typing from the first couple of words and prioritises those. This way I can even mix languages within the same sentence and it will still recommend the right ones. It's really really good.