Incorrect site language tag in HTML code

Hello! I am using Foundry to build a German website. The Site Language option in RW is set to German. However, when exported, the html start tag has lang=“en”. I am worried that Google will interpret my site incorrectly.

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. ``
  4. <head>

It should be: 2. <html lang="de">

Does someone know where I can fix this? Thanks!

Try the Foundry Control Center Stack (the one required on each page).

At the bottom under advanced:
2020-02-16_12-31-09

3 Likes

Well, I didn’t know this option exists. Thanks for pointing me in the right direction. However, after checking, it is set to German already. I changed the language to a different one, saved the project, and changed it back to German and republished. The analysis tool returned: “This document appears to be written in German but the html start tag has lang="en" . Consider using lang="de" (or variant) instead.”

Any suggestions?

Don’t know what tool you are using to analyze?
I just did a quick test and the HTMl lang tag seems to change fine:

Perhaps the tool you are using is getting something from Cache?

Do you have a URL for us to have a look?

1 Like

Yes, the tool I am using is Ready to check - Nu Html Checker and my site: https://nicolasdesign.de .
I did the page inspect and it’s showing “DE”. Yeah!!!

language%20tag

When I run my site using this tool I get over 70 errors and warnings within the code.

IMO, Most of those free online tools are sh!t. Run Google.com on it and see what it says.

1 Like

There is only one lang tag on your live page:

1 Like

Thank you Doug (and Scott). Seems like the analysis tool is indeed sh!t and doesn’t say the truth. Phew!
Happy Sunday to you both and thanks again for looking into this for me. Cheers from Germany.

1 Like

I noticed that when checking the page inspect on the Safari browser that there are multiple tabs. Under the first tab Elements, the HTML code says “DE” in the language tag. However under the Resources tab it shows the “EN” language tag at the top of the code. I believe this is where the analysis tool has the data from. I am confused now. Which code is the one that google reads?

HTML%20code

A chrome browser will read what’s in the DOM (elements tab).

As you can see this Chrome browser is asking me if I want to translate German to English(your page)2020-02-16_13-39-36 :

2 Likes

Thanks Doug. I am happy now!

Apropos DOM (I know I am going off track now, sorry), do you know if there is anywhere a best practice RW document how to build sites with the number of DOMs in mind. I feel that my sites have too many DOMs which causes longer loading times etc. I am sure I can reduced the DOMs by building my sites a little differently, but don’t know how. Thank you so much.

The DOM (Document Object Model) is built for every page on a site. It is basically a tree structure that styling(CSS) and JavaScript gets applied too.

The browser builds the DOM tree for every page (and an Accessibility tree as well).

The reason that the lang tag is showing as EN in the source, but not the DOM is it was probably changed with JavaScript by Foundry.

As for load times, it’s more about what’s on a page. Videos are hogs, images next.

1 Like

The concerning message about my DOM comes from Google’s Speed test site (https://developers.google.com/speed/pagespeed/insights/). It says about my page “Avoid an excessive DOM size 1,399 elements”. I noticed that the more stack items I add to my page, of course the larger the list of DOM elements gets. I was wondering if there is a smarter way of working with Stacks to minimize the number of elements in my DOM - without reducing all the styles and margins etc. I need to make my pages look good.

The only way to reduce the number of DOM elements on a page is to reduce the number of items on the page.

Most conventional stacks wrap each item with two additional <div>'s (stacks_out, stacks_in). So adding a single element like a header can create 3 DOM elements.

Although these additional elements can make it more challenging to navigate the DOM(screen Readers, Crawlers, etc.), they really shouldn’t impact load time by much. They are just text.

The only thing that you can do from an RW user side is to make sure you need to put a stack inside another stack. I see this a lot with some sites. Folks will put a stack inside another, inside another stack, inside another stack, etc. When perhaps they could eliminate some of that by changing the settings on one or more of the parent stacks.

3 Likes

That’s exactly what I do…putting a stack inside another stack, inside another stack, inside another stack, etc. I should get more familiar with the various settings of each stack to eliminate this practice. Doug, you’ve been very helpful today! You are my Sunday Hero! Take care my RW friend.

2 Likes

You’re running your site through a tool that expects that you’re hand coding the page and optimizing each little thing by hand. But you’re using a tool that is multi-purpose and has to meet lots of needs, and also has lots of different elements that can all be nested.

Honest opinion here – just create good content for your site and ignore those validators. Compress your images before putting them into RW, write good copy and you’ll be fine. You’ll also eliminate your need for a trip to the doctor over an unnecessary ulcer. :crazy_face::rofl:

Hey Adam!! You see I am following your advise. :smiley: This platform is a great resource and I received great help already. :smiley: With the types of questions I ask, I just want to get the most out of RW and do things the way they should be done. Got my first client now and want to be prepared if things don’t go as planned. Trying to build a safety net if you will.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.