Skip to content

Language Detection

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:

  • Was the disclosure in a language the consumer understands? Courts may invalidate consent if the consumer could not read the disclosure.
  • Does the translated disclosure match the English original? Auditors need to verify that translations are accurate and complete.
  • Which version of the disclosure was shown? Multi-language sites may serve different content based on browser locale or user selection.

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:

LanguageCodeDetection method
EnglishenContent analysis + lang attribute
SpanishesContent analysis + lang attribute
FrenchfrContent analysis + lang attribute
PortugueseptContent analysis + lang attribute
GermandeContent analysis + lang attribute
ItalianitContent analysis + lang attribute
Chinese (Simplified)zhContent analysis + lang attribute
Chinese (Traditional)zh-TWContent analysis + lang attribute
KoreankoContent analysis + lang attribute
VietnameseviContent analysis + lang attribute
  1. When a consent event is captured, eConsent reads the lang attribute on the <html> element.
  2. If a specific language is detected from the attribute, it is recorded on the certificate.
  3. eConsent also analyzes the extracted consent disclosure text using character set detection and n-gram analysis.
  4. If the content analysis disagrees with the lang attribute, both values are recorded for audit purposes.
  5. The detected language is stored on the certificate and included in the attestation data.

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:

  • Healthcare providers receiving Medicare/Medicaid funding must provide consent forms in the patient’s preferred language.
  • Financial institutions participating in federal programs must offer disclosures in languages understood by their consumers.
  • Government contractors must ensure that consent processes are accessible to LEP individuals.

eConsent’s language detection provides evidence that:

  1. The consent disclosure was presented in a specific language.
  2. The language matched (or did not match) the consumer’s apparent preference.
  3. The full content of the disclosure in that language was captured and hashed.

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 language
function 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:

  1. Navigate to Settings > Consent Templates.
  2. Create a template for each language version (e.g., “TCPA Disclosure v3.1 - English”, “TCPA Disclosure v3.1 - Spanish”).
  3. Each language version will have a unique SHA-256 hash.
  4. Certificates will match against the correct language-specific template.

See Consent Versioning for details on template management.

You can filter certificates by detected language in the dashboard:

  1. Navigate to Certificates in your dashboard.
  2. Use the Language filter to view certificates for a specific language.
  3. Export filtered results for compliance reporting.

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,
};
}

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.