From 8a17121ed1c718f1eb997914bf1797981a78f8f7 Mon Sep 17 00:00:00 2001 From: Mindey Date: Sun, 17 Jan 2016 11:41:48 +0200 Subject: [PATCH] adapted for Django 1.9 change for Chinese language code: https://github.com/tomchristie/django-rest-framework/issues/2688 --- .../migrations/0024_auto_20160117_0139.py | 20 ++++++++++++++++++ src/apps/core/models/core.py | 2 +- src/conf/base.py | 2 +- .../{zh_CN => zh_Hans}/LC_MESSAGES/django.mo | Bin .../{zh_CN => zh_Hans}/LC_MESSAGES/django.po | 0 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/apps/core/migrations/0024_auto_20160117_0139.py rename src/locale/{zh_CN => zh_Hans}/LC_MESSAGES/django.mo (100%) rename src/locale/{zh_CN => zh_Hans}/LC_MESSAGES/django.po (100%) diff --git a/src/apps/core/migrations/0024_auto_20160117_0139.py b/src/apps/core/migrations/0024_auto_20160117_0139.py new file mode 100644 index 0000000..d95d4fe --- /dev/null +++ b/src/apps/core/migrations/0024_auto_20160117_0139.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.1 on 2016-01-17 09:39 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0023_auto_20160115_1150'), + ] + + operations = [ + migrations.AlterField( + model_name='language', + name='language_code', + field=models.CharField(max_length=8), + ), + ] diff --git a/src/apps/core/models/core.py b/src/apps/core/models/core.py index de45e03..7cda8c2 100644 --- a/src/apps/core/models/core.py +++ b/src/apps/core/models/core.py @@ -740,7 +740,7 @@ class Language(models.Model): http_accept_language = models.CharField(max_length=255, blank=True, null=True) omegawiki_language_id = models.PositiveIntegerField(null=True, blank=True) - language_code = models.CharField(max_length=5) + language_code = models.CharField(max_length=8) def __unicode__(self): try: diff --git a/src/conf/base.py b/src/conf/base.py index 9eac43f..35e0d0c 100644 --- a/src/conf/base.py +++ b/src/conf/base.py @@ -70,7 +70,7 @@ ('ru', _('Russian')), # ('ja', _('Japanese')), # ('fr', _('French')), - ('zh-cn', _('Chinese')), + ('zh-hans', _('Chinese')), # ('de', _('German')), ('lt', _('Lithuanian')), # ('uk', _('Ukrainian')) diff --git a/src/locale/zh_CN/LC_MESSAGES/django.mo b/src/locale/zh_Hans/LC_MESSAGES/django.mo similarity index 100% rename from src/locale/zh_CN/LC_MESSAGES/django.mo rename to src/locale/zh_Hans/LC_MESSAGES/django.mo diff --git a/src/locale/zh_CN/LC_MESSAGES/django.po b/src/locale/zh_Hans/LC_MESSAGES/django.po similarity index 100% rename from src/locale/zh_CN/LC_MESSAGES/django.po rename to src/locale/zh_Hans/LC_MESSAGES/django.po