Re: Patch to add support for locales (for localized dates)

will guaraldi <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
I applied this to the codebase.  Sorry it took so long, but this month has 
been flying by.

Thank you very much for the work--it fixes issues that have needed fixing 
for a while.

/will


On Sun, 3 Sep 2006, Martn van de Streek wrote:

> Hello,
>
> I've made a patch that adds locale support to PyBlosxom 1.3.2. It's
> backwards compatible if you don't have a py['locale'] key in your
> config.py, but if you have it, pyblosxom will switch to the specified
> locale before doing anything else.
>
> If setting the locale fails, it will fail silently. This should probably
> be logged somewhere, to reduce "I set the locale in the config and it
> doesn't work!"-requests.
>
> If a locale is set, it's temporarily disabled for 'special' things, like
> generating RFC-compliant date fields (which should be in English ('C') ).
>
> Setting the locale affects the following things (as far as I can tell,
> I'm not too familiar with PyBlosxom guts yet ;))
>
> * /year/month/day URL's will change: the abbreviated month name should
>   be a localised one, and 'default' ones won't work anymore.
>
> * All date/time template variables (except the 'standards': w3cdate and
>   rfc822date) will change to localised versions, if applicable.
>
> * Plugins that do things with 'standards-defined' dates might need a
>   bit of additional code to switch to the 'C' locale when necessary.
>
> I'm currently updating the pycalendar plugin to automatically select the
> start of the week and month/day names based on locale settings. Because
> it uses strftime, the links to /yyyy/mmm/dd paths are already OK.
>
> Martijn
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.