Reputation: 66
how to change the language attribute <html class="no-js" lang="en">
in HTML tag based on user's language dynamically? in ..
Upvotes: 3
Views: 340
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