#18932: Buildin template tags seem to break i18n
-------------------------------------+-------------------------------------
Reporter: houmie | Owner: nobody
Type: New feature | Status: new
Component: | Version:
Internationalization | Resolution:
Severity: Normal | Triage Stage:
Keywords: i18n | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by houmie):
Sorry for late reply. Don't worry I don't think you are slow, more likely
I am not explaining well enough. :)
For your convenience I have attached a screenshot of my demo to discuss it
here. [[Image(http://i.imgur.com/l3aAl.png)]]
In the example if I use `item.conversation_datetime` I would get the
British dateformat coming from my overriden `formats.py`: `30 August 2012,
21:33`
However the moment I extract only the date and time with |date & |time
accordingly I would loose the localization. As you can see from the
screenshot the date has the American date format.
Now that we agree upon the problem, lets investigate your suggested
solutions:
1) and 2) are hardcoded and won't be good in my case as I need the user
to be able to change the language at any time.
3) You want the format depending on the language; use a predefined
format (|date:"DATE_FORMAT")
Yes, this is the solution. I didn't know this is possible. This way you
extract the "DATE_FORMAT" from `formats.py` same for time:
`|time:"TIME_FORMAT".` This was exactly what I was looking for. I am so
sorry I couldn't see this bit in the documentation.
Your help was highly appreciated to solve this issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/18932#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.