I had to change locale() to code() since our locale config should match up with our installed server languages to work correctly. It was outputting hreflang="en-us.utf-8" and hreflang="da-dk.utf-8" by using code() (which actually should match up with the accepted browser language anyway) I'm finally getting hreflang="en" and hreflang="da" 🎉
The issue you are experiencing is because getHreflangFromLocale is not coping with the .utf-8 suffix of the locale. I thought I'd fixed this issue. Well, I had, in honehome, but somehow I forgot to backport the fix I did there to here. I'll push a fix.
I had to change locale() to code() since our locale config should match up with our installed server languages to work correctly. It was outputting
hreflang="en-us.utf-8"
andhreflang="da-dk.utf-8"
by using code() (which actually should match up with the accepted browser language anyway) I'm finally gettinghreflang="en"
andhreflang="da"
🎉