Translating humanize text in Django

440 Views Asked by At

I have some issues while trying to translate in django (on the front end)

So I have a Contact model that has a bunch of messages. Each message has a "contact_date" field which I convert using humanize on the front end.

{{ message.contact_date | naturaltime }}

I have these in my settings.py

LANGUAGE_CODE = 'en-US'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

I kind of managed to make it work, but it involved changing my project's language code to the other language and removing the LocaleMiddleware. Then what happened is that my admin area changed into that language and I want it in English.

My goal is to leave everything in English and just convert the contact_date to the other language.

Any help would be appreciated, thanks!

0

There are 0 best solutions below