Advice on translating Auth related stuff

73 views
Skip to first unread message

Alan Etkin

unread,
Apr 4, 2026, 8:46:05 AMApr 4
to py4web
Hi

I checked issues #718 and #719 there are some workarounds to solve the problem with authentication forms, as they do not support auto-translation out of the box.

I want to translate any relevant login/register text in my app project. Can this be solved subclasing Auth at the model or is there something else to look at?

Thanks

Alan

Alan Etkin

unread,
Apr 5, 2026, 10:12:30 AMApr 5
to py4web
Found a way to "internationalize" Auth:

in common.py, after auth instantiation, overwrote auth.param.messages and passed to T any string value from the original dict at auth.py.

Perhaps it would be possible that py4web support T in core utils like Auth, Grid and Form, not sure about how, but I'd like to help with that.

Regards

Alan

Massimo DiPierro

unread,
May 9, 2026, 7:26:58 PMMay 9
to py4web
Check if this f2bad3d6afa2f127ba3414b18919dadbaca9ec52 does what you asked.

Alan Etkin

unread,
May 10, 2026, 9:10:42 AMMay 10
to py4web
Thanks! I will ASAP.

Alan

Alan Etkin

unread,
May 10, 2026, 1:18:16 PMMay 10
to py4web
Ok, I made a simple monkey test:

downloaded latest github folder to my system
overwrote latest release with patched files at ./apps and patched utils modules (for test venv)
tested a simple scaffolding app with dev server

The test app passes T to auth, grid and form objects
Seems that this has no effect, the feature labels (form, grid and auth) do not show at the translation page
The app's behavior is as usual, just the hardcoded T calls on the app code update the text at the translations page after you click "update languages"

In case a better test is needed let me know, I could use advice on how to set an environment with last time repo changes.

I tested the patch over an Ubuntu 25 machine

Regards
El sábado, 9 de mayo de 2026 a la(s) 8:26:58 p.m. UTC-3, massimo....@gmail.com escribió:

Massimo DiPierro

unread,
May 10, 2026, 2:57:46 PMMay 10
to py4web
Thanks. I will take a second look. 
Reply all
Reply to author
Forward
0 new messages