However, the mapping normally is from language to flag, not the other way around.
German -> Germany, French -> France, Swedish -> Sweden.
It's not perfect, but 99% of times it communicates what is meant to communicate, which is more than what you can say of many icons.