[Django] #21107: Django Admin doc Chinese description

12 views
Skip to first unread message

Django

unread,
Sep 16, 2013, 3:17:40 AM9/16/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+---------------------
Reporter: Balicanta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Keywords: Chinese
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+---------------------
I try to add admin doc in my project , and add some description to model's
docstring, but it appear some error, and my description is Chinese

and I think the problem is cause by
"contrib/admindocs/templates/admin_doc/model_detail.html line 29" and {%
trans description %} , when I

remove the trans, the error will disappear, my question is the description
really need trans?

--
Ticket URL: <https://code.djangoproject.com/ticket/21107>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 16, 2013, 3:54:57 PM9/16/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+--------------------------------------
Reporter: Balicanta | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution: needsinfo

Keywords: Chinese | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by claudep):

* status: new => closed
* needs_better_patch: => 0
* resolution: => needsinfo
* needs_tests: => 0
* needs_docs: => 0


Comment:

I was not able to reproduce your problem. You should give us some minimal
code to reproduce the error (and possibly the full traceback of the
error).

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:1>

Django

unread,
Sep 16, 2013, 11:47:44 PM9/16/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+--------------------------------------

Reporter: Balicanta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution:

Keywords: Chinese | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by balicanta):

* status: closed => new
* resolution: needsinfo =>


Comment:

Sorry, if i have a model like
{{{
class Song(models.Model):
"""
歌曲
"""
}}}

And that will appear the error , but if I change to
{{{
class Song(models.Model):
"""
Song
"""
}}}
that admin doc work correctly

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:2>

Django

unread,
Sep 17, 2013, 8:48:24 AM9/17/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+--------------------------------------

Reporter: Balicanta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution:

Keywords: Chinese | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by claudep):

What is the encoding of your file (see preamble at the top of the file)?

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:3>

Django

unread,
Sep 17, 2013, 12:42:27 PM9/17/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+--------------------------------------

Reporter: Balicanta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution:

Keywords: Chinese | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Balicanta ):

{{{
# coding: utf-8
}}}

Top of the model.py, thanks

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:4>

Django

unread,
Sep 18, 2013, 12:46:18 PM9/18/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+------------------------------------

Reporter: Balicanta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution:
Keywords: Chinese | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by timo):

* stage: Unreviewed => Accepted


Comment:

I can reproduce with the details above, the exception is a
`DjangoUnicodeDecodeError`:
{{{
Exception Value: 'ascii' codec can't decode byte 0xe6 in
position 5: ordinal not in range(128). You passed in
<django.utils.functional.__proxy__ object at 0x7fe4f4341b50> (<class
'django.utils.functional.__proxy__'>)
}}}

Not sure about the solution, but I don't think simply removing the `{%
trans %}` tag is the correct one.

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:5>

Django

unread,
Sep 18, 2013, 1:13:19 PM9/18/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+------------------------------------

Reporter: Balicanta | Owner: nobody
Type: Bug | Status: new
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution:
Keywords: Chinese | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by mjtamlyn):

Does making the docstring a Unicode string help?

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:6>

Django

unread,
Sep 18, 2013, 1:51:33 PM9/18/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+------------------------------------
Reporter: Balicanta | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admindocs | Version: 1.5
Severity: Normal | Resolution: invalid

Keywords: Chinese | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => invalid


Comment:

Yes, that fixes the issue, thanks! So to summarize, this isn't an issue
with Django but rather you need to make the docstring a unicode string by
prefixing it with a `u` or using `from __future__ import
unicode_literals`.

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:7>

Django

unread,
Sep 19, 2013, 3:15:01 AM9/19/13
to django-...@googlegroups.com
#21107: Django Admin doc Chinese description
-----------------------------------+------------------------------------
Reporter: Balicanta | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admindocs | Version: 1.5

Severity: Normal | Resolution: invalid
Keywords: Chinese | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by claudep):

Ah yes, I had the `from __future__ import unicode_literals` in my test
file, that's why I couldn't reproduce.

--
Ticket URL: <https://code.djangoproject.com/ticket/21107#comment:8>

Reply all
Reply to author
Forward
0 new messages