Older version of me
Older version of me

Reputation: 66

change the language attrib in HTML tag based on user's language Django Wagtail

how to change the language attribute <html class="no-js" lang="en"> in HTML tag based on user's language dynamically? in ..

Django & #Wagtail templates

Upvotes: 3

Views: 340

Answers (1)

gasman
gasman

Reputation: 25292

Use the get_current_language tag:

<!doctype html>
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
<html class="no-js" lang="{{ LANGUAGE_CODE }}">

Upvotes: 4

Related Questions