> On 16 Jan 2015, at 20:53, Duncan P <[email protected]> wrote:
> 
> On 16 January 2015 at 19:28, Jannis Leidel <[email protected]> wrote:
>> Sounds like you haven't enabled translations, try setting USE_I18N to True 
>> and see if that helps.
> 
> I don't think this is a translation thing, is it? I think this is a
> suggested change to
> 
> https://github.com/django/django/blob/master/django/conf/locale/de/formats.py

Hm, but the German time format (TIME_FORMAT) correctly use "H:i" which stands 
for "Hour, 24-hour format" and "Minutes", see 
https://github.com/django/django/blob/stable/1.6.x/django/conf/locale/de/formats.py#L9

Theo I'm not sure why you use "DATETIME_FORMAT", the date should have rendered 
as "j. F Y H:i", in other words as "16. Januar 2015 22:47:12", given his code 
snippet, see 
https://github.com/django/django/blob/stable/1.6.x/django/conf/locale/de/formats.py#L10

I was mentioning the USE_I18N setting because when the dates are formatted 
using the localization formats it'll still use the translation engine to get 
the correctly translated terms, e.g. "F" will be translated into the month name 
(https://github.com/django/django/blob/fb614ff4a712cf7d221ed9ddeb7e4164e882ba81/django/utils/dateformat.py#L164-L166)
 which behind the scenes uses a translated list of months 
(https://github.com/django/django/blob/fb614ff4a712cf7d221ed9ddeb7e4164e882ba81/django/utils/dates.py#L17-L21).

So if you try to look at the "10:47 nachm" in terms of a date formatting 
pattern it would just be "P" 
(https://github.com/django/django/blob/fb614ff4a712cf7d221ed9ddeb7e4164e882ba81/django/utils/dateformat.py#L95-L106)
 or "g:i a" - the 12-hour hours and minutes, plus "a.m". or "p.m".

Looking further at the formats that use "P" for the "TIME_FORMAT" format I find 
the main language en: 
https://github.com/django/django/blob/fb614ff4a712cf7d221ed9ddeb7e4164e882ba81/django/conf/locale/en/formats.py#L9
 and the default format in case USE_L10N is disabled: 
https://github.com/django/django/blob/fb614ff4a712cf7d221ed9ddeb7e4164e882ba81/django/conf/global_settings.py#L329-L331

So in other words we have a situation in which the English localization format 
is used but translated to German.

Theo, that makes me wonder if you actually have USE_L10N enabled?

Apologies for the long mail, just trying to wrap my head around :)

Jannis

-- 
You received this message because you are subscribed to the Google Groups 
"Django internationalization and localization" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-i18n.
For more options, visit https://groups.google.com/d/optout.

Reply via email to