diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | django_authopenid/models.py | 4 | ||||
-rw-r--r-- | django_authopenid/util.py | 4 | ||||
-rw-r--r-- | forum/management/commands/once_award_badges.py | 62 | ||||
-rw-r--r-- | forum/user.py | 45 | ||||
-rw-r--r-- | forum/views.py | 92 | ||||
-rw-r--r-- | locale/zh_CN/LC_MESSAGES/django.mo | bin | 0 -> 6519 bytes | |||
-rw-r--r-- | locale/zh_CN/LC_MESSAGES/django.po | 430 | ||||
-rw-r--r-- | locale/zh_cn/LC_MESSAGES/django.mo | bin | 6605 -> 0 bytes | |||
-rw-r--r-- | locale/zh_cn/LC_MESSAGES/django.po | 416 | ||||
-rw-r--r-- | settings.py | 16 | ||||
-rw-r--r-- | templates/badges.html | 5 | ||||
-rw-r--r-- | urls.py | 1 |
13 files changed, 547 insertions, 529 deletions
@@ -1,2 +1,3 @@ settings_local.py *.pyc +*.swp diff --git a/django_authopenid/models.py b/django_authopenid/models.py index 9826c452..e6fb8111 100644 --- a/django_authopenid/models.py +++ b/django_authopenid/models.py @@ -3,7 +3,7 @@ from django.conf import settings from django.contrib.auth.models import User from django.db import models -import md5, random, sys, os, time +import hashlib, random, sys, os, time __all__ = ['Nonce', 'Association', 'UserAssociation', 'UserPasswordQueueManager', 'UserPasswordQueue'] @@ -47,7 +47,7 @@ class UserPasswordQueueManager(models.Manager): # The random module is seeded when this Apache child is created. # Use SECRET_KEY as added salt. while 1: - confirm_key = md5.new("%s%s%s%s" % ( + confirm_key = hashlib.md5("%s%s%s%s" % ( random.randint(0, sys.maxint - 1), os.getpid(), time.time(), settings.SECRET_KEY)).hexdigest() try: diff --git a/django_authopenid/util.py b/django_authopenid/util.py index 841a81c7..54c1246b 100644 --- a/django_authopenid/util.py +++ b/django_authopenid/util.py @@ -15,7 +15,7 @@ try: except: from yadis import xri -import time, base64, md5, operator +import time, base64, hashlib, operator import urllib from models import Association, Nonce @@ -128,7 +128,7 @@ class DjangoOpenIDStore(OpenIDStore): def getAuthKey(self): # Use first AUTH_KEY_LEN characters of md5 hash of SECRET_KEY - return md5.new(settings.SECRET_KEY).hexdigest()[:self.AUTH_KEY_LEN] + return hashlib.md5(settings.SECRET_KEY).hexdigest()[:self.AUTH_KEY_LEN] def isDumb(self): return False diff --git a/forum/management/commands/once_award_badges.py b/forum/management/commands/once_award_badges.py index c1a147d7..c26251d7 100644 --- a/forum/management/commands/once_award_badges.py +++ b/forum/management/commands/once_award_badges.py @@ -157,8 +157,8 @@ class Command(BaseCommand): """
activity_types = ','.join('%s' % item for item in BADGE_AWARD_TYPE_FIRST.keys())
# ORDER BY user_id, activity_type
- query = "SELECT id, user_id, activity_type, content_type_id, object_id\
- FROM activity WHERE is_auditted = 0 AND activity_type IN (%s) ORDER BY user_id, activity_type" % activity_types
+ query = "SELECT id, user_id, activity_type, content_type_id, object_id "+
+ "FROM activity WHERE is_auditted = 0 AND activity_type IN (%s) ORDER BY user_id, activity_type" % activity_types
cursor = connection.cursor()
try:
@@ -206,10 +206,10 @@ class Command(BaseCommand): (13, '学生', 3, '学生', '第一次提问并且有一次以上赞成票', 0, 0),
"""
- query = "SELECT act.user_id, q.vote_up_count, act.object_id FROM \
- activity act, question q WHERE act.activity_type = %s AND \
- act.object_id = q.id AND\
- act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ASK_QUESTION, 13)
+ query = "SELECT act.user_id, q.vote_up_count, act.object_id FROM "+
+ "activity act, question q WHERE act.activity_type = %s AND "+
+ "act.object_id = q.id AND "+
+ "act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ASK_QUESTION, 13)
cursor = connection.cursor()
try:
cursor.execute(query)
@@ -236,10 +236,10 @@ class Command(BaseCommand): (15, '教师', 3, '教师', '第一次回答问题并且得到一个以上赞成票', 0, 0),
"""
- query = "SELECT act.user_id, a.vote_up_count, act.object_id FROM \
- activity act, answer a WHERE act.activity_type = %s AND \
- act.object_id = a.id AND\
- act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 15)
+ query = "SELECT act.user_id, a.vote_up_count, act.object_id FROM "+
+ "activity act, answer a WHERE act.activity_type = %s AND "+
+ "act.object_id = a.id AND "+
+ "act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 15)
cursor = connection.cursor()
try:
cursor.execute(query)
@@ -264,11 +264,11 @@ class Command(BaseCommand): """
(32, '学问家', 2, '学问家', '第一次回答被投赞成票10次以上', 0, 0)
"""
- query = "SELECT act.user_id, act.object_id FROM \
- activity act, answer a WHERE act.object_id = a.id AND\
- act.activity_type = %s AND \
- a.vote_up_count >= 10 AND\
- act.user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 32)
+ query = "SELECT act.user_id, act.object_id FROM "+
+ "activity act, answer a WHERE act.object_id = a.id AND "+
+ "act.activity_type = %s AND "+
+ "a.vote_up_count >= 10 AND "+
+ "act.user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 32)
cursor = connection.cursor()
try:
cursor.execute(query)
@@ -292,11 +292,11 @@ class Command(BaseCommand): """
(26, '优秀市民', 2, '优秀市民', '投票300次以上', 0, 0)
"""
- query = "SELECT count(*) vote_count, user_id FROM activity WHERE \
- activity_type = %s OR \
- activity_type = %s AND \
- user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) \
- GROUP BY user_id HAVING vote_count >= 300" % (TYPE_ACTIVITY_VOTE_UP, TYPE_ACTIVITY_VOTE_DOWN, 26)
+ query = "SELECT count(*) vote_count, user_id FROM activity WHERE "+
+ "activity_type = %s OR "+
+ "activity_type = %s AND "+
+ "user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) "+
+ "GROUP BY user_id HAVING vote_count >= 300" % (TYPE_ACTIVITY_VOTE_UP, TYPE_ACTIVITY_VOTE_DOWN, 26)
self.__award_for_count_num(query, 26)
@@ -304,11 +304,11 @@ class Command(BaseCommand): """
(27, '编辑主任', 2, '编辑主任', '编辑了100个帖子', 0, 0)
"""
- query = "SELECT count(*) vote_count, user_id FROM activity WHERE \
- activity_type = %s OR \
- activity_type = %s AND \
- user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) \
- GROUP BY user_id HAVING vote_count >= 100" % (TYPE_ACTIVITY_UPDATE_QUESTION, TYPE_ACTIVITY_UPDATE_ANSWER, 27)
+ query = "SELECT count(*) vote_count, user_id FROM activity WHERE "+
+ "activity_type = %s OR "+
+ "activity_type = %s AND "+
+ "user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) "+
+ "GROUP BY user_id HAVING vote_count >= 100" % (TYPE_ACTIVITY_UPDATE_QUESTION, TYPE_ACTIVITY_UPDATE_ANSWER, 27)
self.__award_for_count_num(query, 27)
@@ -316,11 +316,11 @@ class Command(BaseCommand): """
(5, '评论家', 3, '评论家', '评论10次以上', 0, 0),
"""
- query = "SELECT count(*) vote_count, user_id FROM activity WHERE \
- activity_type = %s OR \
- activity_type = %s AND \
- user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) \
- GROUP BY user_id HAVING vote_count >= 10" % (TYPE_ACTIVITY_COMMENT_QUESTION, TYPE_ACTIVITY_COMMENT_ANSWER, 5)
+ query = "SELECT count(*) vote_count, user_id FROM activity WHERE "+
+ "activity_type = %s OR "+
+ "activity_type = %s AND "+
+ "user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) "+
+ "GROUP BY user_id HAVING vote_count >= 10" % (TYPE_ACTIVITY_COMMENT_QUESTION, TYPE_ACTIVITY_COMMENT_ANSWER, 5)
self.__award_for_count_num(query, 5)
def __award_for_count_num(self, query, badge):
@@ -347,4 +347,4 @@ def main(): pass
if __name__ == '__main__':
- main()
\ No newline at end of file + main()
diff --git a/forum/user.py b/forum/user.py index 7afe1c36..2461e073 100644 --- a/forum/user.py +++ b/forum/user.py @@ -1,4 +1,5 @@ # coding=utf-8
+from django.utils.translation import ugettext as _
class UserView:
def __init__(self, id, tab_title, tab_description, page_title, view_name, template_file, data_size=0):
self.id = id
@@ -13,62 +14,62 @@ class UserView: USER_TEMPLATE_VIEWS = (
UserView(
id = 'stats',
- tab_title = u'概览',
- tab_description = u'用户概览',
- page_title = u'概览-用户资料',
+ tab_title = _("Overview"),
+ tab_description = _('User overview'),
+ page_title = _('Overview - User Profile'),
view_name = 'user_stats',
template_file = 'user_stats.html'
),
UserView(
id = 'recent',
- tab_title = u'最近活动',
- tab_description = u'用户最近的活动状况',
- page_title = u'最近活动 - 用户资料',
+ tab_title = _('Recent'),
+ tab_description = _("Recent activities"),
+ page_title = _('Recent - User Profile'),
view_name = 'user_recent',
template_file = 'user_recent.html',
data_size = 50
),
UserView(
id = 'responses',
- tab_title = u'回应',
- tab_description = u'其他用户的回复和评论',
- page_title = u'回应 - 用户资料',
+ tab_title = _("Response"),
+ tab_description = _("Responses from others"),
+ page_title = _("Response - User Profile"),
view_name = 'user_responses',
template_file = 'user_responses.html',
data_size = 50
),
UserView(
id = 'reputation',
- tab_title = u'积分',
- tab_description = u'用户社区积分',
- page_title = u'积分 - 用户资料',
+ tab_title = _("Reputation"),
+ tab_description = _("Community reputation"),
+ page_title = _("Reputation - User Profile"),
view_name = 'user_reputation',
template_file = 'user_reputation.html'
),
UserView(
id = 'favorites',
- tab_title = u'收藏',
- tab_description = u'用户收藏的问题',
- page_title = u'收藏 - 用户资料',
+ tab_title = _("Favorites"),
+ tab_description = _("User's favorite questions"),
+ page_title = _("Favorites - User Profile"),
view_name = 'user_favorites',
template_file = 'user_favorites.html',
data_size = 50
),
UserView(
id = 'votes',
- tab_title = u'投票',
- tab_description = u'用户所有投票',
- page_title = u'投票 - 用户资料',
+ tab_title = _("Votes"),
+ tab_description = _("Votes history"),
+ page_title = _("Votes - User Profile"),
view_name = 'user_votes',
template_file = 'user_votes.html',
data_size = 50
),
UserView(
id = 'preferences',
- tab_title = u'设置',
- tab_description = u'用户参数设置',
- page_title = u'设置 - 用户资料',
+ tab_title = _("Preferences"),
+ tab_description = _("User preferences"),
+ page_title = _("Preferences - User Profile"),
view_name = 'user_preferences',
template_file = 'user_preferences.html'
)
-)
\ No newline at end of file +)
diff --git a/forum/views.py b/forum/views.py index 49ad6c19..8252304e 100644 --- a/forum/views.py +++ b/forum/views.py @@ -144,8 +144,10 @@ def questions(request, tagname=None, unanswered=False): questions = objects_list.page(page)
# Get related tags from this page objects
- related_tags = Tag.objects.get_tags_by_questions(questions.object_list)
-
+ if questions.object_list.count() > 0:
+ related_tags = Tag.objects.get_tags_by_questions(questions.object_list)
+ else:
+ related_tags = None
return render_to_response(template_file, {
"questions" : questions,
"tab_id" : view_id,
@@ -1053,8 +1055,8 @@ def user_recent(request, user_id, user_view): 'activity_type' : 'activity.activity_type'
},
tables=['activity', 'question'],
- where=['activity.content_type_id = %s AND activity.object_id = question.id AND \
- activity.user_id = %s AND activity.activity_type = %s'],
+ where=['activity.content_type_id = %s AND activity.object_id = ' +
+ 'question.id AND activity.user_id = %s AND activity.activity_type = %s'],
params=[question_type_id, user_id, TYPE_ACTIVITY_ASK_QUESTION],
order_by=['-activity.active_at']
).values(
@@ -1078,8 +1080,8 @@ def user_recent(request, user_id, user_view): 'activity_type' : 'activity.activity_type'
},
tables=['activity', 'answer', 'question'],
- where=['activity.content_type_id = %s AND activity.object_id = answer.id AND \
- answer.question_id=question.id AND activity.user_id=%s AND activity.activity_type=%s'],
+ where=['activity.content_type_id = %s AND activity.object_id = answer.id AND ' +
+ 'answer.question_id=question.id AND activity.user_id=%s AND activity.activity_type=%s'],
params=[answer_type_id, user_id, TYPE_ACTIVITY_ANSWER],
order_by=['-activity.active_at']
).values(
@@ -1104,9 +1106,9 @@ def user_recent(request, user_id, user_view): },
tables=['activity', 'question', 'comment'],
- where=['activity.content_type_id = %s AND activity.object_id = comment.id AND \
- activity.user_id = comment.user_id AND comment.object_id=question.id AND \
- comment.content_type_id=%s AND activity.user_id = %s AND activity.activity_type=%s'],
+ where=['activity.content_type_id = %s AND activity.object_id = comment.id AND '+
+ 'activity.user_id = comment.user_id AND comment.object_id=question.id AND '+
+ 'comment.content_type_id=%s AND activity.user_id = %s AND activity.activity_type=%s'],
params=[comment_type_id, question_type_id, user_id, TYPE_ACTIVITY_COMMENT_QUESTION],
order_by=['-comment.added_at']
).values(
@@ -1132,10 +1134,10 @@ def user_recent(request, user_id, user_view): },
tables=['activity', 'question', 'answer', 'comment'],
- where=['activity.content_type_id = %s AND activity.object_id = comment.id AND \
- activity.user_id = comment.user_id AND comment.object_id=answer.id AND \
- comment.content_type_id=%s AND question.id = answer.question_id AND \
- activity.user_id = %s AND activity.activity_type=%s'],
+ where=['activity.content_type_id = %s AND activity.object_id = comment.id AND '+
+ 'activity.user_id = comment.user_id AND comment.object_id=answer.id AND '+
+ 'comment.content_type_id=%s AND question.id = answer.question_id AND '+
+ 'activity.user_id = %s AND activity.activity_type=%s'],
params=[comment_type_id, answer_type_id, user_id, TYPE_ACTIVITY_COMMENT_ANSWER],
order_by=['-comment.added_at']
).values(
@@ -1161,9 +1163,9 @@ def user_recent(request, user_id, user_view): 'summary' : 'question_revision.summary'
},
tables=['activity', 'question_revision'],
- where=['activity.content_type_id = %s AND activity.object_id = question_revision.id AND \
- activity.user_id = question_revision.author_id AND activity.user_id = %s AND \
- activity.activity_type=%s'],
+ where=['activity.content_type_id = %s AND activity.object_id = question_revision.id AND '+
+ 'activity.user_id = question_revision.author_id AND activity.user_id = %s AND '+
+ 'activity.activity_type=%s'],
params=[question_revision_type_id, user_id, TYPE_ACTIVITY_UPDATE_QUESTION],
order_by=['-activity.active_at']
).values(
@@ -1191,10 +1193,10 @@ def user_recent(request, user_id, user_view): },
tables=['activity', 'answer_revision', 'question', 'answer'],
- where=['activity.content_type_id = %s AND activity.object_id = answer_revision.id AND \
- activity.user_id = answer_revision.author_id AND activity.user_id = %s AND \
- answer_revision.answer_id=answer.id AND answer.question_id = question.id AND \
- activity.activity_type=%s'],
+ where=['activity.content_type_id = %s AND activity.object_id = answer_revision.id AND '+
+ 'activity.user_id = answer_revision.author_id AND activity.user_id = %s AND '+
+ 'answer_revision.answer_id=answer.id AND answer.question_id = question.id AND '+
+ 'activity.activity_type=%s'],
params=[answer_revision_type_id, user_id, TYPE_ACTIVITY_UPDATE_ANSWER],
order_by=['-activity.active_at']
).values(
@@ -1220,9 +1222,9 @@ def user_recent(request, user_id, user_view): 'activity_type' : 'activity.activity_type',
},
tables=['activity', 'answer', 'question'],
- where=['activity.content_type_id = %s AND activity.object_id = answer.id AND \
- activity.user_id = question.author_id AND activity.user_id = %s AND \
- answer.question_id=question.id AND activity.activity_type=%s'],
+ where=['activity.content_type_id = %s AND activity.object_id = answer.id AND '+
+ 'activity.user_id = question.author_id AND activity.user_id = %s AND '+
+ 'answer.question_id=question.id AND activity.activity_type=%s'],
params=[answer_type_id, user_id, TYPE_ACTIVITY_MARK_ANSWER],
order_by=['-activity.active_at']
).values(
@@ -1243,8 +1245,8 @@ def user_recent(request, user_id, user_view): 'activity_type' : 'activity.activity_type'
},
tables=['activity', 'award', 'badge'],
- where=['activity.user_id = award.user_id AND activity.user_id = %s AND \
- award.badge_id=badge.id AND activity.object_id=award.id AND activity.activity_type=%s'],
+ where=['activity.user_id = award.user_id AND activity.user_id = %s AND '+
+ 'award.badge_id=badge.id AND activity.object_id=award.id AND activity.activity_type=%s'],
params=[user_id, TYPE_ACTIVITY_PRIZE],
order_by=['-activity.active_at']
).values(
@@ -1297,8 +1299,8 @@ def user_responses(request, user_id, user_view): },
select_params=[user_id],
tables=['answer', 'question', 'auth_user'],
- where=['answer.question_id = question.id AND answer.deleted=0 AND question.deleted = 0 AND \
- question.author_id = %s AND answer.author_id <> %s AND answer.author_id=auth_user.id'],
+ where=['answer.question_id = question.id AND answer.deleted=0 AND question.deleted = 0 AND '+
+ 'question.author_id = %s AND answer.author_id <> %s AND answer.author_id=auth_user.id'],
params=[user_id, user_id],
order_by=['-answer.id']
).values(
@@ -1327,8 +1329,8 @@ def user_responses(request, user_id, user_view): 'user_id' : 'auth_user.id'
},
tables=['question', 'auth_user', 'comment'],
- where=['question.deleted = 0 AND question.author_id = %s AND comment.object_id=question.id AND \
- comment.content_type_id=%s AND comment.user_id <> %s AND comment.user_id = auth_user.id'],
+ where=['question.deleted = 0 AND question.author_id = %s AND comment.object_id=question.id AND '+
+ 'comment.content_type_id=%s AND comment.user_id <> %s AND comment.user_id = auth_user.id'],
params=[user_id, question_type_id, user_id],
order_by=['-comment.added_at']
).values(
@@ -1357,9 +1359,9 @@ def user_responses(request, user_id, user_view): 'user_id' : 'auth_user.id'
},
tables=['answer', 'auth_user', 'comment', 'question'],
- where=['answer.deleted = 0 AND answer.author_id = %s AND comment.object_id=answer.id AND \
- comment.content_type_id=%s AND comment.user_id <> %s AND comment.user_id = auth_user.id \
- AND question.id = answer.question_id'],
+ where=['answer.deleted = 0 AND answer.author_id = %s AND comment.object_id=answer.id AND '+
+ 'comment.content_type_id=%s AND comment.user_id <> %s AND comment.user_id = auth_user.id '+
+ 'AND question.id = answer.question_id'],
params=[user_id, answer_type_id, user_id],
order_by=['-comment.added_at']
).values(
@@ -1390,8 +1392,8 @@ def user_responses(request, user_id, user_view): },
select_params=[user_id],
tables=['answer', 'question', 'auth_user'],
- where=['answer.question_id = question.id AND answer.deleted=0 AND question.deleted = 0 AND \
- answer.author_id = %s AND answer.accepted=1 AND question.author_id=auth_user.id'],
+ where=['answer.question_id = question.id AND answer.deleted=0 AND question.deleted = 0 AND '+
+ 'answer.author_id = %s AND answer.accepted=1 AND question.author_id=auth_user.id'],
params=[user_id],
order_by=['-answer.id']
).values(
@@ -1435,7 +1437,8 @@ def user_votes(request, user_id, user_view): },
select_params=[user_id],
tables=['vote', 'question', 'auth_user'],
- where=['vote.content_type_id = %s AND vote.user_id = %s AND vote.object_id = question.id AND vote.user_id=auth_user.id'],
+ where=['vote.content_type_id = %s AND vote.user_id = %s AND vote.object_id = question.id '+
+ 'AND vote.user_id=auth_user.id'],
params=[question_type_id, user_id],
order_by=['-vote.id']
).values(
@@ -1458,7 +1461,8 @@ def user_votes(request, user_id, user_view): },
select_params=[user_id],
tables=['vote', 'answer', 'question', 'auth_user'],
- where=['vote.content_type_id = %s AND vote.user_id = %s AND vote.object_id = answer.id AND answer.question_id = question.id AND vote.user_id=auth_user.id'],
+ where=['vote.content_type_id = %s AND vote.user_id = %s AND vote.object_id = answer.id '+
+ 'AND answer.question_id = question.id AND vote.user_id=auth_user.id'],
params=[answer_type_id, user_id],
order_by=['-vote.id']
).values(
@@ -1483,7 +1487,8 @@ def user_votes(request, user_id, user_view): def user_reputation(request, user_id, user_view):
user = get_object_or_404(User, id=user_id)
reputation = Repute.objects.extra(
- select={'positive': 'sum(positive)', 'negative': 'sum(negative)', 'question_id':'question_id', 'title': 'question.title'},
+ select={'positive': 'sum(positive)', 'negative': 'sum(negative)', 'question_id':'question_id',
+ 'title': 'question.title'},
tables=['repute', 'question'],
order_by=['-reputed_at'],
where=['user_id=%s AND question_id=question.id'],
@@ -1514,7 +1519,8 @@ def user_favorites(request, user_id, user_view): questions = Question.objects.extra(
select={
'vote_count' : 'question.vote_up_count + question.vote_down_count',
- 'favorited_myself' : 'SELECT count(*) FROM favorite_question f WHERE f.user_id = %s AND f.question_id = question.id',
+ 'favorited_myself' : 'SELECT count(*) FROM favorite_question f WHERE f.user_id = %s '+
+ 'AND f.question_id = question.id',
'la_user_id' : 'auth_user.id',
'la_username' : 'auth_user.username',
'la_user_gold' : 'auth_user.gold',
@@ -1524,7 +1530,8 @@ def user_favorites(request, user_id, user_view): },
select_params=[user_id],
tables=['question', 'auth_user', 'favorite_question'],
- where=['question.deleted = 0 AND question.last_activity_by_id = auth_user.id AND favorite_question.question_id = question.id AND favorite_question.user_id = %s'],
+ where=['question.deleted = 0 AND question.last_activity_by_id = auth_user.id '+
+ 'AND favorite_question.question_id = question.id AND favorite_question.user_id = %s'],
params=[user_id],
order_by=['-vote_count', '-question.id']
).values('vote_count',
@@ -1655,7 +1662,12 @@ def badges(request): def badge(request, id):
badge = get_object_or_404(Badge, id=id)
awards = Award.objects.extra(
- select={'id': 'auth_user.id', 'name': 'auth_user.username', 'rep':'auth_user.reputation', 'gold': 'auth_user.gold', 'silver': 'auth_user.silver', 'bronze': 'auth_user.bronze'},
+ select={'id': 'auth_user.id',
+ 'name': 'auth_user.username',
+ 'rep':'auth_user.reputation',
+ 'gold': 'auth_user.gold',
+ 'silver': 'auth_user.silver',
+ 'bronze': 'auth_user.bronze'},
tables=['award', 'auth_user'],
where=['badge_id=%s AND user_id=auth_user.id'],
params=[id]
diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo Binary files differnew file mode 100644 index 00000000..13786a3a --- /dev/null +++ b/locale/zh_CN/LC_MESSAGES/django.mo diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po new file mode 100644 index 00000000..9f15a3e7 --- /dev/null +++ b/locale/zh_CN/LC_MESSAGES/django.po @@ -0,0 +1,430 @@ +# Chinese translations for CNProg.com +# Copyright (C) 2009 +# This file is distributed under the same license as the CNPROG package. +# Mike Chen <chagel@gmail.com>, 2009. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-07-05 12:30+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: settings.py:24 +msgid "account/" +msgstr "" + +#: settings.py:24 django_authopenid/urls.py:9 django_authopenid/urls.py:11 +msgid "signin/" +msgstr "" + +#: django_authopenid/forms.py:67 django_authopenid/views.py:93 +msgid "i-names are not supported" +msgstr "i-names不支持。" + +#: django_authopenid/forms.py:102 django_authopenid/forms.py:207 +msgid "" +"Usernames can only contain letters, numbers and " +"underscores" +msgstr "用户名格式有误。只有字母,数字和下划线是允许的。" + +#: django_authopenid/forms.py:109 +msgid "" +"This username does not exist in our database. Please " +"choose another." +msgstr "用户名不存在。请重新输入。" + +#: django_authopenid/forms.py:126 django_authopenid/forms.py:231 +msgid "" +"Please enter a valid username and password. Note that " +"both fields are case-sensitive." +msgstr "请输入用户名和密码。注意区分大小写。" + +#: django_authopenid/forms.py:130 django_authopenid/forms.py:235 +msgid "This account is inactive." +msgstr "用户已冻结。" + +#: django_authopenid/forms.py:184 +msgid "" +"This email is already registered in our database. Please " +"choose another." +msgstr "电子邮件已被注册。请使用一个新的邮件地址。" + +#: django_authopenid/forms.py:214 +msgid "" +"This username don't exist. Please choose another." +msgstr "用户名不存在" + +#: django_authopenid/forms.py:330 +msgid "" +"Old password is incorrect. Please enter the correct " +"password." +msgstr "旧密码错误。" + +#: django_authopenid/forms.py:342 +msgid "new passwords do not match" +msgstr "新密码不匹配" + +#: django_authopenid/forms.py:434 +msgid "Incorrect username." +msgstr "用户名不正确" + +#: django_authopenid/urls.py:10 +msgid "signout/" +msgstr "" + +#: django_authopenid/urls.py:11 +msgid "complete/" +msgstr "" + +#: django_authopenid/urls.py:13 +msgid "register/" +msgstr "" + +#: django_authopenid/urls.py:14 +msgid "signup/" +msgstr "" + +#: django_authopenid/urls.py:16 +msgid "sendpw/" +msgstr "" + +#: django_authopenid/urls.py:26 +msgid "delete/" +msgstr "" + +#: django_authopenid/views.py:99 +#, python-format +msgid "非法OpenID地址: %s" +msgstr "" + +#: django_authopenid/views.py:366 +msgid "Welcome" +msgstr "欢迎" + +#: django_authopenid/views.py:456 +msgid "Password changed." +msgstr "密码已更新。" + +#: django_authopenid/views.py:488 +msgid "Email changed." +msgstr "邮件地址已更新。" + +#: django_authopenid/views.py:519 django_authopenid/views.py:671 +#, python-format +msgid "No OpenID %s found associated in our database" +msgstr "该OpenID %s 不在系统中。" + +#: django_authopenid/views.py:523 django_authopenid/views.py:678 +#, python-format +msgid "The OpenID %s isn't associated to current user logged in" +msgstr "OpenID %s 没有和当前登录用户绑定。" + +#: django_authopenid/views.py:531 +msgid "Email Changed." +msgstr "邮件地址已更新。" + +#: django_authopenid/views.py:606 +msgid "This OpenID is already associated with another account." +msgstr "这个OpenID已经绑定到另外一个帐号。" + +#: django_authopenid/views.py:611 +#, python-format +msgid "OpenID %s is now associated with your account." +msgstr "OpenID %s 已经绑定到您的帐号。" + +#: django_authopenid/views.py:681 +msgid "Account deleted." +msgstr "帐号已删除。" + +#: django_authopenid/views.py:721 +msgid "Request for new password" +msgstr "找回密码" + +#: django_authopenid/views.py:734 +msgid "A new password has been sent to your email address." +msgstr "新的密码已经发送到您的邮件帐号。" + +#: django_authopenid/views.py:764 +#, python-format +msgid "" +"Could not change password. Confirmation key '%s' is not " +"registered." +msgstr "不能修改密码。确认信息 '%s' 有误。" + +#: django_authopenid/views.py:773 +msgid "" +"Can not change password. User don't exist anymore in our " +"database." +msgstr "不能修改密码。用户帐号不存在。" + +#: django_authopenid/views.py:782 +#, python-format +msgid "Password changed for %s. You may now sign in." +msgstr "帐号 %s 的密码已经修改。您现在可以用它来登录。" + +#: forum/user.py:17 +msgid "Overview" +msgstr "概览" + +#: forum/user.py:18 +msgid "User overview" +msgstr "用户概览" + +#: forum/user.py:19 +msgid "Overview - User Profile" +msgstr "概览-用户资料" + +#: forum/user.py:25 +msgid "Recent" +msgstr "最近活动" + +#: forum/user.py:26 +msgid "Recent activities" +msgstr "用户最近活动情况" + +#: forum/user.py:27 +msgid "Recent - User Profile" +msgstr "最近活动-用户资料" + +#: forum/user.py:34 +msgid "Response" +msgstr "回应" + +#: forum/user.py:35 +msgid "Responses from others" +msgstr "其他用户的回答和评论" + +#: forum/user.py:36 +msgid "Response - User Profile" +msgstr "回应-用户资料" + +#: forum/user.py:43 +msgid "Reputation" +msgstr "积分" + +#: forum/user.py:44 +msgid "Community reputation" +msgstr "社区积分" + +#: forum/user.py:45 +msgid "Reputation - User Profile" +msgstr "积分-用户资料" + +#: forum/user.py:51 +msgid "Favorites" +msgstr "收藏" + +#: forum/user.py:52 +msgid "User's favorite questions" +msgstr "用户收藏的问题" + +#: forum/user.py:53 +msgid "Favorites - User Profile" +msgstr "收藏-用户资料" + +#: forum/user.py:60 +msgid "Votes" +msgstr "投票" + +#: forum/user.py:61 +msgid "Votes history" +msgstr "用户投票历史" + +#: forum/user.py:62 +msgid "Votes - User Profile" +msgstr "投票-用户资料" + +#: forum/user.py:69 +msgid "Preferences" +msgstr "设置" + +#: forum/user.py:70 +msgid "User preferences" +msgstr "用户参数设置" + +#: forum/user.py:71 +msgid "Preferences - User Profile" +msgstr "设置-用户资料" + +#: templates/badges.html:5 templates/badges.html.py:16 +msgid "Badges" +msgstr "奖牌榜" + +#: templates/authopenid/changeemail.html:10 +msgid "Account: change email" +msgstr "修改电子邮件" + +#: templates/authopenid/changeemail.html:13 +msgid "" +"This is where you can change the email address associated with your account. " +"Please keep this email address up to date so we can send you a password-" +"reset email if you request one." +msgstr "" +"您可以在这里修改您的电子邮件,请确保这个邮件地址有效-找回密码将发送新密码到您" +"的邮件地址。" + +#: templates/authopenid/changeemail.html:15 +#: templates/authopenid/changeopenid.html:13 +#: templates/authopenid/changepw.html:18 templates/authopenid/delete.html:14 +#: templates/authopenid/delete.html:24 +msgid "Please correct errors below:" +msgstr "请改正以下错误:" + +#: templates/authopenid/changeemail.html:32 +msgid "Email" +msgstr "电子邮件" + +#: templates/authopenid/changeemail.html:33 +msgid "Password" +msgstr "密码" + +#: templates/authopenid/changeemail.html:35 +msgid "Change email" +msgstr "修改电子邮件" + +#: templates/authopenid/changeopenid.html:7 +msgid "Account: change OpenID URL" +msgstr "修改OpenID地址" + +#: templates/authopenid/changeopenid.html:11 +msgid "" +"This is where you can change your OpenID URL. Make sure you remember it!" +msgstr "请修改您的OpenID地址,请不要忘记这个地址!" + +#: templates/authopenid/changeopenid.html:28 +msgid "OpenID URL:" +msgstr "OpenID地址:" + +#: templates/authopenid/changeopenid.html:29 +msgid "Change OpenID" +msgstr "修改OpenID" + +#: templates/authopenid/changepw.html:13 +msgid "Account: change password" +msgstr "修改密码" + +#: templates/authopenid/changepw.html:16 +msgid "This is where you can change your password. Make sure you remember it!" +msgstr "请修改您的密码,切记不要忘记!" + +#: templates/authopenid/changepw.html:26 +msgid "Current password" +msgstr "旧密码" + +#: templates/authopenid/changepw.html:27 +msgid "New password" +msgstr "新密码" + +#: templates/authopenid/changepw.html:28 +msgid "New password again" +msgstr "重复密码" + +#: templates/authopenid/changepw.html:29 +msgid "Change password" +msgstr "修改密码" + +#: templates/authopenid/delete.html:8 +msgid "Account: delete account" +msgstr "删除帐号" + +#: templates/authopenid/delete.html:12 +msgid "" +"Note: After deleting your account, anyone will be able to register this " +"username." +msgstr "注意:删除您的帐号后,任何其他人可以再注册这个帐号。" + +#: templates/authopenid/delete.html:16 +msgid "Check confirm box, if you want delete your account." +msgstr "如果确定删除,请选中多选框。" + +#: templates/authopenid/delete.html:19 +msgid "Password:" +msgstr "密码:" + +#: templates/authopenid/delete.html:31 +msgid "I am sure I want to delete my account." +msgstr "我确认要删除这个帐号。" + +#: templates/authopenid/delete.html:32 +msgid "Password/OpenID URL" +msgstr "密码/OpenID地址" + +#: templates/authopenid/delete.html:32 +msgid "(required for your security)" +msgstr "(必需)" + +#: templates/authopenid/delete.html:34 +msgid "Delete account permanently" +msgstr "永久删除帐号" + +#: templates/authopenid/settings.html:29 +msgid "Give your account a new password." +msgstr "修改密码" + +#: templates/authopenid/settings.html:31 +msgid "Add or update the email address associated with your account." +msgstr "添加或者更新您的邮件地址。" + +#: templates/authopenid/settings.html:34 +msgid "Change openid associated to your account" +msgstr "修改和你帐号绑定的OpenID地址" + +#: templates/authopenid/settings.html:38 +msgid "Erase your username and all your data from website" +msgstr "删除您的帐号和所有内容" + +#, fuzzy +#~ msgid "Badges " +#~ msgstr "奖牌列表" + +#~ msgid "" +#~ "This username is already taken. Please choose another." +#~ msgstr "用户名已经被注册,请选用一个新的帐号。" + +#~ msgid "Your OpenID is verified! " +#~ msgstr "您的OpenID帐号已经验证通过" + +#~ msgid "Associate your OpenID" +#~ msgstr "绑定您的OpenID" + +#~ msgid "" +#~ "\n" +#~ "\t<p>If you're joining <strong>Sitename</strong>, associate your OpenID " +#~ "with a new account. If you're already a member, associate with your " +#~ "existing account.</p>\n" +#~ "\t" +#~ msgstr "" +#~ "\n" +#~ "\t<p>输入您的新帐号或者指定已经存在的帐号。</p>\n" +#~ "\t" + +#~ msgid "A new account" +#~ msgstr "新帐号" + +#~ msgid "Username" +#~ msgstr "用户名" + +#~ msgid "An exisiting account" +#~ msgstr "已经存在的帐号" + +#~ msgid "Account: Send a new password" +#~ msgstr "发送一个新的密码" + +#~ msgid "" +#~ "Lost your password ? Here you can ask to reset your password. Enter the " +#~ "username you use and you will get a confirmation email with your new " +#~ "password. This new password will be activated only after you have clicked " +#~ "on the link in the email." +#~ msgstr "" +#~ "丢失了您的密码?你可以在这里重设密码。输入用户名你会收到新的密码的邮件。密" +#~ "码只有您在激活邮件中的链接才会被激活。" + +#~ msgid "Send new password" +#~ msgstr "发送新密码" diff --git a/locale/zh_cn/LC_MESSAGES/django.mo b/locale/zh_cn/LC_MESSAGES/django.mo Binary files differdeleted file mode 100644 index f8f70df4..00000000 --- a/locale/zh_cn/LC_MESSAGES/django.mo +++ /dev/null diff --git a/locale/zh_cn/LC_MESSAGES/django.po b/locale/zh_cn/LC_MESSAGES/django.po deleted file mode 100644 index 07eaa93d..00000000 --- a/locale/zh_cn/LC_MESSAGES/django.po +++ /dev/null @@ -1,416 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-12-31 16:00+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: .\settings.py:32 -msgid "account/" -msgstr "" - -#: .\settings.py:32 .\django_authopenid\urls.py:9 -#: .\django_authopenid\urls.py:11 -msgid "signin/" -msgstr "" - -#: .\django_authopenid\forms.py:67 .\django_authopenid\views.py:93 -msgid "i-names are not supported" -msgstr "i-names不支持。" - -#: .\django_authopenid\forms.py:100 .\django_authopenid\forms.py:156 -#: .\django_authopenid\forms.py:205 -msgid "" -"Usernames can only contain letters, numbers and " -"underscores" -msgstr "用户名格式有误。只有字母,数字和下划线是允许的。" - -#: .\django_authopenid\forms.py:107 -msgid "" -"This username does not exist in our database. Please " -"choose another." -msgstr "用户名不存在。请重新输入。" - -#: .\django_authopenid\forms.py:124 .\django_authopenid\forms.py:229 -msgid "" -"Please enter a valid username and password. Note that " -"both fields are case-sensitive." -msgstr "请输入用户名和密码。注意区分大小写。" - -#: .\django_authopenid\forms.py:128 .\django_authopenid\forms.py:233 -msgid "This account is inactive." -msgstr "用户已冻结。" - -#: .\django_authopenid\forms.py:168 -msgid "This username is already taken. Please choose another." -msgstr "用户名已经被注册,请选用一个新的帐号。" - -#: .\django_authopenid\forms.py:182 -msgid "" -"This email is already registered in our database. Please " -"choose another." -msgstr "电子邮件已被注册。请使用一个新的邮件地址。" - -#: .\django_authopenid\forms.py:212 -msgid "" -"This username don't exist. Please choose another." -msgstr "用户名不存在" - -#: .\django_authopenid\forms.py:328 -msgid "" -"Old password is incorrect. Please enter the correct " -"password." -msgstr "旧密码错误。" - -#: .\django_authopenid\forms.py:340 -msgid "new passwords do not match" -msgstr "新密码不匹配" - -#: .\django_authopenid\forms.py:432 -msgid "Incorrect username." -msgstr "用户名不正确" - -#: .\django_authopenid\urls.py:10 -msgid "signout/" -msgstr "" - -#: .\django_authopenid\urls.py:11 -msgid "complete/" -msgstr "" - -#: .\django_authopenid\urls.py:13 -msgid "register/" -msgstr "" - -#: .\django_authopenid\urls.py:14 -msgid "signup/" -msgstr "" - -#: .\django_authopenid\urls.py:15 -msgid "sendpw/" -msgstr "" - -#: .\django_authopenid\urls.py:16 .\django_authopenid\urls.py:21 -msgid "password/" -msgstr "" - -#: .\django_authopenid\urls.py:16 -msgid "confirm/" -msgstr "" - -#: .\django_authopenid\urls.py:22 -msgid "email/" -msgstr "" - -#: .\django_authopenid\urls.py:23 -msgid "openid/" -msgstr "" - -#: .\django_authopenid\urls.py:24 -msgid "delete/" -msgstr "" - -#: .\django_authopenid\views.py:99 -#, python-format -msgid "非法OpenID地址: %s" -msgstr "" - -#: .\django_authopenid\views.py:366 -msgid "Welcome" -msgstr "欢迎" - -#: .\django_authopenid\views.py:456 -msgid "Password changed." -msgstr "密码已更新。" - -#: .\django_authopenid\views.py:488 -msgid "Email changed." -msgstr "邮件地址已更新。" - -#: .\django_authopenid\views.py:519 .\django_authopenid\views.py:671 -#, python-format -msgid "No OpenID %s found associated in our database" -msgstr "该OpenID %s 不在系统中。" - -#: .\django_authopenid\views.py:523 .\django_authopenid\views.py:678 -#, python-format -msgid "The OpenID %s isn't associated to current user logged in" -msgstr "OpenID %s 没有和当前登录用户绑定。" - -#: .\django_authopenid\views.py:531 -msgid "Email Changed." -msgstr "邮件地址已更新。" - -#: .\django_authopenid\views.py:606 -msgid "This OpenID is already associated with another account." -msgstr "这个OpenID已经绑定到另外一个帐号。" - -#: .\django_authopenid\views.py:611 -#, python-format -msgid "OpenID %s is now associated with your account." -msgstr "OpenID %s 已经绑定到您的帐号。" - -#: .\django_authopenid\views.py:681 -msgid "Account deleted." -msgstr "帐号已删除。" - -#: .\django_authopenid\views.py:721 -msgid "Request for new password" -msgstr "找回密码" - -#: .\django_authopenid\views.py:734 -msgid "A new password has been sent to your email address." -msgstr "新的密码已经发送到您的邮件帐号。" - -#: .\django_authopenid\views.py:764 -#, python-format -msgid "" -"Could not change password. Confirmation key '%s' is not " -"registered." -msgstr "不能修改密码。确认信息 '%s' 有误。" - -#: .\django_authopenid\views.py:773 -msgid "" -"Can not change password. User don't exist anymore in our " -"database." -msgstr "不能修改密码。用户帐号不存在。" - -#: .\django_authopenid\views.py:782 -#, python-format -msgid "Password changed for %s. You may now sign in." -msgstr "帐号 %s 的密码已经修改。您现在可以用它来登录。" - -#: .\templates\authopenid\changeemail.html.py:8 -msgid "Account: change email" -msgstr "修改电子邮件" - -#: .\templates\authopenid\changeemail.html.py:10 -msgid "" -"This is where you can change the email address associated with your account. " -"Please keep this email address up to date so we can send you a password-" -"reset email if you request one." -msgstr "" -"您可以在这里修改您的电子邮件,请确保这个邮件地址有效-找回密码将发送新密码到您" -"的邮件地址。" - -#: .\templates\authopenid\changeemail.html.py:12 -#: .\templates\authopenid\changeopenid.html.py:9 -#: .\templates\authopenid\changepw.html.py:15 -#: .\templates\authopenid\complete.html.py:26 -#: .\templates\authopenid\complete.html.py:36 -#: .\templates\authopenid\delete.html.py:10 -#: .\templates\authopenid\delete.html.py:20 -#: .\templates\authopenid\sendpw.html.py:11 -#: .\templates\authopenid\signup.html.py:15 -msgid "Please correct errors below:" -msgstr "请改正以下错误:" - -#: .\templates\authopenid\changeemail.html.py:29 -#: .\templates\authopenid\complete.html.py:52 -msgid "Email" -msgstr "电子邮件" - -#: .\templates\authopenid\changeemail.html.py:30 -#: .\templates\authopenid\complete.html.py:68 -msgid "Password" -msgstr "密码" - -#: .\templates\authopenid\changeemail.html.py:32 -msgid "Change email" -msgstr "修改电子邮件" - -#: .\templates\authopenid\changeopenid.html.py:5 -msgid "Account: change OpenID URL" -msgstr "修改OpenID地址" - -#: .\templates\authopenid\changeopenid.html.py:7 -msgid "" -"This is where you can change your OpenID URL. Make sure you remember it!" -msgstr "请修改您的OpenID地址,请不要忘记这个地址!" - -#: .\templates\authopenid\changeopenid.html.py:24 -msgid "OpenID URL:" -msgstr "OpenID地址:" - -#: .\templates\authopenid\changeopenid.html.py:25 -msgid "Change OpenID" -msgstr "修改OpenID" - -#: .\templates\authopenid\changepw.html.py:11 -msgid "Account: change password" -msgstr "修改密码" - -#: .\templates\authopenid\changepw.html.py:13 -msgid "This is where you can change your password. Make sure you remember it!" -msgstr "请修改您的密码,切记不要忘记!" - -#: .\templates\authopenid\changepw.html.py:23 -msgid "Current password" -msgstr "旧密码" - -#: .\templates\authopenid\changepw.html.py:24 -msgid "New password" -msgstr "新密码" - -#: .\templates\authopenid\changepw.html.py:25 -msgid "New password again" -msgstr "重复密码" - -#: .\templates\authopenid\changepw.html.py:26 -msgid "Change password" -msgstr "修改密码" - -#: .\templates\authopenid\complete.html.py:12 -msgid "Your OpenID is verified! " -msgstr "您的OpenID帐号已经验证通过" - - -#: .\templates\authopenid\complete.html.py:17 -msgid "Associate your OpenID" -msgstr "绑定您的OpenID" - -#: .\templates\authopenid\complete.html.py:18 -msgid "" -"\n" -"\t<p>If you're joining <strong>Sitename</strong>, associate your OpenID with " -"a new account. If you're already a member, associate with your existing " -"account.</p>\n" -"\t" -msgstr "" -"\n" -"\t<p>输入您的新帐号或者指定已经存在的帐号。</p>\n" -"\t" - -#: .\templates\authopenid\complete.html.py:50 -msgid "A new account" -msgstr "新帐号" - -#: .\templates\authopenid\complete.html.py:51 -#: .\templates\authopenid\complete.html.py:67 -#: .\templates\authopenid\sendpw.html.py:24 -msgid "Username" -msgstr "用户名" - -#: .\templates\authopenid\complete.html.py:66 -msgid "An exisiting account" -msgstr "已经存在的帐号" - -#: .\templates\authopenid\delete.html.py:6 -msgid "Account: delete account" -msgstr "删除帐号" - -#: .\templates\authopenid\delete.html.py:8 -msgid "" -"Note: After deleting your account, anyone will be able to register this " -"username." -msgstr "注意:删除您的帐号后,任何其他人可以再注册这个帐号。" - -#: .\templates\authopenid\delete.html.py:12 -msgid "Check confirm box, if you want delete your account." -msgstr "如果确定删除,请选中多选框。" - -#: .\templates\authopenid\delete.html.py:15 -msgid "Password:" -msgstr "密码:" - -#: .\templates\authopenid\delete.html.py:27 -msgid "I am sure I want to delete my account." -msgstr "我确认要删除这个帐号。" - -#: .\templates\authopenid\delete.html.py:28 -msgid "Password/OpenID URL" -msgstr "密码/OpenID地址" - -#: .\templates\authopenid\delete.html.py:28 -msgid "(required for your security)" -msgstr "(必需)" - -#: .\templates\authopenid\delete.html.py:30 -msgid "Delete account permanently" -msgstr "永久删除帐号" - -#: .\templates\authopenid\sendpw.html.py:7 -msgid "Account: Send a new password" -msgstr "发送一个新的密码" - -#: .\templates\authopenid\sendpw.html.py:9 -msgid "" -"Lost your password ? Here you can ask to reset your password. Enter the " -"username you use and you will get a confirmation email with your new " -"password. This new password will be activated only after you have clicked on " -"the link in the email." -msgstr "" -"丢失了您的密码?你可以在这里重设密码。输入用户名你会收到新的密码的邮件。密码" -"只有您在激活邮件中的链接才会被激活。" - -#: .\templates\authopenid\sendpw.html.py:26 -msgid "Send new password" -msgstr "发送新密码" - -#: .\templates\authopenid\settings.html.py:29 -msgid "Give your account a new password." -msgstr "修改密码" - -#: .\templates\authopenid\settings.html.py:31 -msgid "Add or update the email address associated with your account." -msgstr "添加或者更新您的邮件地址。" - -#: .\templates\authopenid\settings.html.py:34 -msgid "Change openid associated to your account" -msgstr "修改和你帐号绑定的OpenID地址" - -#: .\templates\authopenid\settings.html.py:38 -msgid "Erase your username and all your data from website" -msgstr "删除您的帐号和所有内容" - -#: .\templates\authopenid\signup.html.py:7 -msgid "" -"\n" -" <h1>Join</h1>\n" -" <p>There are two ways to join: with an email + username, or with OpenID." -"<br />Enter information only for the type of sign up you want to do.</p>\n" -" " -msgstr "" - -#: .\templates\authopenid\signup.html.py:13 -msgid "Regular Signup" -msgstr "" - -#: .\templates\authopenid\signup.html.py:29 -msgid "Choose a Username:" -msgstr "" - -#: .\templates\authopenid\signup.html.py:31 -msgid "Enter Your Email Address:" -msgstr "" - -#: .\templates\authopenid\signup.html.py:32 -msgid "Choose a Password:" -msgstr "" - -#: .\templates\authopenid\signup.html.py:33 -msgid "Confirm Your Password:" -msgstr "" - -#: .\templates\authopenid\signup.html.py:35 -msgid "Sign up" -msgstr "" - -#: .\templates\authopenid\signup.html.py:39 -msgid "OpenID Signup" -msgstr "" - -#: .\templates\authopenid\signup.html.py:42 -msgid "Sign in with OpenID" -msgstr "" diff --git a/settings.py b/settings.py index 4aa70254..50579cb9 100644 --- a/settings.py +++ b/settings.py @@ -4,20 +4,8 @@ import os.path DEBUG = True
TEMPLATE_DEBUG = DEBUG
-#David Cramer debug toolbar
INTERNAL_IPS = ('127.0.0.1',)
-DEBUG_TOOLBAR_PANELS = (
- 'debug_toolbar.panels.sql.SQLDebugPanel',
- 'debug_toolbar.panels.headers.HeaderDebugPanel',
- 'debug_toolbar.panels.cache.CacheDebugPanel',
- 'debug_toolbar.panels.profiler.ProfilerDebugPanel',
- 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
- 'debug_toolbar.panels.templates.TemplatesDebugPanel',
-)
-DEBUG_TOOLBAR_CONFIG = {
- "INTERCEPT_REDIRECTS":False
-}
#for OpenID auth
ugettext = lambda s: s
@@ -25,7 +13,7 @@ LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) #system will send admins email about error stacktrace if DEBUG=False
ADMINS = (
- ('Mike Chen', 'chagel@gmail.com'),
+ ('CNProg team', 'team@cnprog.com'),
)
MANAGERS = ADMINS
@@ -85,7 +73,7 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.transaction.TransactionMiddleware',
#'django.middleware.sqlprint.SqlPrintingMiddleware',
'middleware.pagesize.QuestionsPageSizeMiddleware',
- #'debug_toolbar.middleware.DebugToolbarMiddleware',
+ 'debug_toolbar.middleware.DebugToolbarMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
diff --git a/templates/badges.html b/templates/badges.html index eb5a0233..e8033f13 100644 --- a/templates/badges.html +++ b/templates/badges.html @@ -1,7 +1,8 @@ {% extends "base.html" %} {% load extra_tags %} {% load humanize %} -{% block title %}{% spaceless %}奖牌列表{% endspaceless %}{% endblock %} +{% load i18n %} +{% block title %}{% spaceless %}{% trans "Badges" %}{% endspaceless %}{% endblock %} {% block forejs %} <script type="text/javascript"> $().ready(function(){ @@ -12,7 +13,7 @@ {% endblock %} {% block content %} <div class="headlineA"> - <span class="headMedals">奖牌榜</span> + <span class="headMedals">{% trans "Badges"%}</span> </div> <div id="main-body" style="width:100%"> <p> @@ -60,4 +60,5 @@ urlpatterns = patterns('', url(r'^books/ask/(?P<short_name>[^/]+)/$', app.ask_book, name='ask_book'),
url(r'^books/(?P<short_name>[^/]+)/$', app.book, name='book'),
url(r'^search/$', app.search, name='search'),
+ (r'^i18n/', include('django.conf.urls.i18n')),
)
|