A Quick Intro to Translation in Django (Internationalization)
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they followed when asking why makemessages fails or translations do not show up in their Django project.
Recommended by 0 people across 0 different months, 2020 to 2022.
What it is
A short Pretty Printed tutorial on setting up translation (internationalization) in a Django app, with a demo site that supports English and Spanish. It walks through marking strings, generating message files and switching languages, with the code shared alongside.
What people said
Cites Yehia Yasser · 2020-12 · Stack Overflow · on “Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed”
[this video] i followed this video and when i do this command django-admin makemessages -l ar it gives me this error CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed. and i have installed pip install python-gettext any aswers? Thanks in advance
Cites Speed Junior · 2021-03 · Stack Overflow · on “Trying to execute django-admin makemessages in windows 10”
I´m trying to generate translation file using command django-admin makemessages -l pt-br in Windows 10 but unfortunately the files aren´t generated. Here the steps that I followed: Installed gettext library from mlocati [LINK] . I also tried several options from django i18n: Make sure you have GNU gettext tools [LINK] , this process is more manual. As the result when i run django-admin makemessages -l pt-br looks like that Django is executing something but the directory is not generated in the end. Here are some peace of code that I have views.py from django.shortcuts import render from django.utils.translation import gettext as _ def index(request): context = { 'hello': _('Hello!') } return
Cites SolnLase · 2022-02 · Stack Overflow · on “Why my translations in django i18n don't work”
I've been following 3 different tutorials for text translation in django, and with none of them my translation has worked, however I was doing exactly the same steps as in the tutorials. Django just doesn't translate my text, it goes without any kind of error. My last try was with this course: [this video] . But just to be sure I'm adding my code below settings.py # Internationalization # [LINK] LANGUAGE_CODE = 'es' TIME_ZONE = 'UTC' USE_I18N = True USE_TZ = True views.py from django.utils.translation import gettext as _ # Create your views here. def index(request): context = { 'hello':_('Hello'), } return render(request, 'index.html', context) index.html {% load i18n %} <html lang="en"> <head> <