Unexpected language code

I ran a Google Pagespeed test on my instance and received the following message:

I can’t explain what’s causing it. Is there an error in the translator?

I think the invalid code comes from Discourse.

Maybe instead of hreflang="<%= locale %>" it should be hreflang="<%= locale.tr('_', '-') %>" to replace the underscore.

2 Likes

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.

1 Like