I have a com site, which is actually only for norweigan users. How can I add the lang=“no” attribute to the header of this domains pages?
I can’t seem to get it working with either:
Can you provide any help or guidelines for setting the language in the global scripts?
I want to know as well
Here is a piece of JS that should help you (set the placement to “Head”):
<br />document.getElementsByTagName("html").setAttribute("lang", "no");<br />
Hi Hristian - thanks a lot for your reply.
Unfortunately it didn’t help. I went to the script manager to place it in the head script for all main pages for the domain. The script is placed in the header, but seem not to work.
This is strange since the script works when I test it.
Here are a couple of screenshots of a test page I set up (Chrome & Firefox). Chrome even detects that the language is set to “no” and asks if you want to translate it.
Hi, is anybody managed to do that with the code shared by Hristian?
I put it in the header and republish my page, but I still can’t see the language tag in my Header.
My script above got broken when Unbounce switched the community platforms last year.
Here is the script you need to use.
Here you can see it working on a demo page.
Thanks Hristian, it works!