A website’s language is obvious to many human readers, but software should not have to guess. HTML provides a direct way to identify the language of a page and of passages within it.
The lang attribute is a small part of the markup with an important job: it describes the language of the content. This becomes especially useful on sites that publish in one language while quoting, naming, or explaining material in another.
Declare the page’s default language
For an English HTML page, the basic declaration is:
<html lang="en">
W3C guidance recommends placing the default language on the html element. Its scope includes the document as a whole, and descendant elements inherit that language unless a more specific declaration overrides it.
The same guidance recommends using recognized language tags rather than inventing labels.
The value should describe the published content. An English article managed through a Turkish administration interface still needs an English page-language declaration.
Likewise, the location of the business or its hosting server does not determine the language of every page it publishes.
Identify passages that change language
An English article may include a Turkish sentence. Mark the relevant element:
<p lang="tr">Bu bölüm Türkçe yazılmıştır.</p>
For a shorter phrase inside a paragraph, use an appropriate surrounding element:
<p>The greeting <span lang="tr">günaydın</span> means good morning.</p>
MDN explains that the attribute uses BCP 47 language tags and that language information is inherited from ancestors. It also identifies programmatically available language information as an accessibility concern.
The practical editing rule is to put the declaration around the actual language change. Do not change an entire article’s language because one quotation uses a different language.
Keep language, translation, and appearance separate
Adding lang=”en” does not translate a paragraph into English. It describes the language already present.
Similarly, the attribute is not a replacement for editorial review. A page can carry a technically valid English declaration while containing a mixture of untranslated interface labels and incomplete translation.
For a multilingual publishing workflow, review those issues separately. Check the page’s language declaration, then read navigation labels, buttons, captions, and body text as a visitor would.
If regional distinctions matter, choose a suitable tag deliberately. Avoid adding a region merely because the organization operates there; the declaration should reflect the content’s language conventions.
Include language checks in template reviews
A useful review begins with three representative pages: an ordinary article, a translated article, and an article containing a substantial quotation in another language.
Inspect the rendered HTML rather than relying only on an administration setting. Confirm that each page receives the intended default and that localized passages are marked where necessary.
Also check reused components. A language label copied into a template can survive long after the content changes.
For editors, a short publishing rule helps: identify the article’s main language, mark meaningful changes within the article, and verify the resulting page. That turns language metadata into a repeatable part of publishing instead of a hidden template assumption.



