Languages control programaticaly

15 views
Skip to first unread message

Ari Sobel

unread,
Oct 21, 2025, 2:13:33 PMOct 21
to Jam.py Users Mailing List

Hi everyone,

I’m building a Jam.py application that needs full multi-language support. From what I can tell, the language is currently set globally via Admin → Preferences, which seems admin-only.

My requirement is to let end users choose their UI language at runtime (per session or per user), without an admin changing the global setting.

Could you advise on the following?

  1. Is there an official way to set the active language programmatically at runtime?

  2. Can language be scoped per session/per user rather than globally?

  3. Are there recommended hooks (e.g., request/session lifecycle) where the language should be set?

  4. What is the recommended place/format for translation catalogs and is hot-reload supported?

For context, I’d like to support mechanisms such as:

  • a URL parameter (e.g., ?lang=pt-BR),

  • a user profile preference,

  • or Accept-Language negotiation,
    all resulting in the UI switching language immediately for that user.

Thanks in advance for any guidance!

Best regards,
Ari

Dean D. Babic

unread,
Oct 21, 2025, 9:55:35 PMOct 21
to Jam.py Users Mailing List
This was discussed Ari, see:

demo user has Spanish
admin user has English

The app does not know anything about your Captions, messages etc. That needs to be built as on this App.

Jam is SPA. SPA is not using permalinks like ?lang=pt-BR

And yes, it is possible to add the Lang selection on the Login Form. Just like on_login is used for sem app.
The Export is there. Use it. It has the sem.sqlite in it with all that Language support. But, it is v5 App, v5.5.4
The code will work with v7. But the App will not due to templates, etc.

This is big project Ari. But, it would be much bigger with PHP, since all this is in above app.

D.

Dean D. Babic

unread,
Oct 22, 2025, 1:28:01 AMOct 22
to Jam.py Users Mailing List
I did upgrade it to v7 on my PC. Maybe I will do this on pythonanywhere as well.
In here you can se Italian for Demo user. Of course, the top Menu was not translated (or its missing support to display Italian):

sem_v7_italian_jampy.png

See how that works? I needed to add PT on the list first!
sem_pt_lang_jampy.png

Then we install deep_translator with pip and click translate! In 20 min or so ALL will be done:
https://groups.google.com/g/jam-py/c/uvP9xNWK4yE/m/qg7NuFQLAgAJ


sem_translate_button_jampy.png

Now start working on Login Page and add the lang field, pass this to on_login and off u go.
sem_itm_translation_jampy.png

It really can't be easier than this!

Here is a V7 project so you can start working on Login page:
https://drive.google.com/file/d/15gkFtw0Q8wHQehDECsYCnqe4YHaUsyje/view?usp=sharing

All translated for you. What is needed is to copy all tables for languages, all JS and server code and SOME
Task JS code which is marked as Fabio - you will see the old V5 code commented out into your project.

You "own" me 5 hrs of work :)

D.
Reply all
Reply to author
Forward
0 new messages