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>
|
<TMPL_IF content>
|
||||||
<content:encoded><TMPL_VAR content ESCAPE="HTML"></content:encoded>
|
<content:encoded><TMPL_VAR content ESCAPE="HTML"></content:encoded>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
<dc:date><TMPL_VAR date_iso></dc:date>
|
<dc:date><TMPL_VAR date_822></dc:date>
|
||||||
<TMPL_IF creator>
|
<TMPL_IF creator>
|
||||||
<dc:creator><TMPL_VAR creator></dc:creator>
|
<dc:creator><TMPL_VAR creator></dc:creator>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
<TMPL_VAR content ESCAPE="HTML"></description>
|
<TMPL_VAR content ESCAPE="HTML"></description>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
<pubDate><TMPL_VAR date_iso></pubDate>
|
<pubDate><TMPL_VAR date_822></pubDate>
|
||||||
<TMPL_IF creator>
|
<TMPL_IF creator>
|
||||||
<dc:creator><TMPL_VAR creator></dc:creator>
|
<dc:creator><TMPL_VAR creator></dc:creator>
|
||||||
</TMPL_IF>
|
</TMPL_IF>
|
||||||
|
|
|
@ -12,6 +12,7 @@ __authors__ = [ "Scott James Remnant <scott@netsplit.com>",
|
||||||
"Jeff Waugh <jdub@perkypants.org>" ]
|
"Jeff Waugh <jdub@perkypants.org>" ]
|
||||||
__license__ = "Python"
|
__license__ = "Python"
|
||||||
|
|
||||||
|
import locale
|
||||||
|
|
||||||
# Modules available without separate import
|
# Modules available without separate import
|
||||||
import cache
|
import cache
|
||||||
|
@ -87,6 +88,15 @@ class stripHtml(sgmllib.SGMLParser):
|
||||||
def template_info(item, date_format):
|
def template_info(item, date_format):
|
||||||
"""Produce a dictionary of template information."""
|
"""Produce a dictionary of template information."""
|
||||||
info = {}
|
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():
|
for key in item.keys():
|
||||||
if item.key_type(key) == item.DATE:
|
if item.key_type(key) == item.DATE:
|
||||||
date = item.get_as_date(key)
|
date = item.get_as_date(key)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user