Opened 14 years ago

Closed 12 years ago

#12379 closed New feature (fixed)

Simplified Chinese(CN) localflavor package

Reported by: Xia Kai(夏恺) Owned by: nobody
Component: contrib.localflavor Version:
Severity: Normal Keywords: CN localflavor
Cc: xiaket@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The attached patch contains:

  • CNProvinceSelect - Select widget for Chinese provinces
  • CNPostCodeField - Form field for Chinese post codes
  • CNIDCardField - Form field for Chinese ID Card numbers
  • CNPhoneNumberField - Form field for Chinese regular phone numbers
  • CNCellNumberField - Form field for Chinese cell phone numbers

Documentation and tests are included!

Attachments (4)

cn-localflavor-against-r11809.diff (19.1 KB) - added by Xia Kai(夏恺) 14 years ago.
Chinese localflavor patch against current trunk, and it would work for version 1.1.1
cn_localflavor_r13230.diff (18.9 KB) - added by Daniel Duan <DaNmarner@…> 13 years ago.
slightly modified.
cn_localflavor_1.3.diff (19.8 KB) - added by Daniel Duan 12 years ago.
Tests rewritten with unittest
cn_localflavor_r15942.diff (18.4 KB) - added by Łukasz Rekucki 12 years ago.
Last patch with cosmetic changes.

Download all attachments as: .zip

Change History (16)

Changed 14 years ago by Xia Kai(夏恺)

Chinese localflavor patch against current trunk, and it would work for version 1.1.1

comment:1 Changed 14 years ago by Cliff Dyer

Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 14 years ago by Jannis Leidel

Triage Stage: Design decision neededAccepted

comment:3 Changed 14 years ago by xxxss@…

The directory should be localflavor/zh_CN instead of localflavor/cn, right?

comment:4 Changed 14 years ago by Jannis Leidel

No, "cn" is correct because the localflavor contrib app organizes its content per country, not locale.

comment:5 Changed 14 years ago by Russell Keith-Magee

milestone: 1.2
Version: SVN

comment:6 Changed 13 years ago by Daniel Duan <DaNmarner@…>

I can verify that this looks like a sane patch. Couple of comments here:

  1. The select value shouldn't has space in it.
  2. IMO, the location code is too specific to be located in a standalone file(it is the ID Card checking algorithm detail, not in anyway reusable).

Changed 13 years ago by Daniel Duan <DaNmarner@…>

Attachment: cn_localflavor_r13230.diff added

slightly modified.

comment:7 Changed 13 years ago by Matt McClanahan

Severity: Normal
Type: New feature

comment:8 Changed 12 years ago by Julien Phalip

Patch needs improvement: set

Great work, thank you. Before we check this in, could you rewrite the tests using unittest?

Changed 12 years ago by Daniel Duan

Attachment: cn_localflavor_1.3.diff added

Tests rewritten with unittest

comment:9 Changed 12 years ago by Daniel Duan

Patch needs improvement: unset

The tests have been rewritten (with unittest) and run.

Changed 12 years ago by Łukasz Rekucki

Attachment: cn_localflavor_r15942.diff added

Last patch with cosmetic changes.

comment:10 Changed 12 years ago by Łukasz Rekucki

Triage Stage: AcceptedReady for checkin

Your last patch deletes ".../apps/test/static/test/backup~" (I presume it got there by accident), so I fixed that and some trailing whitespace.

comment:11 Changed 12 years ago by Daniel Duan

Thanks lrekucki, it must be my script for auto-cleaning ~ and pyc files. cn_localflavor_r15942.diff is the patch to apply.

comment:12 Changed 12 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

In [16070]:

Fixed #12379 -- Added Chinese (cn) localflavor package. Thanks, Xia Kai, Daniel Duan, DaNmarner and Łukasz Rekucki.

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