Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to translate the content of not_found_subject from 404 template page #11406

Open
rffontenelle opened this issue Jun 12, 2024 · 2 comments
Labels
Accepted Accepted issue on our roadmap Bug A bug

Comments

@rffontenelle
Copy link
Contributor

{% blocktrans trimmed with project_slug=project.slug %}
You are browsing the documentation of <code>{{ project_slug }}</code>.
The {{ not_found_subject }} you are looking for was not found.
{% endblocktrans %}

Let me show an example of Brazilian Portuguese translation:

This message is extracted as the following to the message catalog (po file):

#: templates/errors/404/include_error_message.html:4
#, python-format
msgid ""
"You are browsing the documentation of <code>%(project_slug)s</code>. The "
"%(not_found_subject)s you are looking for was not found."
msgstr ""
"Você está navegando na documentação de <code>%(project_slug)s</code>. O "
"%(not_found_subject)s que você está procurando não foram encontrados."

Here is how I see it in Sphinx documentation, translated to pt-br (example):

Você está navegando na documentação de sphinx-pt-br. O documentation page que você está procurando não foram encontrados.

Notice how {{ not_found_subject }} is replaced with the value documentation page, which is not available for translation in the aforementioned message catalog.

@rffontenelle rffontenelle changed the title Unable to translate the content of not_found_subject Unable to translate the content of not_found_subject from 404 template page Jun 12, 2024
@humitos humitos added Bug A bug Accepted Accepted issue on our roadmap labels Jun 12, 2024
@humitos
Copy link
Member

humitos commented Jun 12, 2024

Thanks for reporting this. It seems it's missing the variable in the with from the blocktrans 👍🏼

@rffontenelle
Copy link
Contributor Author

I don't know the possible values here, but I would like to ask to be careful with the gender of the value of not_found_subject.

I translated this message considering the male gender as I thought the value was from:

template_name = "errors/404/dns.html"
not_found_subject = pgettext_lazy(
_not_found_subject_translation_context, "matching DNS record"
)

However, "documentation page" is female in my language (in Spanish as well, I believe), which resulted in a awful translation.

So even if not_found_subject's value is marked as translatable, one could still face a hard time to translate different possible genders in a single string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug A bug
Projects
None yet
Development

No branches or pull requests

2 participants