Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完成模板概述章节的翻译. #11

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1a6e96d
translate some intro/overview.txt
pylemon Jun 6, 2012
253d834
translate some content in intro/overview.txt
pylemon Jun 7, 2012
24db986
add some trans
pylemon Jun 7, 2012
8a81667
add some trans in intro/overview.txt
pylemon Jun 8, 2012
e5d2971
change readme
pylemon Jun 13, 2012
ef0ecd7
add disqus
pylemon Jun 15, 2012
ba30b43
try to fix disaus
pylemon Jun 15, 2012
7217c08
fixes layout add comment
pylemon Jun 15, 2012
09571b8
translated intro
pylemon Jul 11, 2012
6a752d0
start to translate tutorial01
pylemon Jul 12, 2012
046e85f
translate some tutorial01
pylemon Jul 15, 2012
b916632
Merge pull request #6 from pylemon/master
wrongwaycn Jun 4, 2012
17d96ba
Merge remote-tracking branch 'djangodoc/master'
pylemon Aug 10, 2012
fa011eb
Merge remote-tracking branch 'origin/master'
pylemon Aug 10, 2012
9ec2d26
change filename of tutorial02
pylemon Aug 10, 2012
7e5c20a
Update docs/intro/tutorial03.txt
xiayh Nov 25, 2012
ca58134
Update docs/intro/tutorial03.txt
Jan 14, 2013
ef47d61
Update docs/intro/tutorial03.txt
Jan 14, 2013
c3567e3
对表单概述进行翻译
raywuxing Feb 18, 2013
95173cd
modelforms翻译进度40%
raywuxing Feb 19, 2013
4832c3b
翻译“使用已存在数据库”文档
raywuxing Feb 24, 2013
04aa37b
翻译“模型表单”
raywuxing Feb 24, 2013
7c30dc0
简单翻译一些文档
raywuxing Feb 24, 2013
d4c3862
校对 docs/topics/forms/modelforms.txt 文档的restructured text格式.
tkliuxing Mar 6, 2013
3eab736
Merge commit 'ef47d61e5d75d6438fbae1b1fa7237dfc8d225a1'
tkliuxing Mar 6, 2013
e649b28
校对 docs/intro/tutorial03.txt 文档的 restructured text 格式.
tkliuxing Mar 6, 2013
681ca85
翻译 docs/topics/templates.txt 文档 并在README中增加翻译人员列表.
tkliuxing Mar 6, 2013
29ac283
修正README格式
tkliuxing Mar 6, 2013
2d41b3f
校对 docs/intro/tutorial02.txt 文档的 restructured text 格式.
tkliuxing Mar 7, 2013
deb5fec
翻译 docs/topics/templates.txt 文档
tkliuxing Mar 7, 2013
ab3ec42
校对 howto/initial-data.txt howto/legacy-databases.txt 格式.
tkliuxing Mar 7, 2013
27c6413
翻译 howto/deployment/index.txt 文档
tkliuxing Mar 7, 2013
b6f647c
校对 intro/overview.txt topics/settings.txt 格式.
tkliuxing Mar 7, 2013
b1e4dac
更新index 和 README
tkliuxing Mar 7, 2013
daab473
翻译 docs/topics/templates.txt 文档 30%
tkliuxing Mar 8, 2013
2c710dc
翻译 topics/templates.txt 文档的 模板继承章节.
tkliuxing Mar 11, 2013
ad4e503
翻译 topics/templates.txt 文档的 自动HTML转义 章节. 70%
tkliuxing Mar 13, 2013
0a0e355
修改readme中翻译进度.
tkliuxing Mar 13, 2013
a9ddff5
完成翻译 topics/templates.txt 文档. 100%
tkliuxing Mar 14, 2013
8595fc1
tutorial03中文翻译第一次提交
Mar 25, 2013
1f456a8
tutorial03.txt翻译初稿完成
bigpear0201 Mar 27, 2013
4c104c0
翻译了部分的内置模板标签文档.
tkliuxing Apr 1, 2013
1a8caf5
Merge commit '1f456a823f671b6312f4fb0b9974efb66a73d644'
tkliuxing Apr 1, 2013
7412601
校对 tutorial
tkliuxing Apr 1, 2013
a4ce7c3
校对 tutorial03
tkliuxing Apr 1, 2013
d1814c6
校对 tutorial03
tkliuxing Apr 1, 2013
fe6dc82
完成数据库优化文档的翻译,22%http/middleware文档的翻译
the5fire May 4, 2013
68bcf34
完成topics/http/middleware部分的翻译
the5fire May 15, 2013
f290f90
完成ref/middleware的翻译
the5fire May 16, 2013
746eee7
完成topic/class-based-views的翻译,中英共存
the5fire May 18, 2013
2563b0a
修正一些不恰当的中文翻译,去掉英文内容。
the5fire May 18, 2013
e196d20
Merge commit '2563b0ab59c9ec965d12be752cee01b7c1b53d8d'
tkliuxing Jun 17, 2013
d5ee02e
校对settings与middleware
tkliuxing Apr 9, 2014
22ed962
校对 /topics/forms/index.txt /topics/forms/modelforms.txt
tkliuxing Apr 17, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

docs/topics/.DS_Store
40 changes: 30 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,47 @@ https://github.com/wrongwaycn/Django-Chinese-Docs
http://readthedocs.org/docs/django-document-cn/en/latest/


翻译人员 (排名不分先后)
========================

* Wrongway_
* pylemon_
* congmo_
* `Chaney Lee`_
* Ray_
* `Ronald Bai`_
* the5fire_

.. _Wrongway: https://github.com/wrongwaycn
.. _pylemon: https://github.com/pylemon
.. _congmo: https://github.com/congmo
.. _`Chaney Lee`: https://github.com/chaneylee
.. _Ray: https://github.com/raywuxing
.. _`Ronald Bai`: https://github.com/tkliuxing
.. _the5fire: https://github.com/the5fire


翻译进度
========

已完成和正在进行中的文档::

[ 100%] [ 3378] ./intro/install.txt
[ 100%] [ 3378] ./intro/install.txt
[ 100%] [ 1014] ./howto/deployment/index.txt
[ 100%] [ 9919] ./ref/models/options.txt
[ 50%] [ 66276] ./ref/settings.txt
[ 100%] [ 24519] ./topics/email.txt
[ 100%] [ 2871] ./topics/i18n/index.txt
[ 100%] [ 8127] ./topics/settings.txt
[ 30%] [ 50383] ./topics/db/models.txt
[ 100%] [ 3378] ./intro/tutorial02.txt
[ 100%] [ 23597] ./topics/templates.txt
[ 10%] [ 28834] ./intro/tutorial01.txt
[ 100%] [ 3378] ./intro/tutorial02.txt
[ 10%] [ 21449] ./intro/tutorial03.txt
[ 100%] [ 11287] ./topics/db/optimization.txt
[ 100%] [ 9677] ./topics/http/middleware.txt
[ 100%] [ 7588] ./ref/middleware.txt
[ 100%] [ 23873] ./topics/class-based-views.txt

未完成的文档::

Expand All @@ -50,7 +78,6 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 32601] ./howto/custom-model-fields.txt
[ 0%] [ 46313] ./howto/custom-template-tags.txt
[ 0%] [ 16721] ./howto/deployment/fastcgi.txt
[ 0%] [ 1014] ./howto/deployment/index.txt
[ 0%] [ 17409] ./howto/deployment/modpython.txt
[ 0%] [ 2268] ./howto/deployment/wsgi/gunicorn.txt
[ 0%] [ 2678] ./howto/deployment/wsgi/index.txt
Expand Down Expand Up @@ -84,8 +111,6 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 10303] ./internals/svn.txt
[ 0%] [ 1313] ./intro/index.txt
[ 0%] [ 11967] ./intro/overview.txt
[ 0%] [ 28834] ./intro/tutorial01.txt
[ 0%] [ 21449] ./intro/tutorial03.txt
[ 0%] [ 14605] ./intro/tutorial04.txt
[ 0%] [ 9417] ./intro/whatsnext.txt
[ 0%] [ 8133] ./misc/api-stability.txt
Expand Down Expand Up @@ -160,7 +185,6 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 16508] ./ref/forms/widgets.txt
[ 0%] [ 42813] ./ref/generic-views.txt
[ 0%] [ 452] ./ref/index.txt
[ 0%] [ 7588] ./ref/middleware.txt
[ 0%] [ 42115] ./ref/models/fields.txt
[ 0%] [ 191] ./ref/models/index.txt
[ 0%] [ 24176] ./ref/models/instances.txt
Expand Down Expand Up @@ -213,7 +237,6 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 1433] ./releases/index.txt
[ 0%] [ 74962] ./topics/auth.txt
[ 0%] [ 47276] ./topics/cache.txt
[ 0%] [ 23873] ./topics/class-based-views.txt
[ 0%] [ 8576] ./topics/conditional-view-processing.txt
[ 0%] [ 17384] ./topics/db/aggregation.txt
[ 0%] [ 199] ./topics/db/examples/index.txt
Expand All @@ -223,7 +246,6 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 425] ./topics/db/index.txt
[ 0%] [ 16414] ./topics/db/managers.txt
[ 0%] [ 23259] ./topics/db/multi-db.txt
[ 0%] [ 11287] ./topics/db/optimization.txt
[ 0%] [ 50471] ./topics/db/queries.txt
[ 0%] [ 11418] ./topics/db/sql.txt
[ 0%] [ 2755] ./topics/db/tablespaces.txt
Expand All @@ -239,7 +261,6 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 15646] ./topics/http/file-uploads.txt
[ 0%] [ 74] ./topics/http/generic-views.txt
[ 0%] [ 233] ./topics/http/index.txt
[ 0%] [ 9677] ./topics/http/middleware.txt
[ 0%] [ 21526] ./topics/http/sessions.txt
[ 0%] [ 9218] ./topics/http/shortcuts.txt
[ 0%] [ 38520] ./topics/http/urls.txt
Expand All @@ -255,5 +276,4 @@ http://readthedocs.org/docs/django-document-cn/en/latest/
[ 0%] [ 15867] ./topics/serialization.txt
[ 0%] [ 9676] ./topics/signals.txt
[ 0%] [ 5348] ./topics/signing.txt
[ 0%] [ 23597] ./topics/templates.txt
[ 0%] [ 87788] ./topics/testing.txt
25 changes: 24 additions & 1 deletion docs/_theme/djangodocs/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,27 @@ <h3>You are here:</h3>
{% block relbar2 %}{% endblock %}
{% block sidebar1 %}{% endblock %}
{% block sidebar2 %}{% endblock %}
{% block footer %}{% endblock %}
{% block footer %}
<!-- for Disqus actions -->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'djangodoc'; // required: replace example with your forum shortname
var disqus_identifier = "{{ pagename }}";
//var disqus_url = "http://readthedocs.org/docs/chaos2sae/en/latest/{{ pagename }}{{ file_suffix }}";

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>

<!-- comment utility -->
<link rel="stylesheet" href="{{ pathto('_theme/djangodocs/static/comment.css', 1) }}" type="text/css" />
<script type="text/javascript" src="{{ pathto('_theme/djangodocs/static/comment.js', 1) }}"></script>

{% endblock %}
19 changes: 19 additions & 0 deletions docs/_theme/djangodocs/static/comment.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
div.comment {
position:absolute;
left: -9999px;
top: -9999px;
}
div.comment a.email_link {
display: block;
width: 16px;
height: 16px;
cursor: pointer;
color: white;
text-decoration:none;
background: transparent url(./comment_white_yellow.gif) no-repeat -16px 0;
}

div.comment a.email_link:hover{
background-position:0 0;
}

48 changes: 48 additions & 0 deletions docs/_theme/djangodocs/static/comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
110414 lizziesky:
仅包含 生成 comments 小icon, 且点击icon 跳转到groups的逻辑,
- 优化了DOM结构,
- 去除了 window.resize 事件
- 去除 仿google code 文档的侧栏切换
*/
DESELEMENT = "h1,h2,h3,h4,.highlight-python,.figure";//"h1,h2,h3,h4,ul,div.section p,div.highlight-python";

function clean_tag(st){
return st.replace(/<[^>]+>?[^<]*>/g, '');
}

$(document).ready(function(){
$("div.body > div.section").find(DESELEMENT).each(function() {
if (!$(this).prev("div.comment").length) {
var cmt = $('<div class="comment"><a class="email_link" title="点击提交Issue,反馈你的意见..."></a></div>');
$(this).before(cmt);
cmt.offset({
left: $(this).parents('.section').offset().left - 20,
top: $(this).offset().top
});
}
});

$("a.email_link").hover(function(){
if ($(this).attr("href") == null||$(this).attr("href") == '') {
var sub = $("div.documentwrapper div.body div.section:first h1").html();
var body = $(this).parent("div.comment").next().html();
// collection doc info from DOCUMENTATION_OPTIONS
sub = clean_tag(sub)+' version: '+DOCUMENTATION_OPTIONS.VERSION+' updated: '+DOCUMENTATION_OPTIONS.UPDATED;

body = clean_tag(body);
if (body.length>100) {
body = body.substring(0, 100)+"...";
}
//091117:Zoomq change comment aim
//$(this).attr("href", "https://groups.google.com/group/obp-comment/post?hl=zh-CN&subject="+encodeURIComponent(sub)+"&body="+encodeURIComponent(body));
//$(this).attr("href", "https://bitbucket.org/ZoomQuiet/obp.rwiwpyzh/issues/new");
//$(this).attr("href", "http://code.google.com/p/openbookproject/issues/entry?template=User%20defect%20report&summary={RWIwPy}"+encodeURIComponent(sub)+"+"+encodeURIComponent(body));
$(this).attr("href"
, "https://github.com/wrongwaycn/Django-Chinese-Docs/issues/new?title={Django-Chinese-Docs}"+encodeURIComponent(sub));
$(this).attr("target", "_blank");
}
}, function(){
});

});
21 changes: 9 additions & 12 deletions docs/howto/deployment/index.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
Deploying Django
部署 Django
================

Django's chock-full of shortcuts to make Web developer's lives easier, but all
those tools are of no use if you can't easily deploy your sites. Since Django's
inception, ease of deployment has been a major goal. There's a number of good
ways to easily deploy Django:
所有Django的这一切,使得Web开发者更易于开发. 但是在没有部署你的网站之前, 这些都是无意义的.
这儿有一些好的方法, 能让你轻松地部署Django应用:

.. toctree::
:maxdepth: 1
Expand All @@ -13,15 +11,14 @@ ways to easily deploy Django:
fastcgi
mod_python (deprecated) <modpython>

If you're new to deploying Django and/or Python, we'd recommend you try
:doc:`mod_wsgi </howto/deployment/wsgi/modwsgi>` first. In most cases it'll be
the easiest, fastest, and most stable deployment choice.
如果你是部署Django或Python的新手, 我们建议你先尝试
:doc:`mod_wsgi </howto/deployment/wsgi/modwsgi>` .
在大多数情况下, 这将是最简单, 最快, 最稳定的部署方案.

.. seealso::

* `Chapter 12 of the Django Book (second edition)`_ discusses deployment
and especially scaling in more detail. However, note that this edition
was written against Django version 1.1 and has not been updated since
:doc:`mod_python </howto/deployment/modpython>` was deprecated.
* `Chapter 12 of the Django Book (second edition)`_ 讨论了部署, 特别是缩放的更多细节。
但是请注意, 这个版本是为Django1.1版编写的, 并没有被更新, 因为
:doc:`mod_python </howto/deployment/modpython>` 被废弃.

.. _chapter 12 of the django book (second edition): http://djangobook.com/en/2.0/chapter12/
20 changes: 8 additions & 12 deletions docs/howto/initial-data.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
=================================
Providing initial data for models
=================================
====================
为模型提供初始化数据
====================

It's sometimes useful to pre-populate your database with hard-coded data when
you're first setting up an app. There's a couple of ways you can have Django
automatically create this data: you can provide `initial data via fixtures`_, or
you can provide `initial data as SQL`_.
有时你可能会硬编码一些数据来对程序进行初始化。有几种方法来自动构造这些数据:你可以提供 `initial data via fixtures`_ 或提供 `initial data as SQL`_。

In general, using a fixture is a cleaner method since it's database-agnostic,
but initial SQL is also quite a bit more flexible.
一般情况下,使用fixture是一种与数据库无关的干净方法。但使用初始化SQL就更有可扩展性。

.. _initial data as sql: `providing initial sql data`_
.. _initial data via fixtures: `providing initial data with fixtures`_
.. _initial data via fixtures: `使用fixture提供初始化数据`_

.. _initial-data-via-fixtures:

Providing initial data with fixtures
====================================
使用fixture提供初始化数据
=========================

A fixture is a collection of data that Django knows how to import into a
database. The most straightforward way of creating a fixture if you've already
Expand Down
59 changes: 22 additions & 37 deletions docs/howto/legacy-databases.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
=========================================
Integrating Django with a legacy database
=========================================
===========================
在Django中使用已有的数据库
===========================

While Django is best suited for developing new applications, it's quite
possible to integrate it into legacy databases. Django includes a couple of
utilities to automate as much of this process as possible.
虽然Django很适合用来开发新的应用程序,但也有可能从已有数据库开发。
Django包含一些工具,让你把这个这个自动化过程变得可能。

This document assumes you know the Django basics, as covered in the
:doc:`tutorial </intro/tutorial01>`.
这篇文档假定你已经对Django有所了解,你可以从这里看到基础。 :doc:`tutorial </intro/tutorial01>`

Once you've got Django set up, you'll follow this general process to integrate
with an existing database.
当你已经配置好了Django,你可以按以下的步骤来和已有的数据库工作。

Give Django your database parameters
====================================
把数据库参数告诉Django
=======================

You'll need to tell Django what your database connection parameters are, and
what the name of the database is. Do that by editing the :setting:`DATABASES`
setting and assigning values to the following keys for the ``'default'``
connection:
你需要告诉Django你的数据库连接参数和数据库的名称。你可以编辑 :setting:`DATABASES` 配置,编辑一下的键:

* :setting:`NAME`
* :setting:`ENGINE`
Expand All @@ -27,40 +21,31 @@ connection:
* :setting:`HOST`
* :setting:`PORT`

Auto-generate the models
========================
自动生成模型
============

.. highlight:: bash

Django comes with a utility called :djadmin:`inspectdb` that can create models
by introspecting an existing database. You can view the output by running this
command::
Django有一个叫 :djadmin:`inspectdb` 的工具来从已存在的数据库来生成模型。你可以运行这个命令看看输出::

python manage.py inspectdb

Save this as a file by using standard Unix output redirection::
你可以用以下的Unix输出命令来保存为文件::

python manage.py inspectdb > models.py

This feature is meant as a shortcut, not as definitive model generation. See the
:djadmin:`documentation of inspectdb <inspectdb>` for more information.
这功能像是个捷径,并不是生成模型定义。参照:djadmin:`documentation of inspectdb <inspectdb>` 获取更多信息。

Once you've cleaned up your models, name the file ``models.py`` and put it in
the Python package that holds your app. Then add the app to your
:setting:`INSTALLED_APPS` setting.
当你清理好你的模型,命名文件为 ``models.py`` ,然后放到你的程序的Python包中。然后添加到:setting:`INSTALLED_APPS` 配置里。

Install the core Django tables
==============================
安装核心Django表
=================

Next, run the :djadmin:`syncdb` command to install any extra needed database
records such as admin permissions and content types::
然后,以管理员权限运行 :djadmin:`syncdb` 命令来安装必要的数据库::

python manage.py syncdb

Test and tweak
==============
测试及调整
==========

Those are the basic steps -- from here you'll want to tweak the models Django
generated until they work the way you'd like. Try accessing your data via the
Django database API, and try editing objects via Django's admin site, and edit
the models file accordingly.
以上的都是基本步骤,但你可能需要调整你生成的模型。用Django的数据库API来测试插入数据,以及在Django管理员网站里编辑数据。然后再来调整模型文件。
Loading