TL;DR: Most language issues come from incorrect HTML lang attributes. Check your site's <html lang="..."> tag matches your target language code. Clear your browser cache and test in incognito mode.

Overview

Consently detects your banner language automatically from your website's HTML lang attribute. When the banner displays the wrong language or translations don't appear, it's usually a configuration issue with this detection system. 


Troubleshooting

Banner showing the wrong language

Why this happens: The language displayed is determined by your website's <html lang=""> attribute. If this doesn't match your intended language, the banner defaults to English or might show unexpected content.

Solution:

  1. Check your website's HTML source code for the opening <html> tag using developer tools

  2. To open the browser's developer tools, right-click anywhere on the page and select Inspect, or use the keyboard shortcut Ctrl + Shift + I on Windows and Cmd + Option + I on macOS.

  3. Look for the lang attribute (e.g., <html lang="en"> for English, <html lang="fr"> for French)

  4. Verify the language code matches one you've configured in Editing Language Content

  5. Update the HTML lang attribute to your desired language code

  6. Clear your browser cache and reload the page

💡 Tip: Common language codes are en (English), fr (French), de (German), es (Spanish), ar (Arabic), bg (Bulgarian), cs (Czech), da (Danish), el (Greek).
BlockNote image

The HTML lang attribute is missing

Solution:

  1. Add the lang attribute to your site's <html> tag in your theme or template file

  2. Use the two-letter ISO language code for your primary language

  3. If you can't edit the HTML tag directly, check your CMS or website builder settings for language options

See these examples from popular platforms:

For WordPress: Go to SettingsGeneralSite Language

BlockNote image

For Dorik: Go to Site Settings GeneralSite Language

BlockNote image

For Wix: Go to Settings Language and RegionSite Language

BlockNote image

Translation fields appear empty or incomplete

Why this happens: You may have added a language, but haven't filled in all translation fields yet.

Solution:

  1. Navigate to Language in your site dashboard

  2. Click Edit Content next to the affected language

  3. Select the language from the dropdown

  4. Scroll through all sections and fill in any blank fields

  5. Click Save Changes at the bottom

BlockNote image

Characters displaying incorrectly (encoding issues)

Why this happens: Character encoding mismatches between your website and Consently can cause special characters to display as symbols or question marks.

Solution:

  1. Verify your website uses UTF-8 encoding by checking for <meta charset="UTF-8"> on your site's <head> section

  2. Ensure your language translations are entered using proper character encoding in the Consently editor

  3. For languages with special characters (Arabic, Greek, Cyrillic, etc.), copy-paste text from a proper text editor rather than typing directly

  4. If issues persist, try re-entering the affected translations

BlockNote image

Language detection is not working after setup

Solution:

  1. Clear your browser cache completely (Ctrl+Shift+Delete or Cmd+Shift+Delete)

  2. Test in an incognito/private browsing window

  3. Check that the Consently script is loading properly by opening your browser's developer console (press F12)

  4. Look for errors in the Console tab related to Consently

  5. Verify the HTML lang attribute hasn't been changed or removed

BlockNote image

The default language appears instead of the intended language

Why this happens: If Consently can't find a matching translation for the detected language code, it falls back to your default language.

Solution:

  1. Go to LanguageManage Language

  2. Check which language has the "Default" badge

  3. Verify the language code in your HTML tag exactly matches one of your configured languages

  4. Language codes are case-sensitive: en works, but EN may not

BlockNote image

Testing language detection across different languages

How to test:

  • Create a simple test HTML file with different lang attributes:

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>French Test Page</title>
<!-- Your Consently script here -->
</head>
<body>
<h1>Test Page</h1>
</body>
</html>
  • Change lang="fr" to other configured languages and reload

  • Verify the banner content updates to match the lang attribute

  • Test all languages you've configured in Consently

BlockNote image

Banner language differs from website language

Why this might be intentional: You may want to show a consent banner in one language while your website content is in another (e.g., English banner on a multilingual site).

Solution:

  1. Set your website's HTML lang attribute to match your banner's intended language

  2. Consider whether visitors would be confused by language mismatches


What's Next 

If language issues persist after trying these solutions:

  1. Contact Support with details about your site's HTML lang attribute and configured languages


Related Pages