No support for regional language variants (IETF BCP 47 language tags) in html 'lang' attribute

My site needs to support regional language variants. For SEO purposes, I use the ‘lang’ attribute to set the language and regional variant, such as ‘en-au’ (English - Australia) or ‘es-ar’ (Spanish - Argentinian).

When I set these in the lang attribute I get a CORS and a 404 error in the console.

I think there at least needs to be a fallback to the primary language if the regional variant is not supported, for example, fall back to ‘en’ if ‘en-au’ is not supported

I have tried to set the language via the JS SDK but as the ‘lang’ attribute exists on the html element, the localisation is reading this value first before the language is reset and causing the errors:

<script>
    document.addEventListener('snipcart.ready', function() {
        Snipcart.api.session.setLanguage('en');
    });
</script>

If any more information is required, please let me know