Opened 15 years ago

Closed 14 years ago

Last modified 12 years ago

#9289 closed (fixed)

Swedish (se) localflavor

Reported by: Andreas Pelme Owned by:
Component: contrib.localflavor Version: dev
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: no UI/UX: no

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 Andreas Pelme 15 years ago.
Swedish localflavor patch against current trunk
django_localflavor_se_r2.diff (23.2 KB ) - added by Andreas Pelme 15 years ago.
Updated patch
django_localflavor_se_r3.diff (23.5 KB ) - added by Andreas Pelme 15 years ago.
Updated patch which works when the checksum digit is 0, tests updated.
django_localflavor_se_r4.diff (23.1 KB ) - added by Andreas Pelme 15 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 Ludvig Ericson 15 years ago.
Some typo changes, and made using svn diff instead.
django_localflavor_se_r6.diff (23.1 KB ) - added by Ludvig Ericson 15 years ago.
Marked strings for translation, because some languages have non-roman alphabets.

Download all attachments as: .zip

Change History (25)

by Andreas Pelme, 15 years ago

Attachment: django_localflavor_se.diff added

Swedish localflavor patch against current trunk

comment:1 by Andreas Pelme, 15 years ago

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

  • SEPostalCodeNumberField - Form field for Swedish postal codes

comment:2 by Ludvig Ericson, 15 years ago

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

comment:3 by Ludvig Ericson, 15 years ago

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.

in reply to:  3 comment:4 by Andreas Pelme, 15 years ago

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 by Andreas Pelme, 15 years ago

comment:6 by Malcolm Tredinnick, 15 years ago

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 by Andreas Pelme, 15 years ago

Patch needs improvement: unset
Status: newassigned
Triage Stage: UnreviewedAccepted

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).

by Andreas Pelme, 15 years ago

Updated patch

by Andreas Pelme, 15 years ago

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

comment:8 by anonymous, 15 years ago

Cc: hwaara@… added

by Andreas Pelme, 15 years ago

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

by Ludvig Ericson, 15 years ago

Some typo changes, and made using svn diff instead.

comment:9 by Ludvig Ericson, 15 years ago

Owner: changed from Andreas Pelme to Malcolm Tredinnick
Status: assignednew

Oh and assign these things to Malcolm.

comment:10 by Malcolm Tredinnick, 15 years ago

Owner: Malcolm Tredinnick removed

There's no reason to assign this to me.

comment:11 by Ludvig Ericson, 15 years ago

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

by Ludvig Ericson, 15 years ago

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

comment:12 by anonymous, 15 years ago

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

comment:13 by Andreas Pelme, 15 years ago

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 by anonymous, 15 years ago

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

comment:15 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:16 by Andreas Pelme, 15 years ago

milestone: 1.1

comment:17 by Alex Gaynor, 15 years ago

milestone: 1.11.2

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

comment:18 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

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

comment:19 by Jacob, 12 years ago

milestone: 1.2

Milestone 1.2 deleted

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