Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#24181 closed Bug (fixed)

THOUSAND_SEPARATOR strings are reversed

Reported by: Kay Cha Owned by: Varun Sharma
Component: Utilities Version: 1.7
Severity: Normal Keywords: l10n
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Kay Cha)

Hi.

numberformat moduler returns a reversed number as a string when THOUSAND_SEPARATOR has letters with l18n.

# mysite/formats/ko/formats.py

THOUSAND_SEPARATOR = 'comma'
{% load humanize %}

{{10000|intcomma}}
  • current output : 10ammoc000
  • correct output : 10comma000

Attachments (1)

patch_24181.diff (1.3 KB ) - added by Varun Sharma 9 years ago.
Added unit test to the patch

Download all attachments as: .zip

Change History (14)

comment:1 by Kay Cha, 9 years ago

Description: modified (diff)

comment:2 by Kay Cha, 9 years ago

Has patch: set

comment:3 by Tim Graham, 9 years ago

Is there a real use case for a THOUSAND_SEPARATOR of length > 1?

comment:4 by Kay Cha, 9 years ago

yes.

comment:5 by Aymeric Augustin, 9 years ago

Would you mind saying a bit more about that use case -- e.g. in what language or country it happens?

comment:6 by Kay Cha, 9 years ago

Oh, it was related to Korea and Korean, but only just for some people. So I don't think my case is normal.
(NUMBER_GROUPING=4 and THOUSAND_SEPARATOR is assigned by one comma and one space for visibility)

Whether a length of THOUSAND_SEPARATOR is 1 or not(THOUSAND_SEPARATOR isn't restricted by a length), the case(reversed letters) is not my intention.

Last edited 9 years ago by Kay Cha (previous) (diff)

comment:7 by Claude Paroz, 9 years ago

Why is "has patch" set? hannal, is there a patch somewhere?

in reply to:  7 comment:8 by Kay Cha, 9 years ago

https://github.com/hannal/django/commit/f610ca66c622e2fc8059c4c2960fe1a3897987c0

I'm sorry I didn't know how I can attach the patch with "has patch".

Replying to claudep:

Why is "has patch" set? hannal, is there a patch somewhere?

comment:9 by Claude Paroz, 9 years ago

Component: UncategorizedUtilities
Easy pickings: set
Needs tests: set
Triage Stage: UnreviewedAccepted

Thanks, could you write a test for it, please?

comment:10 by Varun Sharma, 9 years ago

Owner: changed from nobody to Varun Sharma
Status: newassigned

by Varun Sharma, 9 years ago

Attachment: patch_24181.diff added

Added unit test to the patch

comment:12 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 540ca563dea624823e0b363f98302a78294836ad:

Fixed #24181 -- Fixed multi-char THOUSAND_SEPARATOR insertion

Report and original patch by Kay Cha.

comment:13 by Claude Paroz <claude@…>, 9 years ago

In b44a56c3080312ab94679a396e6b60a18f9b6463:

[1.8.x] Fixed #24181 -- Fixed multi-char THOUSAND_SEPARATOR insertion

Report and original patch by Kay Cha.
Backport of 540ca563de from master.

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