Read Article For

How To Change The Language HTML Attribute To A Different Language.

How To Change The Language HTML Attribute To A Different Language

The default language attribute (lang) is English (en). If you are creating a website using Sitelium in another language you might want to change the HTML language declaration to your preferred language. Here is how to do it:

You'll use our  feature that Code Injection lets you inject scripts in the header (or footer) of your website. 

 

Step 1. Copy the following code

 
<script>
const html = document.querySelector("html");
if (html) {
html.setAttribute("lang", "es");
}
</script> 
 

Where "es" is the language parameter. You'll need to change that to your preferred language. Find all the language tags in the IANA Language Subtag Registry.

 

Step 2. Paste the code in the Header section in our Code Inject feature.

Step 3. Press the Save Changes button.