The multi-language support settings under the Django Framework are as follows:
1. Installation of GNU GetText Tools
Django is built to support multiple languages through GetText, so you need to install
is: http://gnuwin32.sourceforge.net/packages/gettext.htm
Window platform Download binaries version (compiled exe, install directly), then set the system path
Ubuntu platform: sudo apt-get install GetText
2, set the project to settings.py
= Locale_paths = [Os.path.join (base_dir)]time_zone = use_i18n = use_l10n = Use_tz =
3, set the project under model.py
From django.utils.translation import Ugettext_lazy as _
String to parse with _ (' string to be translated ')
3, execute the command django-admin makemessages will generate Django.po file in the locale directory
This article is from the "Rockets in Progress" blog, please be sure to keep this source http://290916.blog.51cto.com/280916/1763773
Multi-language support settings under the Django framework