old_taoist
|
2.0/chapter19/#76 |
2009-11-23 14:45:34
|
下面这个例子等同前面一种
|
|
15325@qq.com
|
2.0/chapter07/#416 |
2009-11-23 14:42:47
|
改变字段显示
|
|
zjm1126
|
2.0/chapter12/#7 |
2009-11-23 14:41:56
|
如果你一直跟着我们的例子做,你可能正在用<literal>runserver</literal> |
|
15325@qq.com
|
2.0/chapter07/#414 |
2009-11-23 14:41:50
|
(根据服务器的设置,当<literal>send_mail()</literal>被调用时,你将得到一个错误提示。而这是另一个问题。)
|
|
old_taoist
|
2.0/chapter19/#71 |
2009-11-23 14:39:32
|
显然,你也可以不使用别名来编码。
|
|
old_taoist
|
2.0/chapter19/#68 |
2009-11-23 14:38:18
|
被标记为待翻译字符串:
|
|
old_taoist
|
2.0/chapter19/#67 |
2009-11-23 14:37:46
|
在下面这个例子中,文本 <literal>"Welcome to my site"</literal> |
|
old_taoist
|
2.0/chapter19/#65 |
2009-11-23 14:36:44
|
使用函数 <literal>ugettext()</literal> 来指定一个翻译字符串。 作为惯例,使用短别名 <literal>_</literal> 来引入这个函数以节省键入时间.
|
|
15325@qq.com
|
2.0/chapter07/#413 |
2009-11-23 14:36:17
|
装载表单,先留空所有字段提交空表单;继而填写一个错误的邮箱地址再尝试提交表单;最后再用正确数据提交表单。
|
|
old_taoist
|
2.0/chapter19/#65 |
2009-11-23 14:35:54
|
使用函数 <literal>ugettext()</literal> 来指定一个翻译字符串。 作为惯例使用短别名, <literal>_</literal> , 来引入这个函数以节省键入时间.
|
|
old_taoist
|
2.0/chapter19/#65 |
2009-11-23 14:35:19
|
使用函数 <literal>ugettext()</literal> 来指定一个翻译字符串。 作为惯例,使用短别名, <literal>_</literal> , 来输入这个函数来节省键入时间.
|
|
old_taoist
|
2.0/chapter19/#65 |
2009-11-23 14:34:27
|
使用函数 <literal>ugettext()</literal> 来指定一个翻译字符串。 作为惯例使用短别名, <literal>_</literal> , 输入这个函数来节省键入时间.
|
|
15325@qq.com
|
2.0/chapter07/#412 |
2009-11-23 14:31:43
|
尝试在本地运行。
|
|
15325@qq.com
|
2.0/chapter07/#410 |
2009-11-23 14:30:58
|
Django的forms框架处理HTML显示、数据校验、数据清理和表单错误重现。
|
|
zjm1126
|
2.0/chapter12/#5 |
2009-11-23 14:28:05
|
在服务器上部署它
|
|
15325@qq.com
|
2.0/chapter07/#409 |
2009-11-23 14:27:38
|
看看,我们能移除这么多不整齐的代码!
|
|
zjm1126
|
2.0/chapter12/#4 |
2009-11-23 14:26:58
|
本章包含创建一个django程序最必不可少的步骤
|
|
15325@qq.com
|
2.0/chapter07/#406 |
2009-11-23 14:26:25
|
一下示例说明了我们如何用forms框架重写<literal>contact()</literal>:
|
note that "how" should be "show"
|
old_taoist
|
2.0/chapter19/#63 |
2009-11-23 14:25:54
|
标准翻译
|
|
15325@qq.com
|
2.0/chapter07/#405 |
2009-11-23 14:24:15
|
在学习了关于<literal>Form</literal>类的基本知识后,你会看到我们如何把它用到视图中,取代<literal>contact()</literal>代码中不整齐的部分。
|
|
15325@qq.com
|
2.0/chapter07/#405 |
2009-11-23 14:23:58
|
在学习了关于<literal>Form</literal>类的基本知识后,你将可以看到我们如何把它用到试图中,取代<literal>contact()</literal>代码中不整齐的部分。
|
|
old_taoist
|
2.0/chapter19/#59 |
2009-11-23 14:23:34
|
标记出这些翻译字符串是您的责任;系统仅能翻译出它所知道的东西。
|
|
old_taoist
|
2.0/chapter19/#58 |
2009-11-23 14:21:45
|
这些字符串能够出现在您的Python代码和模板中。
|
|
15325@qq.com
|
2.0/chapter07/#403 |
2009-11-23 14:20:24
|
在视图中使用Form对象
|
|
15325@qq.com
|
2.0/chapter07/#403 |
2009-11-23 14:20:12
|
在视图中使用Form
|
|
old_taoist
|
2.0/chapter19/#47 |
2009-11-23 14:17:18
|
第一步:在你的python代码和模板中嵌入待翻译的字符串。
|
|
old_taoist
|
2.0/chapter19/#55 |
2009-11-23 14:16:32
|
1、如何指定待翻译字符串
|
|
old_taoist
|
2.0/chapter19/#51 |
2009-11-23 14:15:12
|
第三步:在你的django settings文件中激活做要地区的中间件
|
|
old_taoist
|
2.0/chapter19/#49 |
2009-11-23 14:14:04
|
第二步:把那些字符串翻译成你要支持的语言
|
|
old_taoist
|
2.0/chapter19/#47 |
2009-11-23 14:11:30
|
第一步:在你的python代码和模板中嵌入需要翻译的字符串。
|
|
old_taoist
|
2.0/chapter19/#47 |
2009-11-23 14:10:22
|
第一步:在你的python代码和模板中嵌入需要翻译的字符串。
|
|
old_taoist
|
2.0/chapter19/#45 |
2009-11-23 14:09:33
|
对你的Django应用进行国际化的三个步骤:
|
|
old_taoist
|
2.0/chapter19/#45 |
2009-11-23 14:08:04
|
使你的Django应用国际化的三个步骤:
|
|
old_taoist
|
2.0/chapter19/#39 |
2009-11-23 14:05:05
|
Django的国际化钩子是默认开启的,这可能会给Django的运行增加一点点开销。
|
|
old_taoist
|
2.0/chapter19/#35 |
2009-11-23 14:03:01
|
Django的翻译机制是使用 GNU <literal>gettext</literal> (<reference name="http://www.gnu.org/software/gettext/" refuri="http://www.gnu.org/software/gettext/">http://www.gnu.org/software/gettext/</reference>),具体为Python自带的标准模块 <literal>gettext</literal> 。
|
|
old_taoist
|
2.0/chapter19/#29 |
2009-11-23 14:01:01
|
它让开发者和模板的作者指定他们的应用程序的哪些部分应该被翻译。
|
|
old_taoist
|
2.0/chapter19/#22 |
2009-11-23 13:59:20
|
简要地说,您只需要添加少量的钩子到您的Python代码和模板中。
|
|
old_taoist
|
2.0/chapter19/#16 |
2009-11-23 13:56:45
|
Django本身是完全国际化的;所有的字符串均为翻译需要而被标记,并且设定与区域无关的显示控制值,如时间和日期。
|
|
old_taoist
|
2.0/chapter19/#13 |
2009-11-23 13:50:01
|
本地化是指使一个国际化的程序为了在某个特定地区使用而进行实际翻译的过程。
|
|
old_taoist
|
2.0/chapter19/#11 |
2009-11-23 13:48:22
|
您会经常看到国际化被缩写为“I18N”(18表示Internationlization这个单词首字母I和结尾字母N之间的字母有18个)。
|
|
old_taoist
|
2.0/chapter19/#10 |
2009-11-23 13:47:27
|
它包括为了以后的翻译而标记的文本(比如用户界面要素和错误信息等),日期和时间的抽象显示以保证显示遵循不同地区的标准,为不同时区提供支持,并且一般确保代码中不会有关于使用者所在地区的假设。
|
|
old_taoist
|
2.0/chapter19/#9 |
2009-11-23 13:38:25
|
国际化是指为了该软件在任何地区的潜在使用而进行设计的过程。
|
|
old_taoist
|
2.0/chapter19/#7 |
2009-11-23 13:36:17
|
由于很多开发者对这些措辞比较困惑,所以我们将简明的定义它们。
|
|
old_taoist
|
2.0/chapter19/#6 |
2009-11-23 13:32:28
|
鉴于Django社区逐渐变的多样性,
<emphasis>国际化</emphasis> 和
<emphasis>本地化</emphasis> 逐渐变的重要。
|
|
old_taoist
|
2.0/chapter19/#5 |
2009-11-23 13:25:05
|
像大多数开源项目一样,Djano社区逐渐开始包括来自全球的许多人。
|
|
15325@qq.com
|
2.0/chapter07/#401 |
2009-11-23 13:19:12
|
我们的contact form只涉及字符串类型,它们会被清理成Unicode对象。如果我们使用整数型或日期型,form框架会确保方法使用合适的Python整数型或<literal>datetime.date</literal>型对象。
|
|
old_taoist
|
2.0/chapter19/#4 |
2009-11-23 13:15:07
|
Django诞生于美国中部堪萨斯的劳伦斯,距美国的地理中心少于40英里。
|
|
15325@qq.com
|
2.0/chapter07/#398 |
2009-11-23 12:27:03
|
Django的form框架不但校验数据,它还会把它们转换成相应的Python类型数据,这叫做清理数据。
|
|
15325@qq.com
|
2.0/chapter07/#398 |
2009-11-23 12:26:52
|
Django的form框架不但校验数据,他还会把它们转换成相应的Python类型数据,这叫做清理数据。
|
|
15325@qq.com
|
2.0/chapter07/#396 |
2009-11-23 12:23:34
|
最终,如果一个<literal>Form</literal>实体的数据是合法的,它就会有一个可用的<literal>cleaned_data</literal>属性。
|
|