相关疑难解决方法(0)

Django形式和i18n

我有要以不同语言显示的表单:我使用label参数设置参数,并在标签上使用ugettext():

agreed_tos = forms.BooleanField(label=ugettext('I agree to the terms of service and to the privacy policy.'))
Run Code Online (Sandbox Code Playgroud)

但是当我在模板中渲染表单时,使用

{{form.as_p}}
Run Code Online (Sandbox Code Playgroud)

标签未翻译.有人有解决这个问题的方法吗?

forms django internationalization

12
推荐指数
1
解决办法
3496
查看次数

标签 统计

django ×1

forms ×1

internationalization ×1