That's great unless you're scrolling through 200 languages trying to find yours and can't figure out how they're sorted. Remind me again, does မြန်မာစကား come before or after चम्बयाळी ?
I like how Wikipedia mitigates that problem by placing "Suggested languages" at the top (I think the top choices are inferred from either the Accept-Language HTTP header or the most common languages from the user's country) and below that there's a list of "Worldwide" languages which include the most used languages in the world, and finally the rest of the languages are grouped by continent.
There's also a search bar for filtering and it works with either the native or foreign name of the language. So, for example, typing "Finnish", "Suomi" or "Fines" (the latter is even misspelled, should be "Finés") will all filter out the right language.
Of course, there may be an edge case that's missing, but it's as close as perfect as it can get without reading the user's mind.
And it doesn't have to have every single language. There's over 7,000 languages in the world. It just needs to have languages for which content exists. For the vast vast majority of Wikipedia articles there are less than 10 languages available
You can build bigger menus that a popup and sort them into usable buckets.
Take a look at tesla.com. The shitty CEO aside, the language/locale menu does it right: An understandable globe icon opens a menu, that menu is sorted by continents, countries and for those countries languages - with their name written in their local script.