Opened 5 years ago

Closed 5 years ago

#31037 closed Bug (invalid)

Template truncatechars dots missing.

Reported by: 老广 Owned by: nobody
Component: Template system Version: 2.2
Severity: Normal Keywords: truncatechars
Cc: ibuler@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (4)

comment:1 by Mariusz Felisiak, 5 years ago

Resolution: invalid
Status: newclosed
Summary: Template truncatechars dots missingTemplate truncatechars dots missing.

truncatechars now uses the real ellipsis character (…) instead of 3 dots, this is a documented and expected change.

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

in reply to:  1 comment:2 by 老广, 5 years ago

Replying to felixxm:

truncatechars now uses the real ellipsis character (…) instead of 3 dots, this is a 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

comment:3 by 老广, 5 years ago

Resolution: invalid
Status: closednew

comment:4 by Mariusz Felisiak, 5 years ago

Resolution: invalid
Status: newclosed

Thanks for the report, however, translations are handled at Transifex and not in this tracker.

Note: See TracTickets for help on using tickets.
Back to Top