[dw-free] "entries" does not always show plural correctly on homepage
[commit: http://hg.dwscoalition.org/dw-free/rev/adfcf7b3198e]
http://bugs.dwscoalition.org/show_bug.cgi?id=1498
Display number with comma, but evaluate number without comma to determine
plural.
Patch by
afuna.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1498
Display number with comma, but evaluate number without comma to determine
plural.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/en.dat
- cgi-bin/DW/Widget/AccountStatistics.pm
-------------------------------------------------------------------------------- diff -r 7ef441366f54 -r adfcf7b3198e bin/upgrading/en.dat --- a/bin/upgrading/en.dat Tue Jul 28 19:22:03 2009 -0500 +++ b/bin/upgrading/en.dat Tue Jul 28 19:31:21 2009 -0500 @@ -3867,17 +3867,17 @@ web.postto.label=Post to: widget.accountstatistics.expires_on=[[type]], expiring [[date]] -widget.accountstatistics.comments=[[num_received]] [[?num_received|comment|comments]] received; [[num_posted]] [[?num_received|comment|comments]] posted - -widget.accountstatistics.entries=[[num]] [[?num|entry|entries]] +widget.accountstatistics.comments2=[[num_received_comma]] [[?num_received_raw|comment|comments]] received; [[num_posted_comma]] [[?num_posted_raw|comment|comments]] posted + +widget.accountstatistics.entries2=[[num_comma]] [[?num_raw|entry|entries]] widget.accountstatistics.last_updated=Last updated [[date]] widget.accountstatistics.member_since=Member since [[date]] -widget.accountstatistics.memories=[[num]] <a [[aopts]]>Memories</a> - -widget.accountstatistics.tags=[[num]] <a [[aopts]]>Tags</a> +widget.accountstatistics.memories2=[[num_comma]] <a [[aopts]]>[[?num_raw|Memory|Memories]]</a> + +widget.accountstatistics.tags2=[[num_comma]] <a [[aopts]]>[[?num_raw|Tag|Tags]]</a> widget.accountstatistics.title=Account Stats diff -r 7ef441366f54 -r adfcf7b3198e cgi-bin/DW/Widget/AccountStatistics.pm --- a/cgi-bin/DW/Widget/AccountStatistics.pm Tue Jul 28 19:22:03 2009 -0500 +++ b/cgi-bin/DW/Widget/AccountStatistics.pm Tue Jul 28 19:31:21 2009 -0500 @@ -42,11 +42,16 @@ sub render_body { my $ret = "<h2>" . $class->ml( 'widget.accountstatistics.title' ) . "</h2>"; $ret .= "<ul>"; $ret .= "<li>" . $class->ml( 'widget.accountstatistics.member_since', { date => LJ::mysql_time( $remote->timecreate ) } ) . "</li>"; - $ret .= "<li>" . $class->ml( 'widget.accountstatistics.entries', { num => LJ::commafy( $remote->number_of_posts ) } ) . "</li>"; + $ret .= "<li>" . $class->ml( 'widget.accountstatistics.entries2', { num_raw => $remote->number_of_posts, num_comma => LJ::commafy( $remote->number_of_posts ) } ) . "</li>"; $ret .= "<li>" . $class->ml( 'widget.accountstatistics.last_updated', { date => LJ::mysql_time( $remote->timeupdate ) } ) . "</li>"; - $ret .= "<li>" . $class->ml( 'widget.accountstatistics.comments', { num_received => LJ::commafy( $remote->num_comments_received ), num_posted => LJ::commafy( $remote->num_comments_posted ) } ) . "</li>"; - $ret .= "<li>" . $class->ml( 'widget.accountstatistics.memories', { num => LJ::commafy( $memories_count ), aopts => "href='$LJ::SITEROOT/tools/memories.bml?user=" . $remote->user . "'", } ); - $ret .= ", " . $class->ml( 'widget.accountstatistics.tags', { num => $tags_count, aopts => 'href="' . $remote->journal_base . '/tag/"' } ) . "</li>"; + $ret .= "<li>" . $class->ml( 'widget.accountstatistics.comments2', { + num_received_raw => $remote->num_comments_received, + num_received_comma => LJ::commafy( $remote->num_comments_received ), + num_posted_raw => $remote->num_comments_posted, + num_posted_comma => LJ::commafy( $remote->num_comments_posted ) + } ) . "</li>"; + $ret .= "<li>" . $class->ml( 'widget.accountstatistics.memories2', { num_raw => $memories_count, num_comma => LJ::commafy( $memories_count ), aopts => "href='$LJ::SITEROOT/tools/memories.bml?user=" . $remote->user . "'", } ); + $ret .= ", " . $class->ml( 'widget.accountstatistics.tags2', { num_raw => $tags_count, num_comma => LJ::commafy( $tags_count ), aopts => 'href="' . $remote->journal_base . '/tag/"' } ) . "</li>"; $ret .= "<li>" . $accttype_string . "</li>"; $ret .= "</ul>"; --------------------------------------------------------------------------------