Added comment karma and locale formatting to header #395

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants
Contributor

Deimos commented Mar 28, 2012

No description provided.

@kemitche kemitche commented on the diff Mar 28, 2012

r2/r2/templates/redditheader.compact
@@ -86,7 +86,7 @@
%if c.user_is_loggedin:
<div class="menuitem">
${plain_link(c.user.name, "/user/%s/" % c.user.name, _sr_path=False)}
- &nbsp;(<b>${c.user.safe_karma}</b>)
+ &nbsp;(<b>${locale.format("%d", c.user.safe_karma, True)}</b> / <b>${locale.format("%d", c.user.comment_karma, True)}</b>)
@kemitche

kemitche Mar 28, 2012

Contributor

"locale" doesn't seem to be imported (and I don't believe would work the way you expect; since it's interpreter-wide, locale-settings won't pick up the user's settings)

I like the idea of comment karma in the header, I don't get why it is not there to begin with.

Owner

spladug commented Nov 20, 2012

Not sure if you're still interested in this pull request, but locale is not the module you want to use here as @kemitche pointed out. Specifically, locale is interpreter-wide and therefore not the actual locale the user's expecting. You'd want to use babel for this, or potentially the format_number util in template_helpers (which uses babel itself).

💅

Deimos closed this Mar 19, 2013

@powerlanguage powerlanguage pushed a commit to powerlanguage/reddit that referenced this pull request Oct 14, 2013

@shlurbee shlurbee Merge pull request #395 from shlurbee/long_subreddit_names
Validate subreddit name when submitting a link
567948a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment