我有要以不同语言显示的表单:我使用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)
标签未翻译.有人有解决这个问题的方法吗?