Added locale.setlocale and related changes
locale is set from the default LANG env variable
This commit is contained in:
parent
869a7e0866
commit
8aa18bf4cb
|
@ -27,7 +27,7 @@
|
|||
<TMPL_IF content>
|
||||
<content:encoded><TMPL_VAR content ESCAPE="HTML"></content:encoded>
|
||||
</TMPL_IF>
|
||||
<dc:date><TMPL_VAR date_iso></dc:date>
|
||||
<dc:date><TMPL_VAR date_822></dc:date>
|
||||
<TMPL_IF creator>
|
||||
<dc:creator><TMPL_VAR creator></dc:creator>
|
||||
</TMPL_IF>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</TMPL_IF>
|
||||
<TMPL_VAR content ESCAPE="HTML"></description>
|
||||
</TMPL_IF>
|
||||
<pubDate><TMPL_VAR date_iso></pubDate>
|
||||
<pubDate><TMPL_VAR date_822></pubDate>
|
||||
<TMPL_IF creator>
|
||||
<dc:creator><TMPL_VAR creator></dc:creator>
|
||||
</TMPL_IF>
|
||||
|
|
|
@ -12,6 +12,7 @@ __authors__ = [ "Scott James Remnant <scott@netsplit.com>",
|
|||
"Jeff Waugh <jdub@perkypants.org>" ]
|
||||
__license__ = "Python"
|
||||
|
||||
import locale
|
||||
|
||||
# Modules available without separate import
|
||||
import cache
|
||||
|
@ -87,6 +88,15 @@ class stripHtml(sgmllib.SGMLParser):
|
|||
def template_info(item, date_format):
|
||||
"""Produce a dictionary of template information."""
|
||||
info = {}
|
||||
|
||||
#set the locale so that the dates at the feeds will be in english
|
||||
lc=locale.getlocale()
|
||||
if lc[0].find("tr") != -1:
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
except:
|
||||
pass
|
||||
|
||||
for key in item.keys():
|
||||
if item.key_type(key) == item.DATE:
|
||||
date = item.get_as_date(key)
|
||||
|
|
Loading…
Reference in New Issue
Block a user