Skip to content

i18n: mark base template strings for translation#2494

Open
CodeVishal-17 wants to merge 2 commits intodjango:mainfrom
CodeVishal-17:add-hr-translation
Open

i18n: mark base template strings for translation#2494
CodeVishal-17 wants to merge 2 commits intodjango:mainfrom
CodeVishal-17:add-hr-translation

Conversation

@CodeVishal-17
Copy link
Copy Markdown

@CodeVishal-17 CodeVishal-17 commented Feb 3, 2026

This PR fixes a template-level internationalization issue in the base site layout so existing translations can be rendered correctly.

Specifically:

Marks user-visible strings in base.html (e.g. tagline, accessibility links) with {% trans %} so they are picked up by Django’s i18n system.

Aligns base.html with other already-internationalized templates, ensuring consistent behavior across all non-English locales.

No translation content was added or modified; this change only ensures existing translations are used.

Related to: #2474

Comment thread .gitignore
djangoproject/cache
djangoproject/static/css/*.map
djangoproject/static/css/*.css
venv/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need to exclude files such as those generated by an IDE, use
$GIT_DIR/info/exclude or the core.excludesFile configuration variable as described in https://git-scm.com/docs/gitignore

<meta property="og:title" content="{% block og_title %}Django{% endblock %}" />
<meta property="og:description" content="{% block og_description %}{% spaceless %}
The web framework for perfectionists with deadlines.
{% trans "The web framework for perfectionists with deadlines." %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% trans "The web framework for perfectionists with deadlines." %}
{% translate "The web framework for perfectionists with deadlines." %}


<title>{% block title %}The web framework for perfectionists with deadlines{% endblock %} | Django</title>
<title>
{% block title %}{% trans "The web framework for perfectionists with deadlines" %}{% endblock %} | Django
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% block title %}{% trans "The web framework for perfectionists with deadlines" %}{% endblock %} | Django
{% block title %}{% translate "The web framework for perfectionists with deadlines" %}{% endblock %} | Django

{% block before_header %}{% endblock %}

<a href="#main-content" class="skip-link">Skip to main content</a>
<a href="#main-content" class="skip-link">{% trans "Skip to main content" %}</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<a href="#main-content" class="skip-link">{% trans "Skip to main content" %}</a>
<a href="#main-content" class="skip-link">{% translate "Skip to main content" %}</a>

{% block content %}{% endblock %}
<a href="#top" class="backtotop"><i class="icon icon-chevron-up"></i> Back to Top</a>
<a href="#top" class="backtotop">
<i class="icon icon-chevron-up"></i> {% trans "Back to Top" %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<i class="icon icon-chevron-up"></i> {% trans "Back to Top" %}
<i class="icon icon-chevron-up"></i> {% translate "Back to Top" %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants