All my other error messages (from built-in validators) are auto-translated. Including for the default auth_user fields (eg. username). Only the extra_fields are not.
Is there a fix? sexta-feira, 5 de Abril de 2019 às 18:56:10 UTC+1, Anthony escreveu: > > Note, this is due to the recent refactoring of all built-in validators > (moved from web2py to pydal). Previously, all default error messages were > translated, but that is no longer the case. Although the automatic > translation was not documented, I would still consider this a break in > backward compatibility (particularly given that all Auth error messages are > still being translated automatically). > > Anthony > > On Thursday, April 4, 2019 at 3:25:10 PM UTC-4, João Matos wrote: >> >> When creating extra fields for auth_user, the validation messages for >> those fields are always in English. They don't comply with the translations >> available. >> >> This does not happen on the default fields. >> >> >> I added this to 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))] >> >> >> When inserting an invalid value, the returned message is always >> >> Enter an integer between 5 and 50 >>> >> even when the web2py language is not English and the languages files have >> the correct translation available. >> >> >> web2py 2.18.4 >> Python 3.7.1 x86 >> Firefox 66.0.2 x64 >> Windows 7 Pro x64 SP1+all updates >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.