Keyboard layouts are more country related than language related. At least among French speakers that's the case. So using country flags probably makes sense here.
Keyboard layouts might be linked to specific countries, but language usage extends far beyond national borders. For example, Russian is spoken by communities in the US who may not identify with the Russian flag (or even stand against it), and French is widely used in places like Niger, where the French flag may hold little relevance. Thus, associating languages strictly with country flags can overlook the diverse and global nature of language communities.