python
INSTALLED_APPS = [
...
'django.contrib.sessions',
'suit',
...
]
python
from django.utils.translation import gettext_lazy as _
python
LANGUAGES = (
('zh-Hans', _('Simplified Chinese')),
('en', _('English')),
python
from django.db import models
from django.utils.translation import gettext_lazy as _
class MyModel(models.Model):
my_field = models.CharField(_('My Field'), max_length=100)
python manage.py makemessages -l zh_Hans
python manage.py compilemessages
html
{% load i18n %}
<h1>{% trans "Welcome to my website!" %}</h1>