Model field translations

Hey everyone, I’m in need of translations on my model fields (i.e. name). I see there are quite a few solutions in the field, however I’m unsure of which is most practical. I can’t share full context but let’s say that I have a model for news articles:

class Article(models.Model):
    title = models.CharField(max_length=200)

Ideally my API would return the title in the locale of the user. Any suggestions from Django experts? I would like to prevent overcomplexity.

Hello there.
Have you considered django-modeltranslation?

Thanks! Just gave it a try and seems to work very well.

Can you share, do you use the package or did you find something else? I am learning about dynamic translation, so i just wanted to know, and this post poped up while searching.

Thanks

Hey @tomislavm021, I’ve been using the above recommended package which integrates very well into my backend. Hope that helps!

Hi, thank you. I was away and didn’t login for a while. In the meantime i was playing around with django and model translations, also i have found a way to translate slugs on language change. But if you want to use your own dashboard (not django admin) then the process of setting up everything is really tedious.

I will post how i did it soon :slight_smile: