summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--context.py9
-rw-r--r--locale/zh_CN/LC_MESSAGES/django.mobin6519 -> 8581 bytes
-rw-r--r--locale/zh_CN/LC_MESSAGES/django.po180
-rw-r--r--settings.py42
-rw-r--r--settings_local.py.dist4
-rw-r--r--templates/base.html9
-rw-r--r--templates/base_content.html13
-rw-r--r--templates/footer.html16
-rw-r--r--templates/header.html37
-rw-r--r--templates/index.html53
-rw-r--r--templates/logout.html9
11 files changed, 267 insertions, 105 deletions
diff --git a/context.py b/context.py
new file mode 100644
index 00000000..f420b154
--- /dev/null
+++ b/context.py
@@ -0,0 +1,9 @@
+from django.conf import settings
+def application_settings(context):
+ return {
+ 'APP_TITLE' : settings.APP_TITLE,
+ 'APP_URL' : settings.APP_URL,
+ 'APP_KEYWORDS' : settings.APP_KEYWORDS,
+ 'APP_DESCRIPTION' : settings.APP_DESCRIPTION,
+ 'APP_INTRO' : settings.APP_INTRO
+ }
diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo
index 13786a3a..3b86743b 100644
--- a/locale/zh_CN/LC_MESSAGES/django.mo
+++ b/locale/zh_CN/LC_MESSAGES/django.mo
Binary files differ
diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po
index 9f15a3e7..160a3a64 100644
--- a/locale/zh_CN/LC_MESSAGES/django.po
+++ b/locale/zh_CN/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-07-05 12:30+0000\n"
+"POT-Creation-Date: 2009-07-09 15:42+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"
@@ -16,11 +16,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: settings.py:24
+#: settings.py:12
msgid "account/"
msgstr ""
-#: settings.py:24 django_authopenid/urls.py:9 django_authopenid/urls.py:11
+#: settings.py:12 django_authopenid/urls.py:9 django_authopenid/urls.py:11
msgid "signin/"
msgstr ""
@@ -104,7 +104,7 @@ msgstr ""
msgid "非法OpenID地址: %s"
msgstr ""
-#: django_authopenid/views.py:366
+#: django_authopenid/views.py:366 templates/index.html:78
msgid "Welcome"
msgstr "欢迎"
@@ -229,7 +229,7 @@ msgstr "用户收藏的问题"
msgid "Favorites - User Profile"
msgstr "收藏-用户资料"
-#: forum/user.py:60
+#: forum/user.py:60 templates/index.html:46
msgid "Votes"
msgstr "投票"
@@ -254,9 +254,176 @@ msgid "Preferences - User Profile"
msgstr "设置-用户资料"
#: templates/badges.html:5 templates/badges.html.py:16
+#: templates/header.html:31
msgid "Badges"
msgstr "奖牌榜"
+#: templates/base.html:53 templates/base_content.html:52
+msgid "Congratulations! You have new badges: "
+msgstr "恭喜您被授予奖牌:"
+
+#: templates/base.html:54 templates/base_content.html:53
+msgid "go to see"
+msgstr "查看"
+
+#: templates/base.html:55 templates/base_content.html:54
+#: templates/header.html:35
+msgid "Profile"
+msgstr "我的资料"
+
+#: templates/footer.html:5 templates/header.html:10 templates/index.html:81
+msgid "About us"
+msgstr "关于我们"
+
+#: templates/footer.html:6 templates/header.html:11
+msgid "faq"
+msgstr "常见问题"
+
+#: templates/footer.html:8
+msgid "Contact"
+msgstr "联系我们"
+
+#: templates/footer.html:9
+msgid "Privacy"
+msgstr "隐私政策"
+
+#: templates/footer.html:10
+msgid "Feedback"
+msgstr "用户反馈"
+
+#: templates/header.html:6 templates/logout.html:5 templates/logout.html.py:16
+msgid "Logout"
+msgstr "退出登录"
+
+#: templates/header.html:8
+msgid "Login"
+msgstr "登录"
+
+#: templates/header.html:21
+msgid "link to homepage"
+msgstr "返回首页"
+
+#: templates/header.html:27 templates/header.html.py:56
+#: templates/index.html:21
+msgid "Questions"
+msgstr "问题"
+
+#: templates/header.html:28 templates/header.html.py:57
+msgid "Tags"
+msgstr "标签"
+
+#: templates/header.html:29 templates/header.html.py:58
+msgid "Users"
+msgstr "用户"
+
+#: templates/header.html:30
+msgid "Books"
+msgstr "读书"
+
+#: templates/header.html:32
+msgid "Unanswered"
+msgstr "没有回答的问题"
+
+#: templates/header.html:38
+msgid "Ask a question"
+msgstr "我要提问"
+
+#: templates/header.html:53
+msgid "Search"
+msgstr "搜索"
+
+#: templates/index.html:6
+msgid "Home"
+msgstr "首页"
+
+#: templates/index.html:23
+msgid "Newest updated questions"
+msgstr "最新更新的问题"
+
+#: templates/index.html:23
+msgid "Newest"
+msgstr "最新问题"
+
+#: templates/index.html:24
+msgid "Questions with most answers"
+msgstr "被回复最多的问题"
+
+#: templates/index.html:24
+msgid "Hottest"
+msgstr "最热问题"
+
+#: templates/index.html:25
+msgid "Questions with most votes"
+msgstr "被投票最多的问题"
+
+#: templates/index.html:25
+msgid "Best"
+msgstr "最有价值问题"
+
+#: templates/index.html:26 templates/index.html.py:118
+msgid "All questions"
+msgstr "所有问题"
+
+#: templates/index.html:26
+msgid "All"
+msgstr "所有问题"
+
+#: templates/index.html:45
+msgid "Answers"
+msgstr "回答"
+
+#: templates/index.html:47
+msgid "Visits"
+msgstr "访问"
+
+#: templates/index.html:55
+msgid "Community wiki"
+msgstr "社区wiki"
+
+#: templates/index.html:67 templates/index.html.py:91
+msgid "Browse questions with tag of "
+msgstr "查看所有以下主题问题:"
+
+#: templates/index.html:87
+msgid "Recent tags"
+msgstr "最新标签"
+
+#: templates/index.html:94 templates/index.html.py:118
+msgid "Popular tags"
+msgstr "受欢迎的标签"
+
+#: templates/index.html:98
+msgid "Recent badges"
+msgstr "最新奖牌"
+
+#: templates/index.html:109
+msgid "All badges"
+msgstr "所有奖牌"
+
+#: templates/index.html:113
+msgid "RSS feed of recent 30 questions"
+msgstr "RSS订阅最新30个问题"
+
+#: templates/index.html:113
+msgid "Subscribe"
+msgstr "订阅最新问题"
+
+#: templates/index.html:118
+msgid "Are you looking for more questions? Try to browse"
+msgstr "在寻找更多问题吗?请查阅"
+
+#: templates/index.html:118
+msgid " or "
+msgstr " 或者 "
+
+#: templates/index.html:118
+msgid ". Please help us answer "
+msgstr "。请帮助我们回答"
+
+#: templates/index.html:118
+msgid "Unanswered questions"
+msgstr "没有回答的问题"
+
#: templates/authopenid/changeemail.html:10
msgid "Account: change email"
msgstr "修改电子邮件"
@@ -408,9 +575,6 @@ msgstr "删除您的帐号和所有内容"
#~ msgid "A new account"
#~ msgstr "新帐号"
-#~ msgid "Username"
-#~ msgstr "用户名"
-
#~ msgid "An exisiting account"
#~ msgstr "已经存在的帐号"
diff --git a/settings.py b/settings.py
index 50579cb9..985de51a 100644
--- a/settings.py
+++ b/settings.py
@@ -1,26 +1,22 @@
+# encoding:utf-8
# Django settings for lanai project.
import os.path
+#DEBUG SETTINGS
DEBUG = True
TEMPLATE_DEBUG = DEBUG
-
INTERNAL_IPS = ('127.0.0.1',)
-
#for OpenID auth
ugettext = lambda s: s
LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/'))
-#system will send admins email about error stacktrace if DEBUG=False
+#EMAIL AND ADMINS
ADMINS = (
('CNProg team', 'team@cnprog.com'),
)
MANAGERS = ADMINS
-DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
-DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
-
SERVER_EMAIL = 'webmaster@cnprog.com'
DEFAULT_FROM_EMAIL = 'webmaster@cnprog.com'
EMAIL_HOST_USER = ''
@@ -30,33 +26,21 @@ EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT='587'
EMAIL_USE_TLS=True
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
+#LOCALIZATIONS
TIME_ZONE = 'Asia/Chongqing Asia/Chungking'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-#LANGUAGE_CODE = 'en-us'
+# LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'zh-cn'
-
SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
USE_I18N = True
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
+#OTHER SETTINS
+APP_TITLE = u'CNProg.com 程序员问答社区'
+APP_URL = 'http://www.cnprog.com'
+APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客'
+APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。'
+APP_INTRO = u' <p>CNProg是一个<strong>面向程序员</strong>的可协作编辑的<strong>开放源代码问答社区</strong>。</p><p> 您可以在这里提问各类<strong>程序技术问题</strong> - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。</p>'
ADMIN_MEDIA_PREFIX = '/admin/media/'
-
-# Make this unique, and don't share it with anybody.
SECRET_KEY = '$oo^&_m&qwbib=(_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm'
-
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
@@ -73,12 +57,13 @@ MIDDLEWARE_CLASSES = (
'django.middleware.transaction.TransactionMiddleware',
#'django.middleware.sqlprint.SqlPrintingMiddleware',
'middleware.pagesize.QuestionsPageSizeMiddleware',
- 'debug_toolbar.middleware.DebugToolbarMiddleware',
+ #'debug_toolbar.middleware.DebugToolbarMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'django.core.context_processors.auth',
+ 'context.application_settings'
)
ROOT_URLCONF = 'urls'
@@ -87,6 +72,7 @@ TEMPLATE_DIRS = (
os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'),
)
+#UPLOAD SETTINGS
FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/')
FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler",
"django.core.files.uploadhandler.TemporaryFileUploadHandler",)
diff --git a/settings_local.py.dist b/settings_local.py.dist
index 96f28b4e..2c8f939d 100644
--- a/settings_local.py.dist
+++ b/settings_local.py.dist
@@ -6,6 +6,10 @@ LOG_FILENAME = '/Users/sailing/Development/cnprog_beta2/django.lanai.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,)
+#Database configuration
+DATABASE_ENGINE = 'mysql'
+DATABASE_HOST = ''
+DATABASE_PORT = ''
DATABASE_NAME = 'cnprog' # Or path to database file if using sqlite3.
DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
diff --git a/templates/base.html b/templates/base.html
index 3ed3b3f4..90b40612 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,8 +1,9 @@
{% load extra_filters %}
+{% load i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>{% block title %}{% endblock %} - CNProg.com 程序员问答社区</title>
+ <title>{% block title %}{% endblock %} - {{ APP_TITLE }}</title>
{% spaceless %}
{% block meta %}{% endblock %}
{% endspaceless %}
@@ -49,9 +50,9 @@
<body>
<div class="notify" style="display:none">
<span>{% if request.user.get_messages %}
- 恭喜您,社区给您颁发了奖牌:{% for message in request.user.get_messages %}
- <font class="darkred">{{ message }}</font>, {% endfor %}查看
- <a href="{{ request.user.get_profile_url }}">个人资料</a>{% endif %}</span>
+ {% trans "Congratulations! You have new badges: " %}{% for message in request.user.get_messages %}
+ <font class="darkred">{{ message }}</font>, {% endfor %}{% trans "go to see" %}
+ <a href="{{ request.user.get_profile_url }}">{% trans "Profile" %}</a>{% endif %}</span>
<a class="close-notify" onclick="notify.close(true)">&times;</a>
</div>
{% include "header.html" %}
diff --git a/templates/base_content.html b/templates/base_content.html
index 7fec09ed..6dec6cae 100644
--- a/templates/base_content.html
+++ b/templates/base_content.html
@@ -1,7 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+{% load i18n %}
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
- <title>{% block title %}{% endblock %} - CNProg.com 程序员问答社区</title>
+ <title>{% block title %}{% endblock %} - {{ APP_TITLE }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="verify-v1" content="55uGNnQVJW8p1bbXeF/Xbh9I7nZBM/wLhRz6N/I1kkA=" />
<link rel="shortcut icon" href="/content/images/favicon.ico" >
@@ -48,10 +49,10 @@
<body>
<div class="notify" style="display:none">
<span>{% if request.user.get_messages %}
- 恭喜您,社区给您颁发了奖牌:{% for message in request.user.get_messages %}
- <font class="darkred">{{ message }}</font>, {% endfor %}查看
- <a href="{{ request.user.get_profile_url }}">个人资料</a>{% endif %}</span>
- <a class="close-notify" onclick="notify.close(true)">&times;</a>
+ {% trans "Congratulations! You have new badges: " %}{% for message in request.user.get_messages %}
+ <font class="darkred">{{ message }}</font>, {% endfor %}{% trans "go to see" %}
+ <a href="{{ request.user.get_profile_url }}">{% trans "Profile" %}</a>{% endif %}</span>
+ <a class="close-notify" onclick="notify.close(true)">&times;</a>
</div>
{% include "header.html" %}
<div id="wrapper">
diff --git a/templates/footer.html b/templates/footer.html
index 2e3d6293..46649b9f 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -1,23 +1,21 @@
{% load extra_tags %}
-<!-- 页面底部开始: -->
+{% load i18n %}
<div id="ground">
<div class="footerLinks" >
- <a href="/about">关于本站</a><span class="link-separator"> |</span>
- <a href="/faq">常见问题</a><span class="link-separator"> |</span>
+ <a href="/about">{% trans "About us" %}</a><span class="link-separator"> |</span>
+ <a href="/faq">{% trans "faq" %}</a><span class="link-separator"> |</span>
<a href="http://blog.cnprog.com">Blog</a><span class="link-separator"> |</span>
- <a href="mailto:team@cnprog.com">联系我们</a><span class="link-separator"> |</span>
- <a href="/privacy">隐私政策</a><span class="link-separator"> |</span>
- <a href="http://cnprog.uservoice.com" target="_blank">问题反馈</a>
+ <a href="mailto:team@cnprog.com">{% trans "Contact" %}</a><span class="link-separator"> |</span>
+ <a href="/privacy">{% trans "Privacy" %}</a><span class="link-separator"> |</span>
+ <a href="http://cnprog.uservoice.com" target="_blank">{% trans "Feedback" %}</a>
</div>
<p style="margin-top:10px;">
<a href="http://code.google.com/p/cnprog/" target="_blank">
<img src="/content/images/djangomade124x25_grey.gif" border="0" alt="Made with Django." title="Made with Django." >
</a>
- <div style="font-size:90%;color:#333">当前版本: R-0120-20090406</div>
</p>
<p style="margin-top:-30px; margin-right:15px;" class="fright"><img src="/content/images/cc-wiki.png" title="Creative Commons: Attribution - Share Alike" alt="cc-wiki" width="50" height="68" /></p>
</div>
- <!-- 页面底部结束: -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
@@ -27,4 +25,4 @@
var pageTracker = _gat._getTracker("UA-248512-5");
pageTracker._trackPageview();
} catch(err) {}
- </script> \ No newline at end of file
+ </script>
diff --git a/templates/header.html b/templates/header.html
index b362a5e6..1da107b6 100644
--- a/templates/header.html
+++ b/templates/header.html
@@ -1,13 +1,14 @@
{% load extra_tags %}
+{% load i18n %}
<div id="top">
<div id="header">
{% if request.user.is_authenticated %}
- <a href="/users/{{ request.user.id }}/{{ request.user.username }}/">{{ request.user.username }}</a> {% get_score_badge request.user %} <a href="/logout/">退出登录</a>
+ <a href="/users/{{ request.user.id }}/{{ request.user.username }}/">{{ request.user.username }}</a> {% get_score_badge request.user %} <a href="/logout/">{% trans "Logout" %}</a>
{% else %}
- <a href="/account/signin">登录</a>
+ <a href="/account/signin">{% trans "Login" %}</a>
{% endif %}
- <a href="/about">关于本站</a>
- <a href="/faq">常见问题</a>
+ <a href="/about">{% trans "About us" %}</a>
+ <a href="/faq">{% trans "faq" %}</a>
</div>
</div>
<div id="roof">
@@ -17,24 +18,24 @@
<td width="23%">
<div id="logo">
<a href="/">
- <img src="/content/images/logo.png" title="回到首页" />
+ <img src="/content/images/logo.png" title="{% trans 'link to homepage'%}" />
</a>
</div>
</td>
<td width="77%" valign="bottom">
<div class="nav">
- <a id="nav_questions" href="/questions/" >问题</a>
- <a id="nav_tags" href="/tags/">标签</a>
- <a id="nav_users" href="/users/">用户</a>
- <a id="nav_books" href="/books/">读书</a>
- <a id="nav_badges" href="/badges/">奖牌榜</a>
- <a id="nav_unanswered" href="/questions/unanswered/">没有回答的问题</a>
+ <a id="nav_questions" href="/questions/" >{% trans "Questions" %}</a>
+ <a id="nav_tags" href="/tags/">{% trans "Tags" %}</a>
+ <a id="nav_users" href="/users/">{% trans "Users" %}</a>
+ <a id="nav_books" href="/books/">{% trans "Books" %}</a>
+ <a id="nav_badges" href="/badges/">{% trans "Badges" %}</a>
+ <a id="nav_unanswered" href="/questions/unanswered/">{% trans "Unanswered" %}</a>
{% if request.user.is_authenticated %}
- <a id="nav_profile" href="/users/{{ request.user.id }}/{{ request.user.username }}/">我的资料</a>
+ <a id="nav_profile" href="/users/{{ request.user.id }}/{{ request.user.username }}/">{% trans "Profile" %}</a>
{% endif %}
<div class="focus">
- <a id="nav_ask" href="/questions/ask/" class="special">我要提问</a>
+ <a id="nav_ask" href="/questions/ask/" class="special">{% trans "Ask a question" %}</a>
</div>
</div>
@@ -49,16 +50,16 @@
<form action="/search/" method="GET">
<div>
<input type="text" class="searchInput" value="{{ keywords }}" name="q" id="keywords" >
- <input type="submit" name="Submit" value="搜索" class="searchBtn" >
+ <input type="submit" name="Submit" value="{% trans 'Search' %}" class="searchBtn" >
</div>
<div class="options">
- <input id="type-question" type="radio" class="" value="question" name="t" checked >问题
- <input id="type-tag" type="radio" class="" value="tag" name="t" >标签
- <input id="type-user" type="radio" class="" value="user" name="t" >用户
+ <input id="type-question" type="radio" class="" value="question" name="t" checked >{% trans "Questions" %}
+ <input id="type-tag" type="radio" class="" value="tag" name="t" >{% trans "Tags" %}
+ <input id="type-user" type="radio" class="" value="user" name="t" >{% trans "Users" %}
</div>
</form>
</td>
</tr>
</table>
</div>
- </div> \ No newline at end of file
+ </div>
diff --git a/templates/index.html b/templates/index.html
index bc159ca9..ba3e2229 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -2,9 +2,10 @@
{% load extra_tags %}
{% load humanize %}
{% load extra_filters %}
-{% block title %}{% spaceless %}首页{% endspaceless %}{% endblock %}
-{% block meta %}<meta name="keywords" content="技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客" />
- <meta name="description" content="中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。" />{% endblock %}
+{% load i18n %}
+{% block title %}{% spaceless %}{% trans "Home" %}{% endspaceless %}{% endblock %}
+{% block meta %}<meta name="keywords" content="{{ APP_KEYWORDS }}" />
+ <meta name="description" content="{{ APP_DESCRIPTION }}" />{% endblock %}
{% block forejs %}
<script type="text/javascript">
$().ready(function(){
@@ -17,15 +18,14 @@
{% endblock %}
{% block content %}
<div class="tabBar">
- <div class="headQuestions">问题列表</div>
+ <div class="headQuestions">{% trans "Questions" %}</div>
<div class="tabsA">
- <a id="latest" href="?sort=latest" title="最新更新的问题" >最新问题</a>
- <a id="hottest" href="?sort=hottest" title="被回复最多的问题" >热门问题</a>
- <a id="mostvoted" href="?sort=mostvoted" title="投票次数最多的问题" >最有价值的问题</a>
- <a id="all" href="/questions/" title="所有问题" >全部问题</a>
+ <a id="latest" href="?sort=latest" title="{% trans 'Newest updated questions' %}" >{% trans "Newest" %}</a>
+ <a id="hottest" href="?sort=hottest" title="{% trans 'Questions with most answers' %}" >{% trans "Hottest" %}</a>
+ <a id="mostvoted" href="?sort=mostvoted" title="{% trans 'Questions with most votes' %}" >{% trans "Best" %}</a>
+ <a id="all" href="/questions/" title="{% trans 'All questions' %}" >{% trans "All" %}</a>
</div>
</div>
-<!-- 问题列表 -->
<div id="listA">
{% for question in questions %}
<div class="qstA">
@@ -42,9 +42,9 @@
<td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td>
</tr>
<tr>
- <td><span class="unit">回答</span></td>
- <td><span class="unit">票数</span></td>
- <td><span class="unit">浏览</span></td>
+ <td><span class="unit">{% trans "Answers" %}</span></td>
+ <td><span class="unit">{% trans "Votes" %}</span></td>
+ <td><span class="unit">{% trans "Visits" %}</span></td>
</tr>
</table>
</div>
@@ -52,7 +52,7 @@
{{ question.summary }}...
</div>
{% if question.wiki %}
- <span class="from wiki">社区Wiki</span>
+ <span class="from wiki">{% trans "Community wiki" %}</span>
<span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
{% else %}
<div class="from">
@@ -64,7 +64,7 @@
{% endif %}
<div class="tags">
{% for tag in question.tagname_list %}
- <a href="{% url forum.views.tag tag|urlencode %}" title="查看有关'{{ tag }}'的问题" rel="tag">{{ tag }}</a>
+ <a href="{% url forum.views.tag tag|urlencode %}" title="{% trans 'Browse questions with tag of ' %}'{{ tag }}'" rel="tag">{{ tag }}</a>
{% endfor %}
</div>
</div>
@@ -75,47 +75,46 @@
{% block sidebar %}
{% if not request.user.is_authenticated %}
<div class="boxA">
- <h3>CNProg欢迎您!</h3>
+ <h3>{% trans "Welcome" %}</h3>
<div class="body">
- <p>CNProg是一个<strong>面向程序员</strong>的可协作编辑的<strong>开放源代码问答社区</strong>。</p>
- <p> 您可以在这里提问各类<strong>程序技术问题</strong> - 问题不分语言和平台。 同时也希望您对力所能及的问题,给予您的宝贵答案。</p>
- <div class="more"><a href="/about">关于本站 »</a></div>
+ {{ APP_INTRO|safe }}
+ <div class="more"><a href="/about">{% trans "About us" %} »</a></div>
<div class="more"><a href="/faq">FAQ »</a></div>
</div>
</div>
{% endif %}
<div class="boxB">
- <h3>最新标签</h3>
+ <h3>{% trans "Recent tags" %}</h3>
<div class="body">
<p class="tagsbox">
{% for tag in tags %}
- <a rel="tag" title="查看有关'{{ tag.name }}'的问题" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
+ <a rel="tag" title="{% trans 'Browse questions with tag of ' %}'{{ tag.name }}'" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
{% endfor %}
</p>
- <div class="more"><a href="/tags">受欢迎的标签 »</a> </div>
+ <div class="more"><a href="/tags">{% trans "Popular tags" %} »</a> </div>
</div>
</div>
<div class="boxB">
- <h3>最新奖牌</h3>
+ <h3>{% trans "Recent badges" %}</h3>
<div class="body">
<ul class="badge-list">
{% for award in awards %}
<li>
<a href="/badges/{{award.badge_id}}/{{award.badge_name}}" title="{{ award.badge_description }}" class="medal">
- <span class="badge{{ award.badge_type }}">&#9679;</span>&nbsp;{{ award.badge_name }}</a> 授予
+ <span class="badge{{ award.badge_type }}">&#9679;</span>&nbsp;{{ award.badge_name }}</a>
<a href="/users/{{award.user_id}}/{{award.user_name}}">{{ award.user_name }}</a>
</li>
{% endfor %}
</ul>
- <div class="more"><a href="/badges/">所有奖牌 »</a> </div>
+ <div class="more"><a href="/badges/">{% trans "All badges" %} »</a> </div>
</div>
</div>
<div id="feeds">
-<a href="/feeds/rss" title="RSS订阅最新30个问题">订阅最新问题</a>
+<a href="/feeds/rss" title="{% trans 'RSS feed of recent 30 questions' %}">{% trans "Subscribe" %}</a>
</div>
{% endblock %}
{% block tail %}
<div style="padding:5px 0 5px 5px;">
-<span class="evenMore">在寻找更多问题吗?请查阅 <a href="/questions/">全部问题列表</a>,或者 <a href="/tags/">受欢迎的标签</a>。请帮助我们回答 <a href="/questions/unanswered">没有回答的问题</a>。</span>
+<span class="evenMore">{% trans "Are you looking for more questions? Try to browse" %} <a href="/questions/">{% trans "All questions" %}</a>{% trans " or "%} <a href="/tags/">{% trans "Popular tags" %}</a>{% trans ". Please help us answer "%}<a href="/questions/unanswered">{% trans "Unanswered questions" %}</a></span>
</div>
-{% endblock %} \ No newline at end of file
+{% endblock %}
diff --git a/templates/logout.html b/templates/logout.html
index b414d8d8..48a2deaf 100644
--- a/templates/logout.html
+++ b/templates/logout.html
@@ -1,7 +1,8 @@
{% extends "base_content.html" %}
{% load extra_tags %}
{% load humanize %}
-{% block title %}{% spaceless %}退出登录{% endspaceless %}{% endblock %}
+{% load i18n %}
+{% block title %}{% spaceless %}{% trans "Logout" %}{% endspaceless %}{% endblock %}
{% block forejs %}
<script type="text/javascript">
$().ready(function(){
@@ -12,12 +13,10 @@
{% endblock %}
{% block content %}
<div class="headNormal">
- 退出登录
+ {% trans "Logout" %}
</div>
<div id="main-body" style="width:100%">
- <p> 您是系统的<strong class="darkred">注册</strong>用户,可以随时使用OpenID帐号登录系统或者注销登录。 </p>
-
- <input id="btLogout" type="button" class="submit" value="点击退出登录" style="width:150px">
+ <input id="btLogout" type="button" class="submit" value="OK" style="width:150px">
<br><br>
</div>
{% endblock %}