Multilingual MAMP port number siteUrl issue I have my local dev setting up using MAMP on port 8888

  'mydomain.dev:8888' =&gt; array(
    // ...
    'environmentVariables' =&gt; array(
        'basePath' =&gt; '/Users/mypath/SiteCode/mydomain/dev/',
        'baseUrl'  =&gt; '//mydomain.dev:8888/',
        'logDumpMethod' =&gt; 'print_r'
    ),
    'logDumpMethod' =&gt; 'print_r',
    'devMode' =&gt; true,
    'useCompressedJs' =&gt; true,
    'siteUrl' =&gt; array(
        'en' =&gt;  'http://mydomain.dev:8888/en/',
        'ar' =&gt;  'http://mydomain.dev:8888/ar/',
        'zh' =&gt;  'http://mydomain.dev:8888/zh/',
        'fil' =&gt; 'http://mydomain.dev:8888/fil/',
        'fr' =&gt;  'http://mydomain.dev:8888/fr/',
        'hi' =&gt;  'http://mydomain.dev:8888/hi/',
        'id' =&gt;  'http://mydomain.dev:8888/id/',
        'ru' =&gt;  'http://mydomain.dev:8888/ru/',
        'es' =&gt;  'http://mydomain.dev:8888/es/',
        'tr' =&gt;  'http://mydomain.dev:8888/tr/',
        'uk' =&gt;  'http://mydomain.dev:8888/uk/',
        'ur' =&gt;  'http://mydomain.dev:8888/ur/'
    ),

),


In the admin general settings I am using {siteUrl} for siteUrl settings. This gets read from the local dev config array as above.

However the admin link on the site in the control panel top left gets the url wrong. 
Instead of http://mydomain.dev:8888 it shows
http://mydomain.dev:8888/admin/%7BsiteUrl%7D/

I have other local craft sites setup with port number 8888 O.K. The only difference here is that the siteUrl is specified in a multilingual array.

Is this a bug or am I missing something?
Pretty sure the issue is that a port number won't work as part of the key in a multi-environment config.  Because unless you explicitly set CRAFT_ENVIRONMENT to use it, Craft is just going to use $_SERVER['SERVER_NAME'], which doesn't include the :port (that's at $_SERVER['SERVER_PORT']).

There's another thread here with some solutions/workarounds.