Currently, there is only wgUserLanguage in the JS for the user language. Many user scripts use it to show the proper localization, but many don't use the correct fallback if localization is missing for that language (in most cases they just fall back to English). Just one example: https://www.wikidata.org/wiki/MediaWiki:Gadget-Merge.js has many localizations, but none for de-at or pfl. The script tries hard to provide good fallbacks, and will use German for de-at, but for pfl it will fall back to English. If the fallback chain (e.g. ['de-at', 'de', 'en'] or ['pfl', 'de', 'en']) would be exposed as JS variable, this would make localization of gadgets and user scripts much easier.