A language is a dialect with a flag and an army.
However the line can get pretty blurry at times. The general understanding is that a “language” is a dialect of a different language if it for the most part has the same words and structure, and can be understood by the speakers of the larger language. Two different languages would be significantly structurally different, and speakers of the languages would struggle understanding each other.
Latest Answers