Problem: Genesis 10:5, 20, 31 seem to suggest many dialects, which is an apparent conflict with Genesis 11:1 that clearly states, “the whole earth had one language and one speech.”
Solution: These texts speak of two different times. Earlier, while maintaining their tribal distinctions, the descendants of Ham, Shem, and Japheth all spoke the same language. Later, at the tower of Babel (Gen. 11), God punished their rebellious attempt by confusing their speech. As a result, tribes could no longer understand one another, though possibly the subtribes and clans were allowed a mutually understandable language so they could still understand one another.