Browse Source

Update docs on get_language_info tag

Prompted by https://stackoverflow.com/q/77646918/1853523 - link to the docs for the tag rather than the function, and include the `{% load i18n %}` line.
Matt Westcott 1 year ago
parent
commit
33e4e1a136
1 changed files with 3 additions and 1 deletions
  1. 3 1
      docs/advanced_topics/i18n.md

+ 3 - 1
docs/advanced_topics/i18n.md

@@ -412,9 +412,11 @@ the name of the locale in its own language. We also add `rel` and `hreflang` att
 `translation.locale` is an instance of the [Locale model](locale_model_ref).
 
 Alternatively, a built-in tag from Django that gets info about the language of the translation.
-For more information, see [get_language_info() in the Django docs](https://docs.djangoproject.com/en/stable/topics/i18n/translation/#django.utils.translation.get_language_info).
+For more information, see [get_language_info in the Django docs](https://docs.djangoproject.com/en/stable/topics/i18n/translation/#get-language-info).
 
 ```html+django
+{% load i18n %}
+
 {% get_language_info for translation.locale.language_code as lang %}
 ```