Craft 3: how can I set an ordered list of all sites, and set a display name different from the site name? The Craft 3 multi-sites is very useful. However, I found the list dropdown while editing an entry confusing and awkward in my case.

I have several sites group, each containing a localized version of the site version:

- International Sales
    - English version
- Production
    - English version
    - French version
— Distribution
    - English version
    - French version


I could have set the sites group like this, to get the right display name when looping on each sites (using craft.app.sites.getAllSites()):

- International Sales
    - International Sales
- Production
    - Production
    - Production
— Distribution
    - French Distribution
    - Distribution France


But as you can see, there's almost nothing that inform the user which site version is using which locale, when editing the sites from the CP's dropdown.

So I had to change each name by something like this:

- International Sales
    - International Sales → English
- Production
    - Production → English
    - Production → French
— Distribution
    - Distribution France → English
    - Distribution France → French




Now I'm facing two problems:


How can I set an ordered list of all sites using Twig?
Because
craft.app.sites.getAllSites() loop through sites using an
alphabetical order, like in the CP. For example, I would like the
Distribution group displayed before the Production group.
How can I set a display name different from the site name? Because
International Sales → English, Production → English, etc. are ugly names, only for visual reference in the CP. I would like to
display their names like in the second version of the list:
International Sales, French Distribution, etc.
If you would use a custom plugin you can create this function in your (I know it's deprecated but I don't know a better name) PluginVariable

public function createSiteQuery(): Query
{
    return (new Query())
        -&gt;select(['id', 'groupId', 'name', 'handle', 'language', 'primary', 'hasUrls', 'baseUrl', 'sortOrder'])
        -&gt;from(['{{%sites}}']);
}


You can then use 

{% set sites = craft.plugin-handle.createSiteQuery().orderby({'whatever': 'you want'}).all() %}


And attach as many parameters to the query as you like... If you would like to fetch only sites with a specific language you can do

{% set sites = craft.plugin-handle.createSiteQuery().where('language = "en"').all() %}


You have the full power of Yii2 Query class. You can group your sites as you like, change the order. You'll receive a single SiteRecord or multiple SiteRecords Class reference and you can display whatever information you like in the frontend. 

You are free to change the site names in your frontend with a static array map in your php code as well. Create a map with siteHandle =&gt; "new display name" and do something like

{{ craft.plugin-handle.displayCustomSiteName(site.handle) }}