auth_user中额外字段的验证消息不符合可用的翻译。还有其他人遇到这个问题吗?

时间:2019-04-04 22:34:43

标签: web2py

为auth_user创建额外的字段时,这些字段的验证消息始终为英文。他们不遵守可用的翻译。

在默认字段上不会发生这种情况。

我将此添加到db.py

auth.settings.extra_fields['auth_user'] = [
    Field('pagination',
          'integer',
          default=9,
          label=T('Pagination'),
          notnull=True,
          required=True,
          requires=IS_INT_IN_RANGE(5, 51),
    ),
]

插入无效值时,返回的消息始终为

Enter an integer between 5 and 50

即使web2py语言不是英语并且语言文件具有正确的翻译可用。

1 个答案:

答案 0 :(得分:0)

该问题被确定为某些验证程序使用消息的方式中的错误。 web2py组中的更多详细信息。 https://groups.google.com/forum/#!searchin/web2py/extra_fields%7Csort:date/web2py/7O_h5YotOsQ/cZ7OM43yCAAJ