Routing Pattern - Multi Language with '/' or e.g. other domains/subdomains

I am wondering what’s the most flexible way to use routing with multi languages. When in example a plugin when it’s not a 100% clear on url setting it’s gonna be used for…
so far i have been using routes with having a language method e.g.

    'pattern' => '(:all)/some/page/(:any)',
    'method'  => 'POST',
    'action'  => function ($language, $data) {
        //.......      
    }

where as i could access the $language to use for site()->visit() and whatsoever.

So if i were to set the default url to ‘/’ or use let’s say separate domains, the language variable would be missing/empty thus the result becomes quite different.

So what would be the best strategy to be covered for all kinds of scenarios?

You can make the language code optional:

'pattern' => '(?:(^[a-z]{2})//?)?some-page/(:any)',
'method'  => 'POST',
'action'  => function ($language, $data) {
    //.......      
}

If no language code exists, $language will be an empty string.