Sometimes you just want to look under the hood and see what DXA is doing. Here is a tool to inspect the Localization object for DXA .NET. This also gives insight in all the published resources and configuration parameters. I use this when I have to use such a resource or configuration property in webapp code.
DXA keeps the information about the publication it is serving pages from in the Localization object. The information published through the _System\Publish Settings page is available though this Localization object. The language selector also uses the Localization object to find the other publications to link to.
Adding the following little tool to your project will add a controller in /admin/sitelocalization which lists the Localization object's properties, the other site localizations, the resources and configuration parameters.
AdminController.cs; An action method you can add to your admin controller.
LocalizationExtensions.cs; An extension to the Localization object to fetch all configuration parameters.
SiteLocalization.cs; A view to add to the views in the shared views.
The controller will take the Localization from the WebRequestContext and make sure all localizations in the SiteLocalizations are properly loaded. The view will display everything in a convenient way. That's it.
The LocalizationExtension helps to find all the configuration parameters. The Localization class only has a public method GetConfigValue(string key) to get one specific configuration parameter, and there is no method to explore all configuration parameters. The LocalizationExtension's GetConfiigValues() will read the configuration from the DXA published configuration from the configuration binary variants, just like DXA's private methods do.
There is no need to add a route. The admin routes (admin/{action} and {localization}/admin/{action}) are already mapping the sitelocalization action. Just like the out-of-the-box admin/refresh controller you probably do not want to expose this feature publicly on your live website.
The Localization object contains a property SiteLocalizations which has all the other related publications. This tools shows the Localization object and all it's properties, including the Localization.SiteLocalizations. It's this class Sdl.Web.Common.Configuration.Localization.
You do not get all DXA publications in Localization.SiteLocalizations, but only the related ones. The DXA Publication Medatada schema has a field "Site Identifier - used to group publications together to define a single website". In this case publicatin 51 and 58 have the same Site Identifier, but the same CD evironments has a couple of other DXA sites with other Site Identifiers as well.
Automated documentation and system awareness are always nice. So in your example, localhost is pointing to a specific Publication (51, in the screenshot)?
But you also get the site localizations for all of the DXA publications as well?