I decided don't use flags for language selectors a lot of times ago. Flags can work for Estonian, Lithuanian, Poland, and other national languages. Serious troubles start when the designer tries to use a flag for the multinational language.
People speak English in Great Britain, the USA, Ireland, Canada, Australia, Malta, and other countries. French is an official language in France, Canada, Belgium, Switzerland, Cameroon, and other African countries. Russian is common in Ukraine, Russia, Belarus, Estonia, Latvia, Lithuania, Kazakhstan, Kyrgyzstan, Uzbekistan, etc.
Language is not the property of the government. Language is the property of all native speakers at the same level.
Also, flag for language selector can be a problem for national language too. Belarusians have two flags. The white-red-white flag is a real flag of the Belarusian people. The green-red flag is a flag of the dictatorship regime. Most language selectors with flags use green-red flag. For people of Belarus is very uncomfortable to see the green-red flag.
For many Ukrainians the Russian language is native. And this is horrible to see the Russian flag in the language selector because the Russian army who invades Ukraine uses this flag.
What we need to use if we cannot use flags?
Just use ISO 639 language abbreviations. Like ENG, UKR, RUS, BEL, EST. Also, Windows 10 language abbreviations are cool. Like ENG, УКР, РУС, БЕЛ, EST. Those abbreviations use the language's alphabet.
Abbreviations take up as much space as flags but are less problematic.
Abbreviations look very similar. This is a problem. What if the user needs to recognize which language is selected very fast? This is important for the input method selector in MacOS or other OS.
In this case, we can add colors for fast recognition. The first input method is white, the second is green, the third is red.
This way is much better than flags because white and blue are much more different than some flags. Slovenian and Russian flags look pretty similar in the little icon.
Apple decide do not use flags for text input methods in the one of the latest updates.