Fix i18n on Chinese after updating Django to 1.8 or later

After update django to 1.8.x, when run the project, one warning message is displayed:

/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py:146: RemovedInDjango19Warning: The use of the language code 'zh-cn' is deprecated. Please use the 'zh-hans' translation instead.

To fix this:

  • First go to project setting file, change 'zh-cn' to 'zh-hans'
  • Second, rename the 'zh-CN' folder in locale to 'zh-Hans'
  • Run django-admin makemessages and django-admin compilemessages if necessary
  • Go to your template, in the language toggle form, change language input value to zh-hans

Good Luck :D