Highlighted

html tag missing language

Community Beginner ,
Oct 21, 2019

Copy link to clipboard

Copied

Hi, whenever I go to validate any page I've been creating in Dreamweaver CC (18.2), the first issue I always see is "Consider adding a lang attribute to the html start tag to declare the language of this document." Why isn't that added automatically when I start working on a blank html5 page, and how do I get dreamweaver to add it every time I start on a new html5 page? 

TOPICS
Error, How to, Product issue

Views

301

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

html tag missing language

Community Beginner ,
Oct 21, 2019

Copy link to clipboard

Copied

Hi, whenever I go to validate any page I've been creating in Dreamweaver CC (18.2), the first issue I always see is "Consider adding a lang attribute to the html start tag to declare the language of this document." Why isn't that added automatically when I start working on a blank html5 page, and how do I get dreamweaver to add it every time I start on a new html5 page? 

TOPICS
Error, How to, Product issue

Views

302

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 21, 2019 0
Adobe Community Professional ,
Oct 22, 2019

Copy link to clipboard

Copied

Only 20% of the world uses English as a primary language.  So how can Adobe or anyone else predict which language you need in your document?   Maybe  you're building a French language site with translated pages in English, Chinese, German or .....?   Only you know which languages you need, right?  

 

TIP:  Get into the habit of putting frequently used code fragments into your custom Snippets folder for quick & easy insertion.

https://helpx.adobe.com/dreamweaver/using/reuse-code-with-snippets.html

Nancy O'Shea, ACP

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 22, 2019 1
Adobe Community Professional ,
Oct 22, 2019

Copy link to clipboard

Copied

This is actually one of the simpler things to fix in DW, if you have Admin rights on your computer...

1. Go to C > Program Files > Adobe > Adobe Dreamweaver (your version) > configuration > Document Types > New Documents
2. Open Default.html 
3. Add the code to the <html> tag, something like <html lang="en-us">  [Edited by moderator for accuracy]
    NOTE: don't worry that the doctype is wrong, DW automatically changes that when you select HTML5
4. Save the file to your desktop
5. Transfer the file to the path above and overwrite the original (you need Admin rights for this step)

6. Open DW and create a new HTML file, the lang attribute will now be in your <html> tag

I do the above every update, copying and pasting the old version's Default.html to my new version so all of my base info is automatically populated in every new file.

If you use other file types regularly, like .php for example, you'll need to conduct the same addition to the corresponding Default. file.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 22, 2019 2
Adobe Community Professional ,
Oct 22, 2019

Copy link to clipboard

Copied

Also remember that a language attribute is recommended but not required.   If represented elsewhere, the XML:LANG has priority.    See MDN for details.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang

 

Nancy O'Shea, ACP

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 22, 2019 0