Code

Opened 6 years ago

Closed 4 years ago

Last modified 3 years ago

#9289 closed (fixed)

Swedish (se) localflavor

Reported by: peritus Owned by:
Component: contrib.localflavor Version: master
Severity: Keywords: localflavor,sv,se
Cc: hwaara@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The attached patch contains:

  • SECountySelect - Select widget for Swedish counties (län)
  • SEMunicipalitySelect - Select widget for Swedish municipalities (kommun)
  • SEOrganisationNumber - Form field for Swedish Organisation numbers (organisationsnummer)
  • SEPersonalIdentityNumber - Form field for Swedish Identity numbers (personnummer)

Documentation, Swedish translations, and tests that covers all widgets fields are included!

Attachments (6)

django_localflavor_se.diff (51.4 KB) - added by peritus 6 years ago.
Swedish localflavor patch against current trunk
django_localflavor_se_r2.diff (23.2 KB) - added by peritus 6 years ago.
Updated patch
django_localflavor_se_r3.diff (23.5 KB) - added by peritus 6 years ago.
Updated patch which works when the checksum digit is 0, tests updated.
django_localflavor_se_r4.diff (23.1 KB) - added by peritus 6 years ago.
Updated patch according to the discussion on django-se. The counties are not appended by "County", and not marked for translation.
django_localflavor_se_r5.diff (23.0 KB) - added by toxik 6 years ago.
Some typo changes, and made using svn diff instead.
django_localflavor_se_r6.diff (23.1 KB) - added by toxik 6 years ago.
Marked strings for translation, because some languages have non-roman alphabets.

Download all attachments as: .zip

Change History (25)

Changed 6 years ago by peritus

Swedish localflavor patch against current trunk

comment:1 Changed 6 years ago by peritus

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I forgot to mention in the description above, the patch also contains:

  • SEPostalCodeNumberField - Form field for Swedish postal codes

comment:2 Changed 6 years ago by toxik

I somehow feel that you aren't entitled to patching my /dev/null. :-)

comment:3 follow-up: Changed 6 years ago by toxik

  • Patch needs improvement set

When making a patch for Django, do it like this: (Assuming your Django is in ~/django-trunk)

# Make some edits.
cd django-trunk
vim ...
# Then make patch:
svn diff >~/django-foo.diff

and upload that .diff. This makes it easier for the committers.

comment:4 in reply to: ↑ 3 Changed 6 years ago by peritus

  • Patch needs improvement unset

Replying to toxik:

When making a patch for Django, do it like this: ... and upload that .diff. This makes it easier for the committers.

The trac patch-viewer has problems showing patches from "git diff", which is an acceptable format for patches according to
http://docs.djangoproject.com/en/dev/internals/contributing/#patch-style

Download the patch and view it with your favourite text editor and you will see the correct file names.

comment:5 Changed 6 years ago by peritus

comment:6 Changed 6 years ago by mtredinnick

  • Patch needs improvement set

I think putting in all the municipalities is going a bit too far here. We aren't intending to be an encyclopedic reference. What happens when somebody wants to include every town in the US? Where do we draw the line? I think some of these things -- municipalities (when there are 290 of them), towns, postcodes, etc -- probably just have to be some kind of optional third-party package. Otherwise Django is going to be a huge download.

Also, please remove the translation update. That isn't part of the localflavor and can be done in the normal course of doing a translation update.

comment:7 Changed 6 years ago by peritus

  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

Updated patch which...

  • Validates personal identity numbers according to the discussion on the Swedish mailing list
  • The cleaned value returns the full year and no sign
  • Tests and documentation are updated accordingly
  • Adds some more validation checking for SEOrganisationNumberField.
  • SEMunicipalitySelect removed
  • All translation changes removed

I haven't got any feedback on
http://groups.google.com/group/django-developers/browse_thread/thread/ad5a7866ed5f471b
so I have not done any work on a model field/extra methods for converting between long and short formats and datetime.date objects (which should be trivial once it's decided).

Changed 6 years ago by peritus

Updated patch

Changed 6 years ago by peritus

Updated patch which works when the checksum digit is 0, tests updated.

comment:8 Changed 6 years ago by anonymous

  • Cc hwaara@… added

Changed 6 years ago by peritus

Updated patch according to the discussion on django-se. The counties are not appended by "County", and not marked for translation.

Changed 6 years ago by toxik

Some typo changes, and made using svn diff instead.

comment:9 Changed 6 years ago by toxik

  • Owner changed from peritus to mtredinnick
  • Status changed from assigned to new

Oh and assign these things to Malcolm.

comment:10 Changed 6 years ago by mtredinnick

  • Owner mtredinnick deleted

There's no reason to assign this to me.

comment:11 Changed 6 years ago by toxik

Oh, well then. I stand corrected. I also couldn't delete owner like that.

Changed 6 years ago by toxik

Marked strings for translation, because some languages have non-roman alphabets.

comment:12 Changed 5 years ago by anonymous

What's the next step here, is the patch updated according to the discussions in the newsgroup? Is it ready for review?

comment:13 Changed 5 years ago by peritus

Yes, it is updated according to the discussions. I would say it is ready for review. I use the code myself in a couple of projects and have no issues with it.

comment:14 Changed 5 years ago by anonymous

Can we get this into 1.1 pretty please? The patch looks done...

comment:15 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:16 Changed 5 years ago by peritus

  • milestone set to 1.1

comment:17 Changed 5 years ago by Alex

  • milestone changed from 1.1 to 1.2

We're now past feature freeze, this will have to wait until 1.2 :(

comment:18 Changed 4 years ago by jezdez

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

(In [11969]) Fixed #9289 - Added Swedish localflavor. Thanks to Andreas Pelme, Ludvig Ericson and Filip Noetzel for working on a patch.

comment:19 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.