---
title: '{% get_current_language %}'
description: puts the active language code in a variable.
date: '2026-08-21'
categories:
  - Template Tag
  - Utility
canonical: https://www.djangotemplatetagsandfilters.com/tags/get_current_language/
doc_link: >-
  https://docs.djangoproject.com/en/6.1/topics/i18n/translation/#std-templatetag-get_current_language
---

# {% get_current_language %}

puts the active language code in a variable.

## Documentation

The language code currently in effect, for marking the selected entry in a switcher or setting `lang` on the page.

### Template

```django
{% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE }}">
```
