From 3a6acd9c2958fc4819ec5f2f49218334741ca24c Mon Sep 17 00:00:00 2001
From: zandercymatics <141044360+zandercymatics@users.noreply.github.com>
Date: Tue, 15 Aug 2023 07:56:09 -0600
Subject: [PATCH] Added translation
Requires {% load i18n %} within this scope as per docs: https://docs.djangoproject.com/en/4.1/topics/i18n/translation/#internationalization-in-template-code
---
src/registrar/templates/admin/base_site.html | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/registrar/templates/admin/base_site.html b/src/registrar/templates/admin/base_site.html
index 72bd7af21..6b641722f 100644
--- a/src/registrar/templates/admin/base_site.html
+++ b/src/registrar/templates/admin/base_site.html
@@ -1,5 +1,6 @@
{% extends "admin/base.html" %}
{% load static %}
+{% load i18n %}
{% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
@@ -13,20 +14,25 @@
{% include "admin/color_theme_toggle.html" %}
{% endif %}
{% endblock %}
+{% comment %}
+ This was copied from the 'userlinks' template, with a few minor changes.
+ You can find that here:
+ https://github.com/django/django/blob/d25f3892114466d689fd6936f79f3bd9a9acc30e/django/contrib/admin/templates/admin/base.html#L59
+{% endcomment %}
{% block userlinks %}
{% if site_url %}
- View site /
+ {% translate 'View site' %} /
{% endif %}
{% if user.is_active and user.is_staff %}
{% url 'django-admindocs-docroot' as docsroot %}
{% if docsroot %}
- Documentation /
+ {% translate 'Documentation' %} /
{% endif %}
{% endif %}
{% if user.has_usable_password %}
- Change password /
+ {% translate 'Change password' %} /
{% endif %}
- Log out
+ {% translate 'Log out' %}
{% include "admin/color_theme_toggle.html" %}
{% endblock %}
{% block nav-global %}{% endblock %}
\ No newline at end of file