Opened 6 years ago

Closed 4 years ago

#12379 closed New feature (fixed)

Simplified Chinese(CN) localflavor package

Reported by: xiaket 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: UI/UX:

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 xiaket 6 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@…> 5 years ago.
slightly modified.
cn_localflavor_1.3.diff (19.8 KB) - added by DaNmarner 4 years ago.
Tests rewritten with unittest
cn_localflavor_r15942.diff (18.4 KB) - added by lrekucki 4 years ago.
Last patch with cosmetic changes.

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by xiaket

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

comment:1 Changed 6 years ago by jcd

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 6 years ago by jezdez

  • Triage Stage changed from Design decision needed to Accepted

comment:3 Changed 6 years ago by xxxss@…

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

comment:4 Changed 6 years ago by jezdez

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

comment:5 Changed 6 years ago by russellm

  • milestone 1.2 deleted
  • Version SVN deleted

comment:6 Changed 5 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 5 years ago by Daniel Duan <DaNmarner@…>

slightly modified.

comment:7 Changed 4 years ago by mattmcc

  • Severity set to Normal
  • Type set to New feature

comment:8 Changed 4 years ago by julien

  • Patch needs improvement set

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

Changed 4 years ago by DaNmarner

Tests rewritten with unittest

comment:9 Changed 4 years ago by DaNmarner

  • Patch needs improvement unset

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

Changed 4 years ago by lrekucki

Last patch with cosmetic changes.

comment:10 Changed 4 years ago by lrekucki

  • Triage Stage changed from Accepted to Ready 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 4 years ago by DaNmarner

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 4 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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