Set the lang attribute
Always set the lang attribute on your html element. This is the most reliable signal for language detection and improves accuracy.
eConsent automatically detects the language of consent disclosures on your pages. This ensures that consent certificates accurately record what language the consumer was presented with, which is critical for compliance with Title VI of the Civil Rights Act and for serving non-English-speaking consumer populations.
When a consumer consents in a language other than English, several compliance questions arise:
eConsent’s language detection provides a documented record of the language presented, which is stored on the certificate alongside the SHA-256 content hash.
eConsent automatically detects the following 10 languages:
| Language | Code | Detection method |
|---|---|---|
| English | en | Content analysis + lang attribute |
| Spanish | es | Content analysis + lang attribute |
| French | fr | Content analysis + lang attribute |
| Portuguese | pt | Content analysis + lang attribute |
| German | de | Content analysis + lang attribute |
| Italian | it | Content analysis + lang attribute |
| Chinese (Simplified) | zh | Content analysis + lang attribute |
| Chinese (Traditional) | zh-TW | Content analysis + lang attribute |
| Korean | ko | Content analysis + lang attribute |
| Vietnamese | vi | Content analysis + lang attribute |
lang attribute on the <html> element.lang attribute, both values are recorded for audit purposes.The language detection result appears in the attestation data:
{ "language": { "detected": "es", "htmlLang": "es", "confidence": 0.97, "disclosureText": "Al marcar esta casilla, usted acepta recibir llamadas..." }}Title VI of the Civil Rights Act of 1964 prohibits discrimination based on national origin in programs receiving federal financial assistance. Executive Order 13166 requires federal agencies and recipients of federal funds to provide meaningful access to individuals with limited English proficiency (LEP).
For organizations subject to Title VI:
eConsent’s language detection provides evidence that:
Set the lang attribute on your HTML element to improve detection accuracy:
<!-- English page --><html lang="en">
<!-- Spanish page --><html lang="es">
<!-- French page --><html lang="fr">If your site allows users to switch languages dynamically, ensure the lang attribute updates when the language changes:
// When user switches languagefunction switchLanguage(langCode) { document.documentElement.lang = langCode; // Load translated content...}eConsent captures the lang attribute at the moment of consent, so dynamic switching is handled correctly as long as the attribute reflects the currently displayed language.
For best results, register separate consent templates for each language in your dashboard:
See Consent Versioning for details on template management.
You can filter certificates by detected language in the dashboard:
Via the API, the language is included in certificate verification responses:
async function getCertificateLanguage(certificateId) { const response = await fetch( 'https://api.econsent.org/api/verify/certificate-info', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${process.env.ECONSENT_API_TOKEN}`, }, body: JSON.stringify({ certificate_id: certificateId, company_id: process.env.ECONSENT_COMPANY_ID, }), } );
const result = await response.json(); return { language: result.language, disclosureHash: result.disclosure_hash, };}import osimport requests
def get_certificate_language(certificate_id): response = requests.post( 'https://api.econsent.org/api/verify/certificate-info', headers={ 'Content-Type': 'application/json', 'Authorization': f'Bearer {os.getenv("ECONSENT_API_TOKEN")}', }, json={ 'certificate_id': certificate_id, 'company_id': os.getenv('ECONSENT_COMPANY_ID'), }, ) result = response.json() return { 'language': result.get('language'), 'disclosure_hash': result.get('disclosure_hash'), }Set the lang attribute
Always set the lang attribute on your html element. This is the most reliable signal for language detection and improves accuracy.
Register per-language templates
Create separate consent templates for each language so certificates match to the correct language-specific version.
Use qualified translators
Have consent disclosures translated by qualified legal translators, not machine translation. eConsent records what was shown but does not verify translation accuracy.
Test all languages
Generate test certificates for each language version to verify that detection and template matching work correctly before going live.