We should have a single source for available languages. The backend should determine them (see T78006), and provide them to the frontend via a dedicated ResourceLoader module, similar to the SitesModule.
It should be possible to both add and remove available language codes via configuration (see T86182). Sources to be considered for available language codes:
- MediaWiki's list of UI languages
- $wgExtraLanguageNames (for additional codes)
- $wgDummyLanguageCodes (for alias codes)
- UniversalLanguageSelector / CLDR (if available)
- Babel (if it has support for extra codes)