Casing problem in the Dutch Django admin

I have a remark about the Dutch translation of the Django admin. On the /admin/[app]/[model]/[pk]/change/ page, there’s a heading saying something along the lines of “Edit [name of model]”. This is translated to “[name of model] wijzigen” in Dutch, but the capitalization is incorrect. It would for example say “voorraaditem wijzigen” instead of “Voorraaditem wijzigen”. If it’s not possible to add a capital letter at the start of the model name, I would suggest “Wijzig voorraaditem” as a quick workaround.

What can I do to fix this?

2 Likes

A bit late here, but I thought I’d suggest a fix. This can be solved by adding text-transform: capitalize; css to the places in the admin that need this capitalization. That way the text can be voorraaditem wijzigen” but it would be presented in the browser as “Voorraaditem wijzigen”.

This would mean making a PR to Django with this change and explaining the need. Of course the people reviewing the PR would need to agree with the fix. You could also open a ticket and explain the situation first (if it’s still a problem).

1 Like

Along the same lines, capfirst in the template might be all we need. I think we use that in similar places. Did you track down the specific place in the template where it’s missing? That would be a quick fix & merge if so.

Yeah, capfirst would also work. I think the problem is in the title of the change page which is set in title in admin/base.html:

https://github.com/django/django/blob/2e48636c54910e435eb31e1b7d8a8089c84233ad/django/contrib/admin/templates/admin/base.html#L105

https://github.com/django/django/blob/2e48636c54910e435eb31e1b7d8a8089c84233ad/django/contrib/admin/options.py#L2187

Since this is the base template, it seems like this would be a broader change than I had initially thought. I wonder if {{ title|capfirst }} would always be the correct thing to do for titles in the admin. Just trying to think of unintended side effects.

1 Like