Django

Code

Ticket #3897 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Add German localflavor

Reported by: Jannis Leidel <jl@websushi.org> Assigned to: adrian
Milestone: Component: Contrib apps
Version: SVN Keywords: localflavor, l10n, de
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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

Tests included.

Attachments

de-localflavor.diff (4.6 kB) - added by Jannis Leidel <jl@websushi.org> on 04/02/07 06:47:51.
initial de localflavor
de-localflavor2.diff (4.7 kB) - added by Jannis Leidel <jl@websushi.org> on 04/03/07 03:30:31.
Marked state names for translation

Change History

04/02/07 06:47:51 changed by Jannis Leidel <jl@websushi.org>

  • attachment de-localflavor.diff added.

initial de localflavor

04/02/07 07:42:43 changed by Simon G. <dev@simon.net.nz>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

04/02/07 07:42:52 changed by Simon G. <dev@simon.net.nz>

  • summary changed from [patch] Add German localflavor to Add German localflavor.

04/02/07 23:16:47 changed by mtredinnick

  • 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?

04/03/07 03:28:33 changed by Jannis Leidel <jl@websushi.org>

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.

04/03/07 03:30:31 changed by Jannis Leidel <jl@websushi.org>

  • attachment de-localflavor2.diff added.

Marked state names for translation

04/03/07 03:34:32 changed by mtredinnick

  • stage changed from Accepted to Ready for checkin.

Thanks, Jannis.

04/03/07 08:16:06 changed 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.

04/04/07 01:43:29 changed by mtredinnick

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

04/04/07 01:45:29 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #3897 (Add German localflavor)




Change Properties
Action