• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

html tag missing language

Guest
Oct 21, 2019 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

471

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
community guidelines
Community Expert ,
Oct 22, 2019 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— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

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
community guidelines
Community Expert ,
Oct 22, 2019 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.

Votes

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
community guidelines
Community Expert ,
Oct 22, 2019 Oct 22, 2019

Copy link to clipboard

Copied

LATEST

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— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

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
community guidelines