Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-02-23 07:25:33

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

How to: using the locale in RC3 to output localised date

I’d been wondering how to use the new “locale” in outputting the date with German weekdays and month names. After a bit of fiddling here’s what I found:

<txp:posted locale="de" format="%A, %d. %B %Y" />

This will display: Mittwoch, 23. Februar 2005

And here’s a list of all parameters available for the strftime function.

I haven’t figured out yet what to do with the “locale” and “language” entries in the admin section. Localisation of the date works even if I rename my German language file let alone that it doesn’t contain the weekdays or month names.

For “language” I found I can change it but with no effect.

Anyway, perhaps the date localisation will come in handy for others as well.

Offline

#2 2005-02-23 08:30:54

davidm
Member
From: Paris, France
Registered: 2004-04-27
Posts: 719

Re: How to: using the locale in RC3 to output localised date

Thanks very much for the input I have been waiting for this !

Another new feature of RC3 :-)
It will take some time covering all the changes this time !


.: Retired :.

Offline

#3 2005-02-24 03:17:21

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: How to: using the locale in RC3 to output localised date

> I haven’t figured out yet what to do with the “locale” and “language” entries in the admin section. Localisation of the date works even if I rename my German language file let alone that it doesn’t contain the weekdays or month names.

The Locale setting currently controls date strings, and nothing else. Language is for the Textpattern language files. They probably should be combined into a single setting, but, y’know, only so many hours in a day.


Alex

Offline

Board footer

Powered by FluxBB