I have submitted a Pull Request to fix this in the Discourse repository:
This change ensures the hreflang attribute is SEO-compliant while keeping the internal locale parameters functional.
hreflang