#1 Proposed localization of squishdot

closed-wont-fix
nobody
None
5
2001-03-20
2001-03-13
Anonymous
No

Squishdot date formats don't behave according to the
current locale.
Further, the squishdot .py file has English as the
language for
body_len in a way that it can't be changed. Here's a
proposed diff against 0.7.3 to make squishdot use
locale-specific time strings and to move
the bytes string from Squishdot.py to the demo site.

** Squishdot.py.0.7.3-orig Tue Mar 13 11:24:37 2001
--- Squishdot.py.localized Tue Mar 13 11:23:40
2001
***************
*** 1269,1275 ****
return tagRegex.sub("",s)

# protected by 'View' permission
! def date_posted(self,fmstr='%A %B %d, @%I:%M%p'):
# """ date when article was posted """
ltime = localtime(self.created)
return strftime(fmstr,ltime)
--- 1269,1275 ----
return tagRegex.sub("",s)

# protected by 'View' permission
! def date_posted(self,fmstr='%c'):
# """ date when article was posted """
ltime = localtime(self.created)
return strftime(fmstr,ltime)
***************
*** 1285,1297 ****
tlen = tlen + len(line)

if divisor is None:
! if tlen == 0:
! return ''
! if tlen > 51200:
! tlen = tlen / 1024
! return str(tlen) + ' Kb'
! else:
! return str(tlen) + ' bytes'

if divisor < 1:
return tlen
--- 1285,1291 ----
tlen = tlen + len(line)

if divisor is None:
! return str(tlen)

if divisor < 1:
return tlen
***************
*** 1353,1366 ****
# protected by 'View' permission
def date_created(self):
# """ date article was created """
! t=localtime(self.created)
! return '%d/%d/%d' % (t[1],t[2],t[0])

# protected by 'View' permission
def time_created(self):
# """ time article was created """
! t=localtime(self.created)
! return '%02d:%02d' % (t[3],t[4])
# protected by 'View' permission
def attachment(self):
--- 1347,1358 ----
# protected by 'View' permission
def date_created(self):
# """ date article was created """
! return strftime("%x",
localtime(self.created))

# protected by 'View' permission
def time_created(self):
# """ time article was created """
! return strftime("%X",
localtime(self.created))

# protected by 'View' permission
def attachment(self):
diff -cr orig/Squishdot_index_html.dtml
./Squishdot_index_html.dtml
*** orig/Squishdot_index_html.dtml Tue Jan 2
13:42:16 2001
--- ./Squishdot_index_html.dtml Tue Mar 13 11:17:40
2001
***************
*** 54,62 ****
<FONT size=2><B>from the
<dtml-var dept> dept.</B></FONT><BR>
<dtml-var showSummary><BR>
<A href="<dtml-var URL1
><dtml-var thread_path>/<dtml-var
id>/index_html"><B>Read More...</B></A><BR>
! <dtml-if "reply_cnt > 1"><B>
(<dtml-var reply_cnt> comments<dtml-if body_len>,
<dtml-var body_len> in body</dtml-if>)</B>
! <dtml-elif reply_cnt>
<B>(<dtml-var reply_cnt> comment<dtml-if body_len>,
<dtml-var body_len> in body</dtml-if>)</B>
! <dtml-else> <dtml-if
body_len><B>( <dtml-var body_len> in
body)</B></dtml-if>
</dtml-if><P></dtml-in
item_list><dtml-else><TABLE width="99%" cellpadding=0
cellspacing=0 border=0>
<TR><!-- colored header with
title -->
<TD valign=top
bgcolor="<dtml-var color3>"><dtml-if round_edge><IMG
src="Images/roundedge_img"
--- 54,62 ----
<FONT size=2><B>from the
<dtml-var dept> dept.</B></FONT><BR>
<dtml-var showSummary><BR>
<A href="<dtml-var URL1
><dtml-var thread_path>/<dtml-var
id>/index_html"><B>Read More...</B></A><BR>
! <dtml-if "reply_cnt > 1"><B>
(<dtml-var reply_cnt> comments<dtml-if body_len>,
<dtml-var body_len> bytes in body</dtml-if>)</B>
! <dtml-elif reply_cnt>
<B>(<dtml-var reply_cnt> comment<dtml-if body_len>,
<dtml-var body_len> bytes in body</dtml-if>)</B>
! <dtml-else> <dtml-if
body_len><B>( <dtml-var body_len> bytes in
body)</B></dtml-if>
</dtml-if><P></dtml-in
item_list><dtml-else><TABLE width="99%" cellpadding=0
cellspacing=0 border=0>
<TR><!-- colored header with
title -->
<TD valign=top
bgcolor="<dtml-var color3>"><dtml-if round_edge><IMG
src="Images/roundedge_img"

Discussion

  • Chris Withers
    Chris Withers
    2001-03-20

    • labels: 103644 -->
    • status: open --> open-wont-fix
     
  • Chris Withers
    Chris Withers
    2001-03-20

    Logged In: YES
    user_id=24723

    I'm sorry but I don't really see how these help, and I don't have time to investigate further. By all means
    post this as a how-to on Squishdot.org, but it's not going to end up in the Squishdot distribution for the
    time being.

    Sorry I couldn't be more help,

    Chris

     
  • Chris Withers
    Chris Withers
    2001-03-20

    • status: open-wont-fix --> closed-wont-fix