Skip to content

i18n: add missing header, menu, subfooter, footer and search strings …#2502

Open
kehach07 wants to merge 7 commits intodjango:mainfrom
kehach07:i18n-header-footer-2500
Open

i18n: add missing header, menu, subfooter, footer and search strings …#2502
kehach07 wants to merge 7 commits intodjango:mainfrom
kehach07:i18n-header-footer-2500

Conversation

@kehach07
Copy link
Copy Markdown

@kehach07 kehach07 commented Feb 9, 2026

Adds missing translation markers for header, menu, subfooter, footer and search form.

Updates the English message catalog to expose the strings to Transifex.

Refs #2500

Copy link
Copy Markdown
Contributor

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

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

Hi there @kehach07,

Excellent suggestion to make this community more open to non-English speakers! Love it 💚

One point, please consider using translate not trans as found in the official documentation.

Besides that, there's a big mix of sentence case, title case, and more.
I usually like to keep translation strings agnostic and add the appropriate filter. E.G {% translate "get help"|title %}
Furthermore, if the word is ambiguous, use a context marker, like: {% translate "contact"|title context "verb" %}as the verbto contactmight have a different translation than the nouncontact`.

Cheers!
Joe

<li><a href="{% url 'diversity' %}">Diversity Statement</a></li>
<li><a href="{% url 'start' %}">{% trans "Getting Started with Django" %}</a></li>
<li><a href="{% url 'members:teams' %}">{% trans "Team Organization" %}</a></li>
<li><a href="{% url 'homepage' %}foundation/">{% trans "Django Software Foundation" %}</a></li>
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.

Off topic: Lots of hardcoded URLs in here.

Comment on lines +48 to +52
<li><a href="https://github.com/django">{% trans "GitHub" %}</a></li>
<li><a href="https://x.com/djangoproject">{% trans "X" %}</a></li>
<li><a href="https://fosstodon.org/@django" rel="me">{% trans "Fediverse (Mastodon)" %}</a></li>
<li><a href="https://bsky.app/profile/djangoproject.com">{% trans "Bluesky" %}</a></li>
<li><a href="https://www.linkedin.com/company/django-software-foundation">{% trans "LinkedIn" %}</a></li>
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.

Since those are brand names, I don't believe they need a translation.

<li><a href="https://www.linkedin.com/company/django-software-foundation">LinkedIn</a></li>
<li><a href="{% url 'weblog-feed' %}">News RSS</a></li>
<li><a href="https://github.com/django">{% trans "GitHub" %}</a></li>
<li><a href="https://x.com/djangoproject">{% trans "X" %}</a></li>
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.

Off Topic: Do we still do X? Doesn't that inherently violate the CoC? 😏

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Off Topic: Do we still do X? Doesn't that inherently violate the CoC? 😏

Thanks for the note! I’m working on the other suggested changes. Regarding X, my understanding is that it refers to the current name for Twitter. I’ve kept the existing link as-is for now, but I’m happy to update or remove it if the maintainers prefer a different approach.

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.

No worries, this was a joke. Since X formerly Twitter, largely abandoned content moderation. Whereas this community stands much firmer on its values.

</li>
<li><a href="https://chat.djangoproject.com" target="_blank">Django Discord</a></li>
<li><a href="https://forum.djangoproject.com/" target="_blank">Official Django Forum</a></li>
<li><a href="https://chat.djangoproject.com" target="_blank">{% trans "Django Discord" %}</a></li>
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.

While we're at it:

Suggested change
<li><a href="https://chat.djangoproject.com" target="_blank">{% trans "Django Discord" %}</a></li>
<li><a href="https://chat.djangoproject.com" target="_blank">{% trans "Django's Discord Server" %}</a></li>

<h3>{% trans "Get Help" %}</h3>
<ul>
<li><a href="{% url 'document-detail' lang='en' version='stable' url='faq' host 'docs' %}">Getting Help FAQ</a>
<li><a href="{% url 'document-detail' lang='en' version='stable' url='faq' host 'docs' %}">{% trans "Getting Help FAQ" %}</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
<li><a href="{% url 'document-detail' lang='en' version='stable' url='faq' host 'docs' %}">{% trans "Getting Help FAQ" %}</a>
<li><a href="{% url 'document-detail' lang='en' version='stable' url='faq' host 'docs' %}">{% trans "Getting Help & FAQ" %}</a>

@kehach07
Copy link
Copy Markdown
Author

Hi there @kehach07,

Excellent suggestion to make this community more open to non-English speakers! Love it 💚

One point, please consider using translate not trans as found in the official documentation.

Besides that, there's a big mix of sentence case, title case, and more. I usually like to keep translation strings agnostic and add the appropriate filter. E.G {% translate "get help"|title %} Furthermore, if the word is ambiguous, use a context marker, like: {% translate "contact"|title context "verb" %}as the verbto contactmight have a different translation than the nouncontact`.

Cheers! Joe

Thank you for the review and the helpful suggestions! I appreciate the guidance and will start working on the improvements to better align with the existing structure and design.

@kehach07
Copy link
Copy Markdown
Author

@codingjoe , Thank you for the helpful suggestions, Joe. I’ve addressed the requested changes and pushed the updates. Could you please take a look and let me know if anything still needs improvement?

@codingjoe
Copy link
Copy Markdown
Contributor

Hi @kehach07,

Excellent! 🎉 You will need a review of a website working group member. Sadly, I can't mention them... I need to clarify this, but off-topic.

I see most of my comments resolved except for the title filters. Things like {% 'Code' %} should become {% 'code'|title context 'noun' %} since only names are capitalized in English, and the placeholder should not be confused with to code the verb. As mentioned previously, context matters when translating into different languages.

Cheers!
Joe

@kehach07
Copy link
Copy Markdown
Author

kehach07 commented Mar 6, 2026

Hi @kehach07,

Excellent! 🎉 You will need a review of a website working group member. Sadly, I can't mention them... I need to clarify this, but off-topic.

I see most of my comments resolved except for the title filters. Things like {% 'Code' %} should become {% 'code'|title context 'noun' %} since only names are capitalized in English, and the placeholder should not be confused with to code the verb. As mentioned previously, context matters when translating into different languages.

Cheers! Joe

Hi Joe,

Thanks for the clarification! Just to confirm, should the navigation labels be updated using lowercase strings with translation context and the title filter (e.g., {% translate "code" context "noun" as label %}{{ label|title }}), or would you prefer another format for applying the title filter?

Happy to update it accordingly.

@codingjoe
Copy link
Copy Markdown
Contributor

codingjoe commented Mar 6, 2026

Hi Joe,

Thanks for the clarification! Just to confirm, should the navigation labels be updated using lowercase strings with translation context and the title filter (e.g., {% translate "code" context "noun" as label %}{{ label|title }}), or would you prefer another format for applying the title filter?

Happy to update it accordingly.

As far as I am aware, what I proposed is the shortest syntax available. So:

{% translate "code"|title context "noun" %}

It is valid syntax, even though it might look a little unfamiliar at first. It will create the following gettext message:

#: djangoproject/templates/includes/header.html:30
msgctxt "noun"
msgid "code"
msgstr ""

Now any person translating it will know what to do. Of course, you can add more context depending on the situation.

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