---
title: "Why does language detection specify the wrong language?"
date: "2021-02-10T13:58:24+00:00"
summary: "Troubleshoot automatic language detection issues in web scans. Learn how to set up correct language settings and use language attributes."
image:
type: "article"
url: "/web-governance/help/59286-why-does-language-detection-specify-wrong-language"
id: "50ca30b6-a476-4843-b4ed-79346153daa4"
---

Q. Why does automatic language detection specify the wrong language?
====================================================================

It can happen that the automatic language detection identifies a page as containing the wrong language. Sometimes a page can contain a snippet in another language, resulting in an Accessibility error (screen readers cannot identify language, and so it should be specified within the code).

Some steps to take are:

1.  Make sure that the scan is set up for the correct language:
    
    1.  From the Domain Overview (Globe icon) click **Admin** **Settings** (the gear icon) at the top of the page. The _Admin Settings_ page opens.  
        **Note**: The _Settings_ button is only available to site admins.
        
    2.  Click **Action**. on the same row as the domain to scan.
        
    3.  Select _Edit Domain_ from the drop-down list.
        
    4.  Locate **Language** in the _Domain Details_ section.
        
    5.  Click the drop-down arrow and select the language for the domain scan. Select the primary language for the domain.
        
    
    Additionally, in the **Crawl Options** section, make sure that the **Use Language Attribute** switch is turned to **ON**.
    
    ![The location of the Case-Sensitive URLs button in the Crawl Options section on the Edit Domain page.](https://acquia.widen.net/content/19d8bfa1-b35a-4148-8203-9a9e02db28cc/web/Mon_Opt_AdminSettings-EditDomain-CrawlOptions-CaseSensitiveURLs.png)
    
    For more information, see the user guide article:
    
    [Configure Domain Scans](/en/articles/5480962-configure-domain-scans).
    
2.  **Another Language**: Words on a page that are written in another language are usually tagged as misspelled words. For instructions on how to repair the HTML code for this Accessibility error, see the **[HTML School](https://www.w3schools.com/tags/att_lang.asp)** site (external link).
    
3.  **Language Detected**: Click a page URL and scroll to the bottom of the _Dashboard_ to the _Crawl Information_ section. Check that the language detected is correct.
    
    ![The Crawl Information section on the Quality Assurance page.](https://acquia.widen.net/content/2f560ba2-00ae-4c2f-9071-97981a843848/web/Mon_PrioritizedContent-PageDetails-CrawlInformationSection.png)
    

Another solution is to turn **ON** the **Use Language Attribute** option in domain setup.

1.  Click **Admin** **Settings** (the gear icon) at the top of the domain overview page. The _Admin Settings_ page opens.
    
    Note
    
    The _Settings_ button is only available to site admins.
    
    ![The location of the Admin Settings button on the main menu bar.](https://acquia.widen.net/content/44dfb321-2b2f-48da-8d3d-d42d738df888/web/WebGov_MainToolbar-AdminSettingsButton.png)
    
2.  On the same row as the domain to scan, click **Action**.
    
    ![The location of the Action button and the expanded list of options, on the same row as a domain.](https://acquia.widen.net/content/5721cbb7-fb99-405b-af36-756fe71843bb/web/WebGov_DomainOverview-ActionButtonAndMenu.png)
    
3.  Select _Edit Domain_ from the drop-down list.
    
4.  The _Edit Domain_ page opens.
    

In the _Crawl Options_ section:

![The Scan section on the domain setup page.](https://acquia.widen.net/content/54faf2f1-79e1-4f6d-9180-d637ade3e467/web/Mon_EditDomain-ScanSection.png)

*   **Use language attribute**: Toggle the switch **ON**. When this feature is enabled, the scan does not try to auto-detect the page language. This means that the spellcheck is only done for the language that is specified in the _lang attribute_.
    
    The _Use Lang Attribute_ feature helps the scan to do the spellcheck on HTML pages that contain multiple languages.
    
    Note
    
    The primary language of the HTML page must be correctly defined as a lang attribute on the `<html>` tag. Additionally, each subsection of the page that is in any other language must be wrapped in a tag with a proper lang attribute value  
    See below for an example:
    
        <html lang=en"><head><title>Hello World in other languages</title></head><body><h1>Hello World in other languages</h1><p>Spanish: <span lang="es">Hola Mundo</span><br>Danish: <span lang="da">Hej verden</span><br>French: <span lang="fr">Bonjour le monde</span></p></body></html>
    

_Remember_: When this is enabled, the scan does not auto-detect the page language. For example, spell checks are always done for the language that is specified in the lang attribute.