[Django] #31037: Template truncatechars dots missing

52 views
Skip to first unread message

Django

unread,
Nov 26, 2019, 11:20:13 PM11/26/19
to django-...@googlegroups.com
#31037: Template truncatechars dots missing
-------------------------------------------+-------------------------------
Reporter: 老广 | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 2.2
Severity: Normal | Keywords: truncatechars
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+-------------------------------
Django 2.1.14 work fine, version 2.2.x has bug


{{ "Hello Django" | truncatechars:10 }}

Django 2.1.x output: Hello D...
Django 2.2.x output: Hello Djan

But the doc match the first case

https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#truncatechars

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

Django

unread,
Nov 27, 2019, 1:22:13 AM11/27/19
to django-...@googlegroups.com
#31037: Template truncatechars dots missing.
---------------------------------+--------------------------------------
Reporter: 老广 | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 2.2
Severity: Normal | Resolution: invalid

Keywords: truncatechars | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by felixxm):

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


Comment:

`truncatechars` now uses the real ellipsis character (…) instead of 3
dots, this is a
[https://docs.djangoproject.com/en/2.2/releases/2.2/#miscellaneous
documented] and expected change.

`{{ "Hello Django" | truncatechars:10 }}` returns `Hello Dja…` for me.

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

Django

unread,
Nov 28, 2019, 3:47:54 AM11/28/19
to django-...@googlegroups.com
#31037: Template truncatechars dots missing.
---------------------------------+--------------------------------------
Reporter: 老广 | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 2.2
Severity: Normal | Resolution: invalid

Keywords: truncatechars | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Comment (by 老广):

Replying to [comment:1 felixxm]:


> `truncatechars` now uses the real ellipsis character (…) instead of 3
dots, this is a
[https://docs.djangoproject.com/en/2.2/releases/2.2/#miscellaneous
documented] and expected change.
>
> `{{ "Hello Django" | truncatechars:10 }}` returns `Hello Dja…` for me.

I found the bug, It's because the Django locale zh-hans Lost the ellipsis


> #, python-format
> msgctxt "String to return when truncating text"
> msgid "%(truncated_text)s…"
> msgstr "%(truncated_text)s"


https://github.com/django/django/blob/stable/2.2.x/django/conf/locale/zh_Hans/LC_MESSAGES/django.po#L1048

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

Django

unread,
Nov 28, 2019, 3:49:33 AM11/28/19
to django-...@googlegroups.com
#31037: Template truncatechars dots missing.
---------------------------------+--------------------------------------
Reporter: 老广 | Owner: nobody
Type: Bug | Status: new
Component: Template system | Version: 2.2
Severity: Normal | Resolution:

Keywords: truncatechars | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by 老广):

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


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

Django

unread,
Nov 28, 2019, 4:59:54 AM11/28/19
to django-...@googlegroups.com
#31037: Template truncatechars dots missing.
---------------------------------+--------------------------------------
Reporter: 老广 | Owner: nobody
Type: Bug | Status: closed

Component: Template system | Version: 2.2
Severity: Normal | Resolution: invalid

Keywords: truncatechars | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by felixxm):

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


Comment:

Thanks for the report, however, translations are handled at
[https://docs.djangoproject.com/en/dev/internals/contributing/localizing/#translations.
Transifex] and not in this tracker.

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

Reply all
Reply to author
Forward
0 new messages