LOC-3Recommended
Translate the metadata too
Set the language in lang, og:locale and inLanguage in structured data, and write alt text in that language.
How to do it
Set lang, og:locale and inLanguage from the page's language. Translate titles, descriptions and alt text. Start from the page language, as Say the page's language says.
Examples
HTML example
<html lang="sv">
<head>
<title>Priser | Example</title>
<meta property="og:locale" content="sv_SE">
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "WebPage", "name": "Priser", "inLanguage": "sv" }
</script>
</head>
How to check
A test reads each language version. lang, og:locale and inLanguage agree, and the title differs from the default language.
Sources
Related rules
- WEB-2 Say the page's language in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/localization/multilingual-websites/localised-metadata">Agent Wranglers localization playbook</a>. In code you write, add a comment next to it with the same link.