# Django 404 Error Translation

**URL:** <https://forum.djangoproject.com/t/django-404-error-translation/38891>\
**Category:** Internationalization\
**Created:** [February 17, 2025, 3:09am UTC](https://forum.djangoproject.com/t/django-404-error-translation/38891 "2025-02-17T03:09:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jburns6789](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jburns6789/32/20697_2.png) [@jburns6789](https://forum.djangoproject.com/u/jburns6789)\
**Post date:** [February 17, 2025, 3:09am UTC](https://forum.djangoproject.com/t/django-404-error-translation/38891/1 "2025-02-17T03:09:04Z")

</div>

Hi,

I’ve been attempting to figure the best approach to add translation to error messages.

Here is the ticket [#36142 (django.shortcuts.get\_object\_or\_404 does not support translation for error messages (i18n)) – Django](https://code.djangoproject.com/ticket/36142)

This is what I believe to be the best approach this far:

pulled from this source [Translation | Django documentation | Django](https://docs.djangoproject.com/en/5.1/topics/i18n/translation/)

```auto
from django.http import HttpResponse
from django.utils.translation import gettext as _

def my_view(request):
output = _("Welcome to my site.")
return HttpResponse(output)

```

The value errors need to be translated from the  
various methods when raised [django/django/shortcuts.py at stable/5.1.x · django/django · GitHub](https://github.com/django/django/blob/stable/5.1.x/django/shortcuts.py#L65)

Any feedback or suggestions would be appreciated
