Code

Opened 7 years ago

Closed 7 years ago

#3897 closed (fixed)

Add German localflavor

Reported by: Jannis Leidel <jl@…> Owned by: adrian
Component: Contrib apps Version: master
Severity: Keywords: localflavor, l10n, de
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Patch to add a module to django.contrib.localflavor for Germany: DEZipCodeField and DEStateSelect.

Tests included.

Attachments (2)

de-localflavor.diff (4.6 KB) - added by Jannis Leidel <jl@…> 7 years ago.
initial de localflavor
de-localflavor2.diff (4.7 KB) - added by Jannis Leidel <jl@…> 7 years ago.
Marked state names for translation

Download all attachments as: .zip

Change History (10)

Changed 7 years ago by Jannis Leidel <jl@…>

initial de localflavor

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by Simon G. <dev@…>

  • Summary changed from [patch] Add German localflavor to Add German localflavor

comment:3 Changed 7 years ago by mtredinnick

  • Triage Stage changed from Ready for checkin to Accepted

Here's an interesting problem: the German states all have reasonably well-established English names that differ from their German versions (e.g. Bayern -> Bavaria, Sachsen -> Saxony). Django, like many other programs, uses (North American) English as the default language for internal strings. So, my feeling is that we should probably be using the English names in this list and mark them as translatable.

Note that this problem does not exist for the Finnish and Norwegian localflavors, as far as I can tell, because everybody -- native and foreign -- uses the local spellings.

The main argument in favour of this is consistency and international "friendliness" (outside of Germany, the English names are more commonly used). The argument against this change is that the German versions are in some way the "real names". However, given that we label the locale as German (and not Deutsch) in other places, the against argument seems less significant.

Am I overlooking a technical (or even non-technical) reason for the state names not to be in English?

comment:4 Changed 7 years ago by Jannis Leidel <jl@…>

Ok, good point - nevertheless it would be nice to see the translated names if i18n is enabled.

Adding the states to django.conf.locale.de would do this trick though.

Changed 7 years ago by Jannis Leidel <jl@…>

Marked state names for translation

comment:5 Changed 7 years ago by mtredinnick

  • Triage Stage changed from Accepted to Ready for checkin

Thanks, Jannis.

comment:6 Changed 7 years ago by mtredinnick

This patch isn't quite perfect -- the tests didn't patch properly. When I fixed that, they failed. When I fixed that, it tripped over a bug I seem to have introduced in [4904]. I'm slowly fixing everything and nailing the bugs (particularly since the last one is my fault), but I'm too tired to finish it tonight. Will pick this up again in the morning.

comment:7 Changed 7 years ago by mtredinnick

(In [4919]) Made django.utils.html.escape() work with unicode strings (and unicode-like
objects). Refs #3897.

comment:8 Changed 7 years ago by mtredinnick

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

(In [4920]) Fixed #3897 -- Added German localflavor. Thanks, Jannis Leidel.

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.